@factset/sdk-factsetglobalprices
Version:
FactSet Global Prices client library for JavaScript
541 lines (515 loc) • 44.9 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.PostCorporateActionsResponseWrapper = exports.GetannualizedDividendsResponseWrapper = exports.GetannualizedDividendsForListResponseWrapper = exports.GetGPDCorporateActionsResponseWrapper = void 0;
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
var _AnnualizedDividendResponse = _interopRequireDefault(require("../model/AnnualizedDividendResponse"));
var _AnnualizedDividendsRequest = _interopRequireDefault(require("../model/AnnualizedDividendsRequest"));
var _BatchStatusResponse = _interopRequireDefault(require("../model/BatchStatusResponse"));
var _CorporateActionsRequest = _interopRequireDefault(require("../model/CorporateActionsRequest"));
var _CorporateActionsResponse = _interopRequireDefault(require("../model/CorporateActionsResponse"));
var _ErrorResponse = _interopRequireDefault(require("../model/ErrorResponse"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/**
* FactSet Global Prices API
* The FactSet Global Prices API provides end of day market pricing content using cloud and microservices technology, encompassing both pricing as well as corporate actions and events data.</p>
*
* The version of the OpenAPI document: 1.8.0
* Contact: api@factset.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
/**
* CorporateActions service.
* @module api/CorporateActionsApi
*/
class CorporateActionsApi {
/**
* Constructs a new CorporateActionsApi.
* @alias module:api/CorporateActionsApi
* @class
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
* default to {@link module:ApiClient#instance} if unspecified.
*/
constructor(apiClient) {
this.apiClient = apiClient || _ApiClient.default.instance;
}
/**
* Gets Corporate Actions information.
* Gets the Corporate Actions amounts, dates, types, and flags over a specified date range. You may request future dates to receive information for declared events. Event Categories: * __Cash Dividends__ (CASH_DIVS) * **DVC** - Dividend * **DVCD** - Dividend with DRP Option * **DRP** - Dividend Reinvestment * __Stock Distributions__ (STOCK_DIST) * **DVS** - Stock Dividend * **DVSS** - Stock Dividend, Special * **BNS** - Bonus Issue * **BNSS** - Bonus Issue, Special * __Spin Offs__ (SPINOFFS) * **SPO** - Spin Off * __Rights Issue__ (RIGHTS) * **DSR** - Rights Issue * __Splits__ (SPLITS) * **FSP** - Forward Split * **RSP** - Reverse Split * **SPL** - Split * **EXOS** - Exchange of Securities
* @param {Array.<String>} ids The requested list of security identifiers. Accepted ID types include Market Tickers, SEDOL, ISINs, CUSIPs, or FactSet Permanent Ids.<p>***ids limit** = 50 per both non-batch request and batch request*</p> *<p>Make note, GET Method URL request lines are also limited to a total length of 8192 bytes (8KB). In cases where the service allows for thousands of ids, which may lead to exceeding this request line limit of 8KB, it's advised for any requests with large request lines to be requested through the respective \"POST\" method.</p>*
* @param {Object} opts Optional parameters
* @param {module:model/String} opts.eventCategory Selects the Event Category to include in the response. * **CASH_DIVS** = Cash Dividends * **STOCK_DIST** = Stock Distributions * **SPINOFFS** = Spin Offs * **RIGHTS** = Rights Issue * **SPLITS** = Splits * **ALL** = Returns all Event Types. If left blank the service will default to ALL. (default to 'ALL')
* @param {Array.<String>} opts.fields Request available Corporate Actions data fields to be included in the response. Default is all fields. _fsymId_, _effectiveDate_, _eventTypeCode_ and _requestId_ are always included. |field|description| |---|---| |fsymId|Factset Regional Security Identifier| |eventTypeCode|Character code that denotes the type of event| |effectiveDate|The date when security is traded ex-dividend| |requestId|Identifier that was used for the request.| <h3>Common Fields</h3> |field|description| |---|---| |eventId|Uniquely Identifies the event| |eventTypeDesc|Description of the type of event| |divTypeCode|Dividend type code. [OA#8764](https://my.apps.factset.com/oa/pages/8764)| |announcementDate|Date the event was publicly announced| |recordDate|Record date of the event| |payDate|Payment date of the event| <h3>Dividend Fields</h3> |field|description| |---|---| |currency|Currency ISO code associated with distribution amount converted into trading currency of the record.| |amtDefNetGrossIndicator|Indicates whether the default amount is net or gross. G=Gross; N=Net.| |amtDefTradingAdj|Cash distribution amount (net or gross) in the trading currency of the record. Amount is translated to the trading currency based on the exchange rate as of the effective date. The value is adjusted for splits.| |amtDefTradingUnadj|Cash distribution amount (net or gross) in the trading currency of the record. Amount is translated to the trading currency based on the exchange rate as of the effective date. The value is not adjusted for splits. | |amtNetTradingAdj|Net distribution amount in the trading currency of the record. Amount is translated to the trading currency based on the exchange rate as of the effective date. The value is adjusted for splits.| |amtNetTradingUnadj|Net distribution amount in the trading currency of the record. Amount is translated to the trading currency based on the exchange rate as of the effective date. The value is not adjusted for splits.| |amtGrossTradingAdj|Gross distribution amount in the trading currency of the record. Amount is translated to the trading currency based on the exchange rate as of the effective date. The value is adjusted for splits.| |amtGrossTradingUnadj|Gross distribution amount in the trading currency of the record. Amount is translated to the trading currency based on the exchange rate as of the effective date. The value is not adjusted for splits.| |declaredCurrency|Currency ISO code associated with the declared amount. | |amtDefDecAdj|Cash distribution amount (net or gross) in the currency it was declared in. The value is adjusted for splits.| |amtDefDecUnadj|Cash distribution amount (net or gross) in the currency it was declared in. The value is not adjusted for splits.| |amtNetDecAdj|Net cash distribution amount in the currency it was declared in. The value is adjusted for splits. | |amtNetDecUnadj|Net cash distribution amount in the currency it was declared in. The value is not adjusted for splits.| |amtGrossDecAdj|Gross cash distribution amount in the currency it was declared in. N/A is returned if the gross amount is not available. The value is adjusted for splits.| |amtGrossDecUnadj|Gross cash distribution amount in the currency it was declared in. The value is not adjusted for splits.| |dividendStatus|Identifies the cancelled dividends status( Active, Cancelled, Postponed, Partial Information) and helps to evaluate their price and portfolio performance.Its applicable to Dividend(DVC) and Dividend with DRP option(DVCD)| |dividendActiveFlag|Identifies whether the dividend record is currently active(1) or inactive(0).Its applicable to Dividend(DVC) and Dividend with DRP option(DVCD)| |dividendsSpecFlag|Indicates a special price implications exists, which may or may not include special dividends. Indicates whether an adjustment should be made to historical pricing.| |dividendFrequencyDesc|Dividend Frequency for different event types in the form of a text as per the descriptions found here [OA#8764](https://my.apps.factset.com/oa/pages/8764#Frequency)| |dividendFrequencyCode|Dividend Frequency for different event types in the form of a code as per the details found here [OA#8764](https://my.apps.factset.com/oa/pages/8764#Frequency)| |frankDefTradingAdj|Split amount of dividend that is franked (subject to tax credit). Published in the trading currency of the input ID. Amount is translated to the trading currency based on the exchange rate as of the effective date.**Only applicable for Australian Securities**.| |frankDefTradingUnadj|Unsplit amount of dividend that is franked (subject to tax credit). Published in the trading currency of the input ID. Amount is translated to the trading currency based on the exchange rate as of the effective date.**Only applicable for Australian Securities**.| |frankDefDecAdj|Split amount of dividend that is franked (subject to tax credit). Published in the currency the dividend was declared in.Amount is translated to the trading currency based on the exchange rate as of the effective date. **Only applicable for Australian Securities**.| |frankDefDecUnadj|Unsplit amount of dividend that is franked (subject to tax credit). Published in the currency the dividend was declared in.Amount is translated to the trading currency based on the exchange rate as of the effective date. **Only applicable for Australian Securities**.| |frankPct|Percent of total dividend that is franked (subject to tax credit). **Only applicable for Australian Securities**.| |taxRate|Domestic Withholding Tax Rate for a Resident Individual| <h3>Distribution Fields</h3> |field|description| |---|---| |adjFactor|Factor applied to adjust historical prices. Calculation formulas are available on [OA#12619](https://my.apps.factset.com/oa/pages/12619)| |adjFactorCombined|Combined adjustment factor for all distribution events on that day.| |amtDefTradingAdj|Cash distribution amount (net or gross) in the trading currency of the record. Amount is translated to the trading currency based on the exchange rate as of the effective date. The value is adjusted for splits.| |amtDefTradingUnadj|Cash distribution amount (net or gross) in the trading currency of the record. Amount is translated to the trading currency based on the exchange rate as of the effective date. The value is not adjusted for splits. | |currency|Currency ISO code associated with distribution amount converted into trading currency of the record.| |distPct|Distribution percentage of the event (i.e. 10%). Typical for stock distributions.| |distOldTerm|Component of distribution ratio- Number of shares held.| |distNewTerm|Component of distribution ratio - Number of shares received.| |rightsIssuePrice|Price of the rights issue. | |rightsIssueCurrency|Currency the rights issue price was declared in.| |shortDesc|Textual description identifying the event. Example- Split (Mandatory): 3 for 1.| <h3>Splits Fields</h3> |field|description| |---|---| |adjFactor|Distribution percentage of the event (i.e. 10%). Typical for stock distributions.| |adjFactorCombined|Combined adjustment factor for all distribution events on that day.| |distOldTerm|Component of distribution ratio- Number of shares held.| |distNewTerm|Component of distribution ratio - Number of shares received.| |distInstFsymId|Helps to identify an instrument representing the distributed company or security associated with ca event identifier. Its applicable for types like Bonus issue(BNS),Stock dividend(DVS),Rights issue (DSR), and spin off(SPO).| |shortDesc|Textual description identifying the event. Example- Split (Mandatory): 3 for 1.|
* @param {String} opts.startDate The start date requested for a given date range in **YYYY-MM-DD** format. In the context of corporate actions, this filters the response to only include events within the date range. The frequency between the startDate and endDate is always set to the \"event\" frequency- meaning the service will return only events within those inclusive boundaries. Leaving both startDate and endDate blank will pull \"all\" events for each requested ids.
* @param {String} opts.endDate The end date requested for a given date range in **YYYY-MM-DD** format. In the context of corporate actions, this filters the response to only include events within the date range. The frequency between the startDate and endDate is always set to the \"event\" frequency- meaning the service will return only events within those inclusive boundaries. Leaving both startDate and endDate blank will pull \"all\" events for each requested ids.
* @param {String} opts.currency Currency code for adjusting prices. Default is Local. For a list of currency ISO codes, visit [Online Assistant Page 1470](https://oa.apps.factset.com/pages/1470).
* @param {module:model/String} opts.cancelledDividend The cancelled dividend returns the dividend details whether they are cancelled or active. (default to 'exclude')
* @param {module:model/String} opts.batch Enables the ability to asynchronously \"batch\" the request, supporting a long-running request for up to 20 minutes. Upon requesting batch=Y, the service will respond with an HTTP Status Code of 202. Once a batch request is submitted, use batch status to see if the job has been completed. Once completed, retrieve the results of the request via batch-result. For single-day requests, the ids limit is 500 for non-batch and 2000 for batch. For multi-day requests, the limit is 50 ids for both batch and non-batch. Limits on query string via GET method still apply. It's advised to submit large lists of ids via POST method. <B>Please note that the number of unique currencies present in the requested ids is limited to 50 per request.</B> (default to 'N')
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CorporateActionsResponse} and HTTP response
*/
getGPDCorporateActionsWithHttpInfo(ids, opts) {
opts = opts || {};
let postBody = null;
// verify the required parameter 'ids' is set
if (ids === undefined || ids === null) {
throw new Error("Missing the required parameter 'ids' when calling getGPDCorporateActions");
}
let pathParams = {};
let queryParams = {
'ids': this.apiClient.buildCollectionParam(ids, 'csv'),
'eventCategory': opts['eventCategory'],
'fields': this.apiClient.buildCollectionParam(opts['fields'], 'csv'),
'startDate': opts['startDate'],
'endDate': opts['endDate'],
'currency': opts['currency'],
'cancelledDividend': opts['cancelledDividend'],
'batch': opts['batch']
};
let headerParams = {};
let formParams = {};
let authNames = ['FactSetApiKey', 'FactSetOAuth2'];
let contentTypes = [];
let accepts = ['application/json'];
let returnType = GetGPDCorporateActionsResponseWrapperTypeMap;
return this.apiClient.callApi('/factset-global-prices/v1/corporate-actions', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
}
/**
* Gets Corporate Actions information.
* Gets the Corporate Actions amounts, dates, types, and flags over a specified date range. You may request future dates to receive information for declared events. Event Categories: * __Cash Dividends__ (CASH_DIVS) * **DVC** - Dividend * **DVCD** - Dividend with DRP Option * **DRP** - Dividend Reinvestment * __Stock Distributions__ (STOCK_DIST) * **DVS** - Stock Dividend * **DVSS** - Stock Dividend, Special * **BNS** - Bonus Issue * **BNSS** - Bonus Issue, Special * __Spin Offs__ (SPINOFFS) * **SPO** - Spin Off * __Rights Issue__ (RIGHTS) * **DSR** - Rights Issue * __Splits__ (SPLITS) * **FSP** - Forward Split * **RSP** - Reverse Split * **SPL** - Split * **EXOS** - Exchange of Securities
* @param {Array.<String>} ids The requested list of security identifiers. Accepted ID types include Market Tickers, SEDOL, ISINs, CUSIPs, or FactSet Permanent Ids.<p>***ids limit** = 50 per both non-batch request and batch request*</p> *<p>Make note, GET Method URL request lines are also limited to a total length of 8192 bytes (8KB). In cases where the service allows for thousands of ids, which may lead to exceeding this request line limit of 8KB, it's advised for any requests with large request lines to be requested through the respective \"POST\" method.</p>*
* @param {Object} opts Optional parameters
* @param {module:model/String} opts.eventCategory Selects the Event Category to include in the response. * **CASH_DIVS** = Cash Dividends * **STOCK_DIST** = Stock Distributions * **SPINOFFS** = Spin Offs * **RIGHTS** = Rights Issue * **SPLITS** = Splits * **ALL** = Returns all Event Types. If left blank the service will default to ALL. (default to 'ALL')
* @param {Array.<String>} opts.fields Request available Corporate Actions data fields to be included in the response. Default is all fields. _fsymId_, _effectiveDate_, _eventTypeCode_ and _requestId_ are always included. |field|description| |---|---| |fsymId|Factset Regional Security Identifier| |eventTypeCode|Character code that denotes the type of event| |effectiveDate|The date when security is traded ex-dividend| |requestId|Identifier that was used for the request.| <h3>Common Fields</h3> |field|description| |---|---| |eventId|Uniquely Identifies the event| |eventTypeDesc|Description of the type of event| |divTypeCode|Dividend type code. [OA#8764](https://my.apps.factset.com/oa/pages/8764)| |announcementDate|Date the event was publicly announced| |recordDate|Record date of the event| |payDate|Payment date of the event| <h3>Dividend Fields</h3> |field|description| |---|---| |currency|Currency ISO code associated with distribution amount converted into trading currency of the record.| |amtDefNetGrossIndicator|Indicates whether the default amount is net or gross. G=Gross; N=Net.| |amtDefTradingAdj|Cash distribution amount (net or gross) in the trading currency of the record. Amount is translated to the trading currency based on the exchange rate as of the effective date. The value is adjusted for splits.| |amtDefTradingUnadj|Cash distribution amount (net or gross) in the trading currency of the record. Amount is translated to the trading currency based on the exchange rate as of the effective date. The value is not adjusted for splits. | |amtNetTradingAdj|Net distribution amount in the trading currency of the record. Amount is translated to the trading currency based on the exchange rate as of the effective date. The value is adjusted for splits.| |amtNetTradingUnadj|Net distribution amount in the trading currency of the record. Amount is translated to the trading currency based on the exchange rate as of the effective date. The value is not adjusted for splits.| |amtGrossTradingAdj|Gross distribution amount in the trading currency of the record. Amount is translated to the trading currency based on the exchange rate as of the effective date. The value is adjusted for splits.| |amtGrossTradingUnadj|Gross distribution amount in the trading currency of the record. Amount is translated to the trading currency based on the exchange rate as of the effective date. The value is not adjusted for splits.| |declaredCurrency|Currency ISO code associated with the declared amount. | |amtDefDecAdj|Cash distribution amount (net or gross) in the currency it was declared in. The value is adjusted for splits.| |amtDefDecUnadj|Cash distribution amount (net or gross) in the currency it was declared in. The value is not adjusted for splits.| |amtNetDecAdj|Net cash distribution amount in the currency it was declared in. The value is adjusted for splits. | |amtNetDecUnadj|Net cash distribution amount in the currency it was declared in. The value is not adjusted for splits.| |amtGrossDecAdj|Gross cash distribution amount in the currency it was declared in. N/A is returned if the gross amount is not available. The value is adjusted for splits.| |amtGrossDecUnadj|Gross cash distribution amount in the currency it was declared in. The value is not adjusted for splits.| |dividendStatus|Identifies the cancelled dividends status( Active, Cancelled, Postponed, Partial Information) and helps to evaluate their price and portfolio performance.Its applicable to Dividend(DVC) and Dividend with DRP option(DVCD)| |dividendActiveFlag|Identifies whether the dividend record is currently active(1) or inactive(0).Its applicable to Dividend(DVC) and Dividend with DRP option(DVCD)| |dividendsSpecFlag|Indicates a special price implications exists, which may or may not include special dividends. Indicates whether an adjustment should be made to historical pricing.| |dividendFrequencyDesc|Dividend Frequency for different event types in the form of a text as per the descriptions found here [OA#8764](https://my.apps.factset.com/oa/pages/8764#Frequency)| |dividendFrequencyCode|Dividend Frequency for different event types in the form of a code as per the details found here [OA#8764](https://my.apps.factset.com/oa/pages/8764#Frequency)| |frankDefTradingAdj|Split amount of dividend that is franked (subject to tax credit). Published in the trading currency of the input ID. Amount is translated to the trading currency based on the exchange rate as of the effective date.**Only applicable for Australian Securities**.| |frankDefTradingUnadj|Unsplit amount of dividend that is franked (subject to tax credit). Published in the trading currency of the input ID. Amount is translated to the trading currency based on the exchange rate as of the effective date.**Only applicable for Australian Securities**.| |frankDefDecAdj|Split amount of dividend that is franked (subject to tax credit). Published in the currency the dividend was declared in.Amount is translated to the trading currency based on the exchange rate as of the effective date. **Only applicable for Australian Securities**.| |frankDefDecUnadj|Unsplit amount of dividend that is franked (subject to tax credit). Published in the currency the dividend was declared in.Amount is translated to the trading currency based on the exchange rate as of the effective date. **Only applicable for Australian Securities**.| |frankPct|Percent of total dividend that is franked (subject to tax credit). **Only applicable for Australian Securities**.| |taxRate|Domestic Withholding Tax Rate for a Resident Individual| <h3>Distribution Fields</h3> |field|description| |---|---| |adjFactor|Factor applied to adjust historical prices. Calculation formulas are available on [OA#12619](https://my.apps.factset.com/oa/pages/12619)| |adjFactorCombined|Combined adjustment factor for all distribution events on that day.| |amtDefTradingAdj|Cash distribution amount (net or gross) in the trading currency of the record. Amount is translated to the trading currency based on the exchange rate as of the effective date. The value is adjusted for splits.| |amtDefTradingUnadj|Cash distribution amount (net or gross) in the trading currency of the record. Amount is translated to the trading currency based on the exchange rate as of the effective date. The value is not adjusted for splits. | |currency|Currency ISO code associated with distribution amount converted into trading currency of the record.| |distPct|Distribution percentage of the event (i.e. 10%). Typical for stock distributions.| |distOldTerm|Component of distribution ratio- Number of shares held.| |distNewTerm|Component of distribution ratio - Number of shares received.| |rightsIssuePrice|Price of the rights issue. | |rightsIssueCurrency|Currency the rights issue price was declared in.| |shortDesc|Textual description identifying the event. Example- Split (Mandatory): 3 for 1.| <h3>Splits Fields</h3> |field|description| |---|---| |adjFactor|Distribution percentage of the event (i.e. 10%). Typical for stock distributions.| |adjFactorCombined|Combined adjustment factor for all distribution events on that day.| |distOldTerm|Component of distribution ratio- Number of shares held.| |distNewTerm|Component of distribution ratio - Number of shares received.| |distInstFsymId|Helps to identify an instrument representing the distributed company or security associated with ca event identifier. Its applicable for types like Bonus issue(BNS),Stock dividend(DVS),Rights issue (DSR), and spin off(SPO).| |shortDesc|Textual description identifying the event. Example- Split (Mandatory): 3 for 1.|
* @param {String} opts.startDate The start date requested for a given date range in **YYYY-MM-DD** format. In the context of corporate actions, this filters the response to only include events within the date range. The frequency between the startDate and endDate is always set to the \"event\" frequency- meaning the service will return only events within those inclusive boundaries. Leaving both startDate and endDate blank will pull \"all\" events for each requested ids.
* @param {String} opts.endDate The end date requested for a given date range in **YYYY-MM-DD** format. In the context of corporate actions, this filters the response to only include events within the date range. The frequency between the startDate and endDate is always set to the \"event\" frequency- meaning the service will return only events within those inclusive boundaries. Leaving both startDate and endDate blank will pull \"all\" events for each requested ids.
* @param {String} opts.currency Currency code for adjusting prices. Default is Local. For a list of currency ISO codes, visit [Online Assistant Page 1470](https://oa.apps.factset.com/pages/1470).
* @param {module:model/String} opts.cancelledDividend The cancelled dividend returns the dividend details whether they are cancelled or active. (default to 'exclude')
* @param {module:model/String} opts.batch Enables the ability to asynchronously \"batch\" the request, supporting a long-running request for up to 20 minutes. Upon requesting batch=Y, the service will respond with an HTTP Status Code of 202. Once a batch request is submitted, use batch status to see if the job has been completed. Once completed, retrieve the results of the request via batch-result. For single-day requests, the ids limit is 500 for non-batch and 2000 for batch. For multi-day requests, the limit is 50 ids for both batch and non-batch. Limits on query string via GET method still apply. It's advised to submit large lists of ids via POST method. <B>Please note that the number of unique currencies present in the requested ids is limited to 50 per request.</B> (default to 'N')
* @return { Promise.< GetGPDCorporateActionsResponseWrapper > } a Promise, with data of type {@link GetGPDCorporateActionsResponseWrapper }
*/
getGPDCorporateActions(ids, opts) {
return this.getGPDCorporateActionsWithHttpInfo(ids, opts).then(function (response_and_data) {
return response_and_data.data;
});
}
/**
* Gets Indicated Annualized Dividend information.
* Gets the Annualized dividend of the latest reported dividend. The annualized dividend calculations does not involve cancelled dividends.
* @param {Array.<String>} ids The requested list of security identifiers. Accepted ID types include Market Tickers, SEDOL, ISINs, CUSIPs, or FactSet Permanent Ids.<p>***ids limit** = 50 per both non-batch request and batch request*</p> *<p>Make note, GET Method URL request lines are also limited to a total length of 8192 bytes (8KB). In cases where the service allows for thousands of ids, which may lead to exceeding this request line limit of 8KB, it's advised for any requests with large request lines to be requested through the respective \"POST\" method.</p>*
* @param {Object} opts Optional parameters
* @param {String} opts.currency Currency code for adjusting prices. Default is Local. For a list of currency ISO codes, visit [Online Assistant Page 1470](https://oa.apps.factset.com/pages/1470).
* @param {module:model/String} opts.batch Enables the ability to asynchronously \"batch\" the request, supporting a long-running request for up to 20 minutes. Upon requesting batch=Y, the service will respond with an HTTP Status Code of 202. Once a batch request is submitted, use batch status to see if the job has been completed. Once completed, retrieve the results of the request via batch-result. For single-day requests, the ids limit is 500 for non-batch and 2000 for batch. For multi-day requests, the limit is 50 ids for both batch and non-batch. Limits on query string via GET method still apply. It's advised to submit large lists of ids via POST method. <B>Please note that the number of unique currencies present in the requested ids is limited to 50 per request.</B> (default to 'N')
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/AnnualizedDividendResponse} and HTTP response
*/
getannualizedDividendsWithHttpInfo(ids, opts) {
opts = opts || {};
let postBody = null;
// verify the required parameter 'ids' is set
if (ids === undefined || ids === null) {
throw new Error("Missing the required parameter 'ids' when calling getannualizedDividends");
}
let pathParams = {};
let queryParams = {
'ids': this.apiClient.buildCollectionParam(ids, 'csv'),
'currency': opts['currency'],
'batch': opts['batch']
};
let headerParams = {};
let formParams = {};
let authNames = ['FactSetApiKey', 'FactSetOAuth2'];
let contentTypes = [];
let accepts = ['application/json'];
let returnType = GetannualizedDividendsResponseWrapperTypeMap;
return this.apiClient.callApi('/factset-global-prices/v1/annualized-dividends', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
}
/**
* Gets Indicated Annualized Dividend information.
* Gets the Annualized dividend of the latest reported dividend. The annualized dividend calculations does not involve cancelled dividends.
* @param {Array.<String>} ids The requested list of security identifiers. Accepted ID types include Market Tickers, SEDOL, ISINs, CUSIPs, or FactSet Permanent Ids.<p>***ids limit** = 50 per both non-batch request and batch request*</p> *<p>Make note, GET Method URL request lines are also limited to a total length of 8192 bytes (8KB). In cases where the service allows for thousands of ids, which may lead to exceeding this request line limit of 8KB, it's advised for any requests with large request lines to be requested through the respective \"POST\" method.</p>*
* @param {Object} opts Optional parameters
* @param {String} opts.currency Currency code for adjusting prices. Default is Local. For a list of currency ISO codes, visit [Online Assistant Page 1470](https://oa.apps.factset.com/pages/1470).
* @param {module:model/String} opts.batch Enables the ability to asynchronously \"batch\" the request, supporting a long-running request for up to 20 minutes. Upon requesting batch=Y, the service will respond with an HTTP Status Code of 202. Once a batch request is submitted, use batch status to see if the job has been completed. Once completed, retrieve the results of the request via batch-result. For single-day requests, the ids limit is 500 for non-batch and 2000 for batch. For multi-day requests, the limit is 50 ids for both batch and non-batch. Limits on query string via GET method still apply. It's advised to submit large lists of ids via POST method. <B>Please note that the number of unique currencies present in the requested ids is limited to 50 per request.</B> (default to 'N')
* @return { Promise.< GetannualizedDividendsResponseWrapper > } a Promise, with data of type {@link GetannualizedDividendsResponseWrapper }
*/
getannualizedDividends(ids, opts) {
return this.getannualizedDividendsWithHttpInfo(ids, opts).then(function (response_and_data) {
return response_and_data.data;
});
}
/**
* Gets Indicated Annualized Dividend information.
* Gets the Annualized dividend of the latest reported dividend. The annualized dividend calculations does not involve cancelled dividends.
* @param {module:model/AnnualizedDividendsRequest} annualizedDividendsRequest Request object for `Annualized Response`.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/AnnualizedDividendResponse} and HTTP response
*/
getannualizedDividendsForListWithHttpInfo(annualizedDividendsRequest) {
let postBody = annualizedDividendsRequest;
// verify the required parameter 'annualizedDividendsRequest' is set
if (annualizedDividendsRequest === undefined || annualizedDividendsRequest === null) {
throw new Error("Missing the required parameter 'annualizedDividendsRequest' when calling getannualizedDividendsForList");
}
let pathParams = {};
let queryParams = {};
let headerParams = {};
let formParams = {};
let authNames = ['FactSetApiKey', 'FactSetOAuth2'];
let contentTypes = ['application/json'];
let accepts = ['application/json'];
let returnType = GetannualizedDividendsForListResponseWrapperTypeMap;
return this.apiClient.callApi('/factset-global-prices/v1/annualized-dividends', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
}
/**
* Gets Indicated Annualized Dividend information.
* Gets the Annualized dividend of the latest reported dividend. The annualized dividend calculations does not involve cancelled dividends.
* @param {module:model/AnnualizedDividendsRequest} annualizedDividendsRequest Request object for `Annualized Response`.
* @return { Promise.< GetannualizedDividendsForListResponseWrapper > } a Promise, with data of type {@link GetannualizedDividendsForListResponseWrapper }
*/
getannualizedDividendsForList(annualizedDividendsRequest) {
return this.getannualizedDividendsForListWithHttpInfo(annualizedDividendsRequest).then(function (response_and_data) {
return response_and_data.data;
});
}
/**
* Requests Corporate Actions information.
* Gets the Corporate Actions amounts, dates, types, and flags over a specified date range. You may request future dates to receive information for declared events. <p>**_startDate and endDate are required parameters. The input startDate must come before the input endDate._**
* @param {module:model/CorporateActionsRequest} corporateActionsRequest Request object for `Corporate Actions`.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CorporateActionsResponse} and HTTP response
*/
postCorporateActionsWithHttpInfo(corporateActionsRequest) {
let postBody = corporateActionsRequest;
// verify the required parameter 'corporateActionsRequest' is set
if (corporateActionsRequest === undefined || corporateActionsRequest === null) {
throw new Error("Missing the required parameter 'corporateActionsRequest' when calling postCorporateActions");
}
let pathParams = {};
let queryParams = {};
let headerParams = {};
let formParams = {};
let authNames = ['FactSetApiKey', 'FactSetOAuth2'];
let contentTypes = ['application/json'];
let accepts = ['application/json'];
let returnType = PostCorporateActionsResponseWrapperTypeMap;
return this.apiClient.callApi('/factset-global-prices/v1/corporate-actions', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
}
/**
* Requests Corporate Actions information.
* Gets the Corporate Actions amounts, dates, types, and flags over a specified date range. You may request future dates to receive information for declared events. <p>**_startDate and endDate are required parameters. The input startDate must come before the input endDate._**
* @param {module:model/CorporateActionsRequest} corporateActionsRequest Request object for `Corporate Actions`.
* @return { Promise.< PostCorporateActionsResponseWrapper > } a Promise, with data of type {@link PostCorporateActionsResponseWrapper }
*/
postCorporateActions(corporateActionsRequest) {
return this.postCorporateActionsWithHttpInfo(corporateActionsRequest).then(function (response_and_data) {
return response_and_data.data;
});
}
}
exports.default = CorporateActionsApi;
const GetGPDCorporateActionsResponseWrapperTypeMap = {
200: _CorporateActionsResponse.default,
202: _BatchStatusResponse.default,
400: _ErrorResponse.default,
401: _ErrorResponse.default,
403: _ErrorResponse.default,
415: _ErrorResponse.default,
500: _ErrorResponse.default,
_createResponseWrapper(statusCode, response) {
return new GetGPDCorporateActionsResponseWrapper(statusCode, response);
}
};
const GetannualizedDividendsResponseWrapperTypeMap = {
200: _AnnualizedDividendResponse.default,
202: _BatchStatusResponse.default,
400: _ErrorResponse.default,
401: _ErrorResponse.default,
403: _ErrorResponse.default,
415: _ErrorResponse.default,
500: _ErrorResponse.default,
_createResponseWrapper(statusCode, response) {
return new GetannualizedDividendsResponseWrapper(statusCode, response);
}
};
const GetannualizedDividendsForListResponseWrapperTypeMap = {
200: _AnnualizedDividendResponse.default,
202: _BatchStatusResponse.default,
400: _ErrorResponse.default,
401: _ErrorResponse.default,
403: _ErrorResponse.default,
415: _ErrorResponse.default,
500: _ErrorResponse.default,
_createResponseWrapper(statusCode, response) {
return new GetannualizedDividendsForListResponseWrapper(statusCode, response);
}
};
const PostCorporateActionsResponseWrapperTypeMap = {
200: _CorporateActionsResponse.default,
202: _BatchStatusResponse.default,
400: _ErrorResponse.default,
401: _ErrorResponse.default,
403: _ErrorResponse.default,
415: _ErrorResponse.default,
500: _ErrorResponse.default,
_createResponseWrapper(statusCode, response) {
return new PostCorporateActionsResponseWrapper(statusCode, response);
}
};
/**
* Wrapper to support GET /factset-global-prices/v1/corporate-actions returning different types
* per status code.
*
* <p>
* Responses:
* <ul>
* <li>200 : {@code CorporateActionsResponse }<br>Array of security dividend information for a given date range and list of securities</li>
*
* <li>202 : {@code BatchStatusResponse }<br>Batch request has been accepted.</li>
* </ul>
*
* </p>
* Example:
* <pre>{@code
* const response = ...;
* switch (response.statusCode) {
* case 200:
* CorporateActionsResponse data200 = response.getResponse200();
* break;
* case 202:
* BatchStatusResponse data202 = response.getResponse202();
* break;
* }
* }</pre>
*
* @alias module:GetGPDCorporateActionsResponseWrapper
* @class
*/
class GetGPDCorporateActionsResponseWrapper {
/**
* @param {number} statusCode
* @param {*} response
*/
constructor(statusCode, response) {
/**
* @type {number}
*/
this.statusCode = statusCode;
/**
* @type {*}
*/
this.response = response;
}
/**
* @returns { CorporateActionsResponse }
*/
getResponse200() {
if (this.statusCode !== 200) {
throw new Error("Invalid response getter called. getResponse200 can't return a " + this.statusCode + " response");
}
return this.response;
}
/**
* @returns { BatchStatusResponse }
*/
getResponse202() {
if (this.statusCode !== 202) {
throw new Error("Invalid response getter called. getResponse202 can't return a " + this.statusCode + " response");
}
return this.response;
}
}
/**
* Wrapper to support GET /factset-global-prices/v1/annualized-dividends returning different types
* per status code.
*
* <p>
* Responses:
* <ul>
* <li>200 : {@code AnnualizedDividendResponse }<br>Array of annualized dividend information.</li>
*
* <li>202 : {@code BatchStatusResponse }<br>Batch request has been accepted.</li>
* </ul>
*
* </p>
* Example:
* <pre>{@code
* const response = ...;
* switch (response.statusCode) {
* case 200:
* AnnualizedDividendResponse data200 = response.getResponse200();
* break;
* case 202:
* BatchStatusResponse data202 = response.getResponse202();
* break;
* }
* }</pre>
*
* @alias module:GetannualizedDividendsResponseWrapper
* @class
*/
exports.GetGPDCorporateActionsResponseWrapper = GetGPDCorporateActionsResponseWrapper;
class GetannualizedDividendsResponseWrapper {
/**
* @param {number} statusCode
* @param {*} response
*/
constructor(statusCode, response) {
/**
* @type {number}
*/
this.statusCode = statusCode;
/**
* @type {*}
*/
this.response = response;
}
/**
* @returns { AnnualizedDividendResponse }
*/
getResponse200() {
if (this.statusCode !== 200) {
throw new Error("Invalid response getter called. getResponse200 can't return a " + this.statusCode + " response");
}
return this.response;
}
/**
* @returns { BatchStatusResponse }
*/
getResponse202() {
if (this.statusCode !== 202) {
throw new Error("Invalid response getter called. getResponse202 can't return a " + this.statusCode + " response");
}
return this.response;
}
}
/**
* Wrapper to support POST /factset-global-prices/v1/annualized-dividends returning different types
* per status code.
*
* <p>
* Responses:
* <ul>
* <li>200 : {@code AnnualizedDividendResponse }<br>Array of security prices</li>
*
* <li>202 : {@code BatchStatusResponse }<br>Batch request has been accepted.</li>
* </ul>
*
* </p>
* Example:
* <pre>{@code
* const response = ...;
* switch (response.statusCode) {
* case 200:
* AnnualizedDividendResponse data200 = response.getResponse200();
* break;
* case 202:
* BatchStatusResponse data202 = response.getResponse202();
* break;
* }
* }</pre>
*
* @alias module:GetannualizedDividendsForListResponseWrapper
* @class
*/
exports.GetannualizedDividendsResponseWrapper = GetannualizedDividendsResponseWrapper;
class GetannualizedDividendsForListResponseWrapper {
/**
* @param {number} statusCode
* @param {*} response
*/
constructor(statusCode, response) {
/**
* @type {number}
*/
this.statusCode = statusCode;
/**
* @type {*}
*/
this.response = response;
}
/**
* @returns { AnnualizedDividendResponse }
*/
getResponse200() {
if (this.statusCode !== 200) {
throw new Error("Invalid response getter called. getResponse200 can't return a " + this.statusCode + " response");
}
return this.response;
}
/**
* @returns { BatchStatusResponse }
*/
getResponse202() {
if (this.statusCode !== 202) {
throw new Error("Invalid response getter called. getResponse202 can't return a " + this.statusCode + " response");
}
return this.response;
}
}
/**
* Wrapper to support POST /factset-global-prices/v1/corporate-actions returning different types
* per status code.
*
* <p>
* Responses:
* <ul>
* <li>200 : {@code CorporateActionsResponse }<br>Array of security prices</li>
*
* <li>202 : {@code BatchStatusResponse }<br>Batch request has been accepted.</li>
* </ul>
*
* </p>
* Example:
* <pre>{@code
* const response = ...;
* switch (response.statusCode) {
* case 200:
* CorporateActionsResponse data200 = response.getResponse200();
* break;
* case 202:
* BatchStatusResponse data202 = response.getResponse202();
* break;
* }
* }</pre>
*
* @alias module:PostCorporateActionsResponseWrapper
* @class
*/
exports.GetannualizedDividendsForListResponseWrapper = GetannualizedDividendsForListResponseWrapper;
class PostCorporateActionsResponseWrapper {
/**
* @param {number} statusCode
* @param {*} response
*/
constructor(statusCode, response) {
/**
* @type {number}
*/
this.statusCode = statusCode;
/**
* @type {*}
*/
this.response = response;
}
/**
* @returns { CorporateActionsResponse }
*/
getResponse200() {
if (this.statusCode !== 200) {
throw new Error("Invalid response getter called. getResponse200 can't return a " + this.statusCode + " response");
}
return this.response;
}
/**
* @returns { BatchStatusResponse }
*/
getResponse202() {
if (this.statusCode !== 202) {
throw new Error("Invalid response getter called. getResponse202 can't return a " + this.statusCode + " response");
}
return this.response;
}
}
exports.PostCorporateActionsResponseWrapper = PostCorporateActionsResponseWrapper;