All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.factset.sdk.FactSetEstimates.api.SurpriseApi Maven / Gradle / Ivy

package com.factset.sdk.FactSetEstimates.api;

import com.factset.sdk.FactSetEstimates.ApiException;
import com.factset.sdk.FactSetEstimates.ApiClient;
import com.factset.sdk.FactSetEstimates.ApiResponse;
import com.factset.sdk.FactSetEstimates.Configuration;
import com.factset.sdk.FactSetEstimates.Pair;

import jakarta.ws.rs.core.GenericType;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

import com.factset.sdk.FactSetEstimates.models.ErrorResponse;
import com.factset.sdk.FactSetEstimates.models.SurpriseRequest;
import com.factset.sdk.FactSetEstimates.models.SurpriseResponse;

@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")

public class SurpriseApi {
  private ApiClient apiClient;

  public SurpriseApi() {
    this(Configuration.getDefaultApiClient());
  }

  public SurpriseApi(ApiClient apiClient) {
    this.apiClient = apiClient;
  }
  
  private static final Map getSurpriseResponseTypeMap = new HashMap();
  static {
    getSurpriseResponseTypeMap.put(200, new GenericType(){});
    getSurpriseResponseTypeMap.put(400, new GenericType(){});
    getSurpriseResponseTypeMap.put(401, new GenericType(){});
    getSurpriseResponseTypeMap.put(403, new GenericType(){});
    getSurpriseResponseTypeMap.put(415, new GenericType(){});
    getSurpriseResponseTypeMap.put(500, new GenericType(){});
  }

  private static final Map getSurpriseForListResponseTypeMap = new HashMap();
  static {
    getSurpriseForListResponseTypeMap.put(200, new GenericType(){});
    getSurpriseForListResponseTypeMap.put(400, new GenericType(){});
    getSurpriseForListResponseTypeMap.put(401, new GenericType(){});
    getSurpriseForListResponseTypeMap.put(403, new GenericType(){});
    getSurpriseForListResponseTypeMap.put(415, new GenericType(){});
    getSurpriseForListResponseTypeMap.put(500, new GenericType(){});
  }

  


  /**
   * Get the API client
   *
   * @return API client
   */
  public ApiClient getApiClient() {
    return apiClient;
  }

  /**
   * Set the API client
   *
   * @param apiClient an instance of API client
   */
  public void setApiClient(ApiClient apiClient) {
    this.apiClient = apiClient;
  }

  /**
   * Surprise estimates for rolling fiscal periods
   * Returns FactSet Estimates surprise data using rolling fiscal dates. 
   * @param ids Security or Entity identifiers. FactSet Identifiers, tickers, CUSIP and SEDOL are accepted input. <p>***ids limit** =  3000 per request*</p> * 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. *  (required)
   * @param metrics 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).  (required)
   * @param startDate Start date for point in time of estimates expressed in YYYY-MM-DD format. (optional)
   * @param endDate End date for point in time of estimates expressed in YYYY-MM-DD format. (optional)
   * @param frequency 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.   (optional, default to D)
   * @param periodicity The periodicity for the estimates requested, allowing you to fetch Quarterly, Semi-Annual and Annual Estimates.   * **ANN** - Annual   * **QTR** - Quarterly   * **SEMI** - Semi-Annual   (optional, default to ANN)
   * @param statistic Statistic for consensus calculation. (optional, default to MEAN)
   * @param currency 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). (optional)
   * @return SurpriseResponse
   * @throws ApiException if fails to make API call
   * @http.response.details
     
Status Code Description Response Headers
200 Estimate data items -
400 Bad Request. This can occur for several reasons. Please review the \"message\" for more details. -
401 Unauthenticated USERNAME-SERIAL. Ensure you are logged in and have successfully generated an API KEY for the IP range you are connecting from. For more help, select the **Report Issue** in the top right corner of this Developer Portal specification card and choose Connectivity 401 or 403 Responses. -
403 The USERNAME-SERIAL attempted to request the endpoint is not authorized to access. The request was a legal request, but the server is refusing to respond. Please reach out to FactSet Account Team for assistance with authorization. -
415 Unsupported Media Type. This error may be returned when the caller sends a resource in a format that is not accepted by the server. This can be fixed by ensuring that Content-Type header is set to the correct value. In this instance, \"application/json\" would be the appropriate value. -
500 Internal Server Error. -
*/ public SurpriseResponse getSurprise(java.util.List ids, java.util.List metrics, String startDate, String endDate, String frequency, String periodicity, String statistic, String currency) throws ApiException { return getSurpriseWithHttpInfo(ids, metrics, startDate, endDate, frequency, periodicity, statistic, currency).getData(); } /** * Surprise estimates for rolling fiscal periods * Returns FactSet Estimates surprise data using rolling fiscal dates. * @param ids Security or Entity identifiers. FactSet Identifiers, tickers, CUSIP and SEDOL are accepted input. <p>***ids limit** = 3000 per request*</p> * 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. * (required) * @param metrics 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). (required) * @param startDate Start date for point in time of estimates expressed in YYYY-MM-DD format. (optional) * @param endDate End date for point in time of estimates expressed in YYYY-MM-DD format. (optional) * @param frequency 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. (optional, default to D) * @param periodicity The periodicity for the estimates requested, allowing you to fetch Quarterly, Semi-Annual and Annual Estimates. * **ANN** - Annual * **QTR** - Quarterly * **SEMI** - Semi-Annual (optional, default to ANN) * @param statistic Statistic for consensus calculation. (optional, default to MEAN) * @param currency 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). (optional) * @return ApiResponse<SurpriseResponse> * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 Estimate data items -
400 Bad Request. This can occur for several reasons. Please review the \"message\" for more details. -
401 Unauthenticated USERNAME-SERIAL. Ensure you are logged in and have successfully generated an API KEY for the IP range you are connecting from. For more help, select the **Report Issue** in the top right corner of this Developer Portal specification card and choose Connectivity 401 or 403 Responses. -
403 The USERNAME-SERIAL attempted to request the endpoint is not authorized to access. The request was a legal request, but the server is refusing to respond. Please reach out to FactSet Account Team for assistance with authorization. -
415 Unsupported Media Type. This error may be returned when the caller sends a resource in a format that is not accepted by the server. This can be fixed by ensuring that Content-Type header is set to the correct value. In this instance, \"application/json\" would be the appropriate value. -
500 Internal Server Error. -
*/ public ApiResponse getSurpriseWithHttpInfo(java.util.List ids, java.util.List metrics, String startDate, String endDate, String frequency, String periodicity, String statistic, String currency) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'ids' is set if (ids == null) { throw new ApiException(400, "Missing the required parameter 'ids' when calling getSurprise"); } // verify the required parameter 'metrics' is set if (metrics == null) { throw new ApiException(400, "Missing the required parameter 'metrics' when calling getSurprise"); } // create path and map variables String localVarPath = "/factset-estimates/v2/surprise"; // query params java.util.List localVarQueryParams = new java.util.ArrayList(); java.util.Map localVarHeaderParams = new java.util.HashMap(); java.util.Map localVarCookieParams = new java.util.HashMap(); java.util.Map localVarFormParams = new java.util.HashMap(); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "ids", ids)); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "metrics", metrics)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "startDate", startDate)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "endDate", endDate)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "frequency", frequency)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "periodicity", periodicity)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "statistic", statistic)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "currency", currency)); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { "FactSetApiKey", "FactSetOAuth2", "FactSetOAuth2Client" }; ApiResponse< SurpriseResponse > apiResponse = apiClient.invokeAPI("SurpriseApi.getSurprise", localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, getSurpriseResponseTypeMap, false); return apiResponse; } /** * Surprise estimates for rolling fiscal periods * Returns FactSet Estimates surprise data using rolling fiscal dates. * @param surpriseRequest Request object for `Security` prices. (required) * @return SurpriseResponse * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 Estimate data items -
400 Bad Request. This can occur for several reasons. Please review the \"message\" for more details. -
401 Unauthenticated USERNAME-SERIAL. Ensure you are logged in and have successfully generated an API KEY for the IP range you are connecting from. For more help, select the **Report Issue** in the top right corner of this Developer Portal specification card and choose Connectivity 401 or 403 Responses. -
403 The USERNAME-SERIAL attempted to request the endpoint is not authorized to access. The request was a legal request, but the server is refusing to respond. Please reach out to FactSet Account Team for assistance with authorization. -
415 Unsupported Media Type. This error may be returned when the caller sends a resource in a format that is not accepted by the server. This can be fixed by ensuring that Content-Type header is set to the correct value. In this instance, \"application/json\" would be the appropriate value. -
500 Internal Server Error. -
*/ public SurpriseResponse getSurpriseForList(SurpriseRequest surpriseRequest) throws ApiException { return getSurpriseForListWithHttpInfo(surpriseRequest).getData(); } /** * Surprise estimates for rolling fiscal periods * Returns FactSet Estimates surprise data using rolling fiscal dates. * @param surpriseRequest Request object for `Security` prices. (required) * @return ApiResponse<SurpriseResponse> * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 Estimate data items -
400 Bad Request. This can occur for several reasons. Please review the \"message\" for more details. -
401 Unauthenticated USERNAME-SERIAL. Ensure you are logged in and have successfully generated an API KEY for the IP range you are connecting from. For more help, select the **Report Issue** in the top right corner of this Developer Portal specification card and choose Connectivity 401 or 403 Responses. -
403 The USERNAME-SERIAL attempted to request the endpoint is not authorized to access. The request was a legal request, but the server is refusing to respond. Please reach out to FactSet Account Team for assistance with authorization. -
415 Unsupported Media Type. This error may be returned when the caller sends a resource in a format that is not accepted by the server. This can be fixed by ensuring that Content-Type header is set to the correct value. In this instance, \"application/json\" would be the appropriate value. -
500 Internal Server Error. -
*/ public ApiResponse getSurpriseForListWithHttpInfo(SurpriseRequest surpriseRequest) throws ApiException { Object localVarPostBody = surpriseRequest; // verify the required parameter 'surpriseRequest' is set if (surpriseRequest == null) { throw new ApiException(400, "Missing the required parameter 'surpriseRequest' when calling getSurpriseForList"); } // create path and map variables String localVarPath = "/factset-estimates/v2/surprise"; // query params java.util.List localVarQueryParams = new java.util.ArrayList(); java.util.Map localVarHeaderParams = new java.util.HashMap(); java.util.Map localVarCookieParams = new java.util.HashMap(); java.util.Map localVarFormParams = new java.util.HashMap(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { "FactSetApiKey", "FactSetOAuth2", "FactSetOAuth2Client" }; ApiResponse< SurpriseResponse > apiResponse = apiClient.invokeAPI("SurpriseApi.getSurpriseForList", localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, getSurpriseForListResponseTypeMap, false); return apiResponse; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy