Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package com.factset.sdk.FixedIncomeCalculation.api;
import com.factset.sdk.FixedIncomeCalculation.ApiException;
import com.factset.sdk.FixedIncomeCalculation.ApiClient;
import com.factset.sdk.FixedIncomeCalculation.ApiResponse;
import com.factset.sdk.FixedIncomeCalculation.Configuration;
import com.factset.sdk.FixedIncomeCalculation.Pair;
import jakarta.ws.rs.core.GenericType;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import com.factset.sdk.FixedIncomeCalculation.models.CalculationInfoRoot;
import com.factset.sdk.FixedIncomeCalculation.models.ClientErrorResponse;
import com.factset.sdk.FixedIncomeCalculation.models.FICalculationParametersRoot;
import com.factset.sdk.FixedIncomeCalculation.models.ObjectRoot;
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class FiCalculationsApi {
private ApiClient apiClient;
public FiCalculationsApi() {
this(Configuration.getDefaultApiClient());
}
public FiCalculationsApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
private static final Map cancelCalculationByIdResponseTypeMap = new HashMap();
private static final Map getCalculationParametersResponseTypeMap = new HashMap();
static {
getCalculationParametersResponseTypeMap.put(200, new GenericType(){});
getCalculationParametersResponseTypeMap.put(400, new GenericType(){});
getCalculationParametersResponseTypeMap.put(404, new GenericType(){});
}
private static final Map getCalculationResultResponseTypeMap = new HashMap();
static {
getCalculationResultResponseTypeMap.put(200, new GenericType(){});
getCalculationResultResponseTypeMap.put(400, new GenericType(){});
getCalculationResultResponseTypeMap.put(404, new GenericType(){});
}
private static final Map getCalculationStatusByIdResponseTypeMap = new HashMap();
static {
getCalculationStatusByIdResponseTypeMap.put(201, new GenericType(){});
getCalculationStatusByIdResponseTypeMap.put(400, new GenericType(){});
getCalculationStatusByIdResponseTypeMap.put(404, new GenericType(){});
}
private static final Map postAndCalculateResponseTypeMap = new HashMap();
static {
postAndCalculateResponseTypeMap.put(201, new GenericType(){});
postAndCalculateResponseTypeMap.put(202, new GenericType(){});
postAndCalculateResponseTypeMap.put(400, new GenericType(){});
postAndCalculateResponseTypeMap.put(404, new GenericType(){});
}
private static final Map putAndCalculateResponseTypeMap = new HashMap();
static {
putAndCalculateResponseTypeMap.put(201, new GenericType(){});
putAndCalculateResponseTypeMap.put(202, new GenericType(){});
putAndCalculateResponseTypeMap.put(400, new GenericType(){});
putAndCalculateResponseTypeMap.put(404, new GenericType(){});
putAndCalculateResponseTypeMap.put(409, new GenericType(){});
}
/**
* Wrapper to support POST /calculations returning different types
* per status code.
*
*
* Responses:
*
*
201 : {@code ObjectRoot } Expected response if calculation is completed in a short span, returns JSON in the format specified in the Calculation parameters.
*
*
202 : {@code CalculationInfoRoot } Expected response, contains the poll URL in the Location header.
*/
public static class PostAndCalculateResponseWrapper {
public final int statusCode;
public final Object response;
public PostAndCalculateResponseWrapper(int statusCode, Object response) {
this.statusCode = statusCode;
this.response = response;
}
public int getStatusCode() { return statusCode; }
public Object getResponse() { return response; }
public ObjectRoot getResponse201() throws ApiException {
if (this.statusCode != 201) {
throw new ApiException(500, "Invalid response getter called. getResponse201 can't return a " + this.statusCode + " response");
}
return (ObjectRoot) this.response;
}
public CalculationInfoRoot getResponse202() throws ApiException {
if (this.statusCode != 202) {
throw new ApiException(500, "Invalid response getter called. getResponse202 can't return a " + this.statusCode + " response");
}
return (CalculationInfoRoot) this.response;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PostAndCalculateResponseWrapper other = (PostAndCalculateResponseWrapper) o;
return this.statusCode == other.statusCode &&
Objects.equals(this.response, other.response);
}
@Override
public int hashCode() {
return Objects.hash(statusCode, response);
}
@Override
public String toString() {
return "class PostAndCalculateResponseWrapper {\n"
+ " statusCode: " + statusCode + "\n"
+ " response: "
+ Objects.toString(response).replace("\n", "\n ")
+ "\n}";
}
}
/**
* Wrapper to support PUT /calculations/{id} returning different types
* per status code.
*
*
* Responses:
*
*
201 : {@code ObjectRoot } Expected response if calculation is completed in a short span, returns JSON in the format specified in the Calculation parameters.
*
*
202 : {@code CalculationInfoRoot } Expected response, contains the poll URL in the Location header.
*/
public static class PutAndCalculateResponseWrapper {
public final int statusCode;
public final Object response;
public PutAndCalculateResponseWrapper(int statusCode, Object response) {
this.statusCode = statusCode;
this.response = response;
}
public int getStatusCode() { return statusCode; }
public Object getResponse() { return response; }
public ObjectRoot getResponse201() throws ApiException {
if (this.statusCode != 201) {
throw new ApiException(500, "Invalid response getter called. getResponse201 can't return a " + this.statusCode + " response");
}
return (ObjectRoot) this.response;
}
public CalculationInfoRoot getResponse202() throws ApiException {
if (this.statusCode != 202) {
throw new ApiException(500, "Invalid response getter called. getResponse202 can't return a " + this.statusCode + " response");
}
return (CalculationInfoRoot) this.response;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PutAndCalculateResponseWrapper other = (PutAndCalculateResponseWrapper) o;
return this.statusCode == other.statusCode &&
Objects.equals(this.response, other.response);
}
@Override
public int hashCode() {
return Objects.hash(statusCode, response);
}
@Override
public String toString() {
return "class PutAndCalculateResponseWrapper {\n"
+ " statusCode: " + statusCode + "\n"
+ " response: "
+ Objects.toString(response).replace("\n", "\n ")
+ "\n}";
}
}
/**
* 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;
}
/**
* Cancel FI calculation by id
* This is the endpoint to cancel a previously submitted calculation.
* @param id from url, provided from the location header in the Create and Run FI calculation endpoint (required)
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
204
Expected response, calculation was canceled successfully.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
400
Invalid identifier provided.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
401
Missing or invalid authentication.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication.
403
User is forbidden with current credentials
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
404
There was no request for the calculation identifier provided, or the request was already canceled for the provided identifier.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
500
Server error. Log the X-DataDirect-Request-Key header to assist in troubleshooting.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication.
503
Request timed out. Retry the request in sometime.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication.
*/
public void cancelCalculationById(String id) throws ApiException {
cancelCalculationByIdWithHttpInfo(id);
}
/**
* Cancel FI calculation by id
* This is the endpoint to cancel a previously submitted calculation.
* @param id from url, provided from the location header in the Create and Run FI calculation endpoint (required)
* @return ApiResponse<Void>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
204
Expected response, calculation was canceled successfully.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
400
Invalid identifier provided.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
401
Missing or invalid authentication.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication.
403
User is forbidden with current credentials
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
404
There was no request for the calculation identifier provided, or the request was already canceled for the provided identifier.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
500
Server error. Log the X-DataDirect-Request-Key header to assist in troubleshooting.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication.
503
Request timed out. Retry the request in sometime.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication.
*/
public ApiResponse cancelCalculationByIdWithHttpInfo(String id) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling cancelCalculationById");
}
// create path and map variables
String localVarPath = "/calculations/{id}"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// 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 = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "FactSetApiKey", "FactSetOAuth2", "FactSetOAuth2Client" };
ApiResponse<
Void
> apiResponse = apiClient.invokeAPI("FiCalculationsApi.cancelCalculationById", localVarPath, "DELETE", localVarQueryParams, localVarPostBody,
localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
localVarAuthNames, cancelCalculationByIdResponseTypeMap, false);
return apiResponse;
}
/**
* Get FI calculation parameters by id
* This is the endpoint that returns the calculation parameters passed for a calculation.
* @param id from url, provided from the location header in the Create and Run FI calculation endpoint (required)
* @return FICalculationParametersRoot
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Expected response, returns the FI calculation parameters.
* Content-Encoding - Standard HTTP header. Header value based on Accept-Encoding Request header. * Content-Type - Standard HTTP header. * Transfer-Encoding - Standard HTTP header. Header value will be set to Chunked if Accept-Encoding header is specified. * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
400
Invalid identifier provided.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
401
Missing or invalid authentication.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication.
403
User is forbidden with current credentials
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
404
Calculation id not found
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
500
Server error. Log the X-DataDirect-Request-Key header to assist in troubleshooting
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication.
503
Request timed out. Retry the request in sometime.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication.
*/
public FICalculationParametersRoot getCalculationParameters(String id) throws ApiException {
return getCalculationParametersWithHttpInfo(id).getData();
}
/**
* Get FI calculation parameters by id
* This is the endpoint that returns the calculation parameters passed for a calculation.
* @param id from url, provided from the location header in the Create and Run FI calculation endpoint (required)
* @return ApiResponse<FICalculationParametersRoot>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Expected response, returns the FI calculation parameters.
* Content-Encoding - Standard HTTP header. Header value based on Accept-Encoding Request header. * Content-Type - Standard HTTP header. * Transfer-Encoding - Standard HTTP header. Header value will be set to Chunked if Accept-Encoding header is specified. * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
400
Invalid identifier provided.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
401
Missing or invalid authentication.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication.
403
User is forbidden with current credentials
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
404
Calculation id not found
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
500
Server error. Log the X-DataDirect-Request-Key header to assist in troubleshooting
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication.
503
Request timed out. Retry the request in sometime.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication.
*/
public ApiResponse getCalculationParametersWithHttpInfo(String id) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling getCalculationParameters");
}
// create path and map variables
String localVarPath = "/calculations/{id}"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// 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 = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "FactSetApiKey", "FactSetOAuth2", "FactSetOAuth2Client" };
ApiResponse<
FICalculationParametersRoot
> apiResponse = apiClient.invokeAPI("FiCalculationsApi.getCalculationParameters", localVarPath, "GET", localVarQueryParams, localVarPostBody,
localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
localVarAuthNames, getCalculationParametersResponseTypeMap, false);
return apiResponse;
}
/**
* Get FI calculation result by id
* This is the endpoint to get the result of a previously requested calculation. If the calculation has finished computing, the body of the response will contain the requested document in JSON.
* @param id from url, provided from the location header in the Get FI calculation status by id endpoint (required)
* @return ObjectRoot
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Expected response once calculation is completed, returns JSON in the format specified in the Calculation parameters.
* Content-Encoding - Standard HTTP header. Header value based on Accept-Encoding Request header. * Content-Type - Standard HTTP header. * Transfer-Encoding - Standard HTTP header. Header value will be set to Chunked if Accept-Encoding header is specified. * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
400
Invalid identifier provided.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
401
Missing or invalid authentication.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication.
403
User is forbidden with current credentials
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
404
Calculation was already returned, provided id was not a requested calculation, or the calculation was cancelled
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
500
Server error. Log the X-DataDirect-Request-Key header to assist in troubleshooting
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication.
503
Request timed out. Retry the request in sometime.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication.
*/
public ObjectRoot getCalculationResult(String id) throws ApiException {
return getCalculationResultWithHttpInfo(id).getData();
}
/**
* Get FI calculation result by id
* This is the endpoint to get the result of a previously requested calculation. If the calculation has finished computing, the body of the response will contain the requested document in JSON.
* @param id from url, provided from the location header in the Get FI calculation status by id endpoint (required)
* @return ApiResponse<ObjectRoot>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Expected response once calculation is completed, returns JSON in the format specified in the Calculation parameters.
* Content-Encoding - Standard HTTP header. Header value based on Accept-Encoding Request header. * Content-Type - Standard HTTP header. * Transfer-Encoding - Standard HTTP header. Header value will be set to Chunked if Accept-Encoding header is specified. * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
400
Invalid identifier provided.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
401
Missing or invalid authentication.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication.
403
User is forbidden with current credentials
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
404
Calculation was already returned, provided id was not a requested calculation, or the calculation was cancelled
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
500
Server error. Log the X-DataDirect-Request-Key header to assist in troubleshooting
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication.
503
Request timed out. Retry the request in sometime.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication.
*/
public ApiResponse getCalculationResultWithHttpInfo(String id) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling getCalculationResult");
}
// create path and map variables
String localVarPath = "/calculations/{id}/result"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// 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", "application/x-protobuf"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "FactSetApiKey", "FactSetOAuth2", "FactSetOAuth2Client" };
ApiResponse<
ObjectRoot
> apiResponse = apiClient.invokeAPI("FiCalculationsApi.getCalculationResult", localVarPath, "GET", localVarQueryParams, localVarPostBody,
localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
localVarAuthNames, getCalculationResultResponseTypeMap, false);
return apiResponse;
}
/**
* Get FI calculation status by id
* This is the endpoint to check on the progress of a previously requested calculation. If the calculation has finished computing, the body of the response will contain the requested document in JSON. Otherwise, the calculation is still running and the X-FactSet-Api-PickUp-Progress header will contain a progress percentage.
* @param id from url, provided from the location header in the Create and Run FI calculation endpoint (required)
* @return ObjectRoot
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
201
Expected response once calculation is completed, returns JSON in the format specified in the Calculation parameters.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
202
Expected response returned if the calculation is not yet completed, should contain X-FactSet-Api-PickUp-Progress header.
* X-FactSet-Api-PickUp-Progress - FactSet's progress header. * Cache-Control - Standard HTTP header. Header will specify max-age in seconds. Polling can be adjusted based on the max-age value. * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
400
Invalid identifier provided.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
401
Missing or invalid authentication.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication.
403
User is forbidden with current credentials
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
404
Calculation was already returned, provided id was not a requested calculation, or the calculation was cancelled
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
500
Server error. Log the X-DataDirect-Request-Key header to assist in troubleshooting
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication.
503
Request timed out. Retry the request in sometime.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication.
*/
public ObjectRoot getCalculationStatusById(String id) throws ApiException {
return getCalculationStatusByIdWithHttpInfo(id).getData();
}
/**
* Get FI calculation status by id
* This is the endpoint to check on the progress of a previously requested calculation. If the calculation has finished computing, the body of the response will contain the requested document in JSON. Otherwise, the calculation is still running and the X-FactSet-Api-PickUp-Progress header will contain a progress percentage.
* @param id from url, provided from the location header in the Create and Run FI calculation endpoint (required)
* @return ApiResponse<ObjectRoot>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
201
Expected response once calculation is completed, returns JSON in the format specified in the Calculation parameters.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
202
Expected response returned if the calculation is not yet completed, should contain X-FactSet-Api-PickUp-Progress header.
* X-FactSet-Api-PickUp-Progress - FactSet's progress header. * Cache-Control - Standard HTTP header. Header will specify max-age in seconds. Polling can be adjusted based on the max-age value. * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
400
Invalid identifier provided.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
401
Missing or invalid authentication.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication.
403
User is forbidden with current credentials
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
404
Calculation was already returned, provided id was not a requested calculation, or the calculation was cancelled
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
500
Server error. Log the X-DataDirect-Request-Key header to assist in troubleshooting
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication.
503
Request timed out. Retry the request in sometime.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication.
*/
public ApiResponse getCalculationStatusByIdWithHttpInfo(String id) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling getCalculationStatusById");
}
// create path and map variables
String localVarPath = "/calculations/{id}/status"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// 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", "application/x-protobuf"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "FactSetApiKey", "FactSetOAuth2", "FactSetOAuth2Client" };
ApiResponse<
ObjectRoot
> apiResponse = apiClient.invokeAPI("FiCalculationsApi.getCalculationStatusById", localVarPath, "GET", localVarQueryParams, localVarPostBody,
localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
localVarAuthNames, getCalculationStatusByIdResponseTypeMap, false);
return apiResponse;
}
/**
* Create and Run FI calculation
* This endpoint creates and runs a new FI calculation specified in the post body.
* @param xFactSetApiLongRunningDeadline Long running deadline in seconds. Example value is set to 10s. Please update it as per requirement before triggering a calculation. (optional)
* @param cacheControl Standard HTTP header. Accepts max-stale. (optional)
* @param fiCalculationParametersRoot Calculation Parameters (optional)
* @return PostAndCalculateResponseWrapper
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
201
Expected response if calculation is completed in a short span, returns JSON in the format specified in the Calculation parameters.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-Calculations-Limit - Maximum FI request limit. * X-FactSet-Api-Calculations-Remaining - Number of FI requests remaining till request limit reached. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
202
Expected response, contains the poll URL in the Location header.
* Location - URL to poll for the resulting calculation * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-Calculations-Limit - Maximum FI request limit. * X-FactSet-Api-Calculations-Remaining - Number of FI requests remaining till request limit reached. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
400
Invalid calculation parameters.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-Calculations-Limit - Maximum FI request limit. * X-FactSet-Api-Calculations-Remaining - Number of FI requests remaining till request limit reached. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
401
Missing or invalid authentication.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-Calculations-Limit - Maximum FI request limit. * X-FactSet-Api-Calculations-Remaining - Number of FI requests remaining till request limit reached.
403
User is forbidden with current credentials
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-Calculations-Limit - Maximum FI request limit. * X-FactSet-Api-Calculations-Remaining - Number of FI requests remaining till request limit reached. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
404
One or more calculation settings were unavailable.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-Calculations-Limit - Maximum FI request limit. * X-FactSet-Api-Calculations-Remaining - Number of FI requests remaining till request limit reached. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
415
Missing/Invalid Content-Type header. Header needs to be set to application/json.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-Calculations-Limit - Maximum FI request limit. * X-FactSet-Api-Calculations-Remaining - Number of FI requests remaining till request limit reached. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
429
Rate limit reached. Cancel older requests using Cancel Calculation endpoint or wait for older requests to finish/expire.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-Calculations-Limit - Maximum FI request limit. * X-FactSet-Api-Calculations-Remaining - Number of FI requests remaining till request limit reached. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets. * Retry-After - Time to wait in seconds before making a new request as the rate limit has reached.
500
Server error. Log the X-DataDirect-Request-Key header to assist in troubleshooting.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-Calculations-Limit - Maximum FI request limit. * X-FactSet-Api-Calculations-Remaining - Number of FI requests remaining till request limit reached.
503
Request timed out. Retry the request in sometime.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-Calculations-Limit - Maximum FI request limit. * X-FactSet-Api-Calculations-Remaining - Number of FI requests remaining till request limit reached.
*/
public PostAndCalculateResponseWrapper postAndCalculate(Integer xFactSetApiLongRunningDeadline, String cacheControl, FICalculationParametersRoot fiCalculationParametersRoot) throws ApiException {
return postAndCalculateWithHttpInfo(xFactSetApiLongRunningDeadline, cacheControl, fiCalculationParametersRoot).getData();
}
/**
* Create and Run FI calculation
* This endpoint creates and runs a new FI calculation specified in the post body.
* @param xFactSetApiLongRunningDeadline Long running deadline in seconds. Example value is set to 10s. Please update it as per requirement before triggering a calculation. (optional)
* @param cacheControl Standard HTTP header. Accepts max-stale. (optional)
* @param fiCalculationParametersRoot Calculation Parameters (optional)
* @return ApiResponse<PostAndCalculateResponseWrapper>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
201
Expected response if calculation is completed in a short span, returns JSON in the format specified in the Calculation parameters.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-Calculations-Limit - Maximum FI request limit. * X-FactSet-Api-Calculations-Remaining - Number of FI requests remaining till request limit reached. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
202
Expected response, contains the poll URL in the Location header.
* Location - URL to poll for the resulting calculation * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-Calculations-Limit - Maximum FI request limit. * X-FactSet-Api-Calculations-Remaining - Number of FI requests remaining till request limit reached. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
400
Invalid calculation parameters.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-Calculations-Limit - Maximum FI request limit. * X-FactSet-Api-Calculations-Remaining - Number of FI requests remaining till request limit reached. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
401
Missing or invalid authentication.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-Calculations-Limit - Maximum FI request limit. * X-FactSet-Api-Calculations-Remaining - Number of FI requests remaining till request limit reached.
403
User is forbidden with current credentials
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-Calculations-Limit - Maximum FI request limit. * X-FactSet-Api-Calculations-Remaining - Number of FI requests remaining till request limit reached. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
404
One or more calculation settings were unavailable.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-Calculations-Limit - Maximum FI request limit. * X-FactSet-Api-Calculations-Remaining - Number of FI requests remaining till request limit reached. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
415
Missing/Invalid Content-Type header. Header needs to be set to application/json.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-Calculations-Limit - Maximum FI request limit. * X-FactSet-Api-Calculations-Remaining - Number of FI requests remaining till request limit reached. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
429
Rate limit reached. Cancel older requests using Cancel Calculation endpoint or wait for older requests to finish/expire.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-Calculations-Limit - Maximum FI request limit. * X-FactSet-Api-Calculations-Remaining - Number of FI requests remaining till request limit reached. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets. * Retry-After - Time to wait in seconds before making a new request as the rate limit has reached.
500
Server error. Log the X-DataDirect-Request-Key header to assist in troubleshooting.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-Calculations-Limit - Maximum FI request limit. * X-FactSet-Api-Calculations-Remaining - Number of FI requests remaining till request limit reached.
503
Request timed out. Retry the request in sometime.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-Calculations-Limit - Maximum FI request limit. * X-FactSet-Api-Calculations-Remaining - Number of FI requests remaining till request limit reached.
*/
public ApiResponse postAndCalculateWithHttpInfo(Integer xFactSetApiLongRunningDeadline, String cacheControl, FICalculationParametersRoot fiCalculationParametersRoot) throws ApiException {
Object localVarPostBody = fiCalculationParametersRoot;
// create path and map variables
String localVarPath = "/calculations";
// 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();
if (xFactSetApiLongRunningDeadline != null)
localVarHeaderParams.put("X-FactSet-Api-Long-Running-Deadline", apiClient.parameterToString(xFactSetApiLongRunningDeadline));
if (cacheControl != null)
localVarHeaderParams.put("Cache-Control", apiClient.parameterToString(cacheControl));
final String[] localVarAccepts = {
"application/json", "application/x-protobuf"
};
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<
Object
> apiResponse = apiClient.invokeAPI("FiCalculationsApi.postAndCalculate", localVarPath, "POST", localVarQueryParams, localVarPostBody,
localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
localVarAuthNames, postAndCalculateResponseTypeMap, false);
int statusCode = apiResponse.getStatusCode();
PostAndCalculateResponseWrapper responseWrapper = new PostAndCalculateResponseWrapper(
statusCode,
apiResponse.getData()
);
return new ApiResponse(statusCode, apiResponse.getHeaders(), responseWrapper);
}
/**
* Create or Update FI calculation and run it.
* This endpoint updates and run the FI optimization specified in the PUT body parameters. It also allows the creation of new FI optimization with custom id.
* @param id from url, provided from the location header in the Create and Run FI calculation endpoint (required)
* @param xFactSetApiLongRunningDeadline Long running deadline in seconds. Example value is set to 10s. Please update it as per requirement before triggering a calculation. (optional)
* @param cacheControl Standard HTTP header. Accepts max-stale. (optional)
* @param fiCalculationParametersRoot Calculation Parameters (optional)
* @return PutAndCalculateResponseWrapper
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
201
Expected response if calculation is completed in a short span, returns JSON in the format specified in the Calculation parameters.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
202
Expected response, contains the poll URL in the Location header.
* Location - URL to poll for the resulting calculation * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
400
Invalid Calculation Parameters.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
401
Missing or invalid authentication.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication.
403
User is forbidden with current credentials
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
404
One or more calculation settings were unavailable.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
409
Duplicate calculation exists with same parameters.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
415
Missing/Invalid Content-Type header. Header needs to be set to application/json.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
429
Rate limit reached. Cancel older requests using Cancel Calculation endpoint or wait for older requests to finish/expire.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets. * Retry-After - Time to wait in seconds before making a new request as the rate limit has reached.
500
Server error. Log the X-DataDirect-Request-Key header to assist in troubleshooting.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication.
503
Request timed out. Retry the request in sometime.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication.
*/
public PutAndCalculateResponseWrapper putAndCalculate(String id, Integer xFactSetApiLongRunningDeadline, String cacheControl, FICalculationParametersRoot fiCalculationParametersRoot) throws ApiException {
return putAndCalculateWithHttpInfo(id, xFactSetApiLongRunningDeadline, cacheControl, fiCalculationParametersRoot).getData();
}
/**
* Create or Update FI calculation and run it.
* This endpoint updates and run the FI optimization specified in the PUT body parameters. It also allows the creation of new FI optimization with custom id.
* @param id from url, provided from the location header in the Create and Run FI calculation endpoint (required)
* @param xFactSetApiLongRunningDeadline Long running deadline in seconds. Example value is set to 10s. Please update it as per requirement before triggering a calculation. (optional)
* @param cacheControl Standard HTTP header. Accepts max-stale. (optional)
* @param fiCalculationParametersRoot Calculation Parameters (optional)
* @return ApiResponse<PutAndCalculateResponseWrapper>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
201
Expected response if calculation is completed in a short span, returns JSON in the format specified in the Calculation parameters.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
202
Expected response, contains the poll URL in the Location header.
* Location - URL to poll for the resulting calculation * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
400
Invalid Calculation Parameters.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
401
Missing or invalid authentication.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication.
403
User is forbidden with current credentials
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
404
One or more calculation settings were unavailable.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
409
Duplicate calculation exists with same parameters.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
415
Missing/Invalid Content-Type header. Header needs to be set to application/json.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
429
Rate limit reached. Cancel older requests using Cancel Calculation endpoint or wait for older requests to finish/expire.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window. * X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window. * X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets. * Retry-After - Time to wait in seconds before making a new request as the rate limit has reached.
500
Server error. Log the X-DataDirect-Request-Key header to assist in troubleshooting.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication.
503
Request timed out. Retry the request in sometime.
* X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication.
*/
public ApiResponse putAndCalculateWithHttpInfo(String id, Integer xFactSetApiLongRunningDeadline, String cacheControl, FICalculationParametersRoot fiCalculationParametersRoot) throws ApiException {
Object localVarPostBody = fiCalculationParametersRoot;
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling putAndCalculate");
}
// create path and map variables
String localVarPath = "/calculations/{id}"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// 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();
if (xFactSetApiLongRunningDeadline != null)
localVarHeaderParams.put("X-FactSet-Api-Long-Running-Deadline", apiClient.parameterToString(xFactSetApiLongRunningDeadline));
if (cacheControl != null)
localVarHeaderParams.put("Cache-Control", apiClient.parameterToString(cacheControl));
final String[] localVarAccepts = {
"application/json", "application/x-protobuf"
};
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<
Object
> apiResponse = apiClient.invokeAPI("FiCalculationsApi.putAndCalculate", localVarPath, "PUT", localVarQueryParams, localVarPostBody,
localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
localVarAuthNames, putAndCalculateResponseTypeMap, false);
int statusCode = apiResponse.getStatusCode();
PutAndCalculateResponseWrapper responseWrapper = new PutAndCalculateResponseWrapper(
statusCode,
apiResponse.getData()
);
return new ApiResponse(statusCode, apiResponse.getHeaders(), responseWrapper);
}
}