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.PAEngine.api;
import com.factset.sdk.PAEngine.ApiException;
import com.factset.sdk.PAEngine.ApiClient;
import com.factset.sdk.PAEngine.ApiResponse;
import com.factset.sdk.PAEngine.Configuration;
import com.factset.sdk.PAEngine.Pair;
import jakarta.ws.rs.core.GenericType;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import com.factset.sdk.PAEngine.models.CalculationStatusRoot;
import com.factset.sdk.PAEngine.models.CalculationsSummaryRoot;
import com.factset.sdk.PAEngine.models.ClientErrorResponse;
import com.factset.sdk.PAEngine.models.ObjectRoot;
import com.factset.sdk.PAEngine.models.PACalculationParametersRoot;
import com.factset.sdk.PAEngine.models.PACommentaryGetStatusRoot;
import com.factset.sdk.PAEngine.models.PACommentaryRoot;
import com.factset.sdk.PAEngine.models.PACommentaryStatusRoot;
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class PaCalculationsApi {
private ApiClient apiClient;
public PaCalculationsApi() {
this(Configuration.getDefaultApiClient());
}
public PaCalculationsApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
private static final Map cancelCalculationByIdResponseTypeMap = new HashMap();
private static final Map generatePAPortfolioCommentaryResponseTypeMap = new HashMap();
static {
generatePAPortfolioCommentaryResponseTypeMap.put(201, new GenericType(){});
generatePAPortfolioCommentaryResponseTypeMap.put(202, new GenericType(){});
generatePAPortfolioCommentaryResponseTypeMap.put(400, new GenericType(){});
}
private static final Map getAllCalculationsResponseTypeMap = new HashMap();
static {
getAllCalculationsResponseTypeMap.put(200, new GenericType(){});
getAllCalculationsResponseTypeMap.put(400, new GenericType(){});
getAllCalculationsResponseTypeMap.put(404, new GenericType(){});
}
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 getCalculationStatusByIdResponseTypeMap = new HashMap();
static {
getCalculationStatusByIdResponseTypeMap.put(200, new GenericType(){});
getCalculationStatusByIdResponseTypeMap.put(202, new GenericType(){});
getCalculationStatusByIdResponseTypeMap.put(400, new GenericType(){});
getCalculationStatusByIdResponseTypeMap.put(404, new GenericType(){});
}
private static final Map getCalculationUnitResultByIdResponseTypeMap = new HashMap();
static {
getCalculationUnitResultByIdResponseTypeMap.put(200, new GenericType(){});
getCalculationUnitResultByIdResponseTypeMap.put(400, new GenericType(){});
getCalculationUnitResultByIdResponseTypeMap.put(404, new GenericType(){});
}
private static final Map getPAPortfolioCommentaryResultByIdResponseTypeMap = new HashMap();
static {
getPAPortfolioCommentaryResultByIdResponseTypeMap.put(200, new GenericType(){});
getPAPortfolioCommentaryResultByIdResponseTypeMap.put(400, new GenericType(){});
}
private static final Map getPAPortfolioCommentaryStatusByIdResponseTypeMap = new HashMap();
static {
getPAPortfolioCommentaryStatusByIdResponseTypeMap.put(200, new GenericType(){});
getPAPortfolioCommentaryStatusByIdResponseTypeMap.put(202, new GenericType(){});
getPAPortfolioCommentaryStatusByIdResponseTypeMap.put(400, new GenericType(){});
}
private static final Map postAndCalculateResponseTypeMap = new HashMap();
static {
postAndCalculateResponseTypeMap.put(200, new GenericType(){});
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(200, new GenericType(){});
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 /analytics/engines/pa/v3/calculations/{id}/units/{unitId}/commentary returning different types
* per status code.
*
*
* Responses:
*
*
201 : {@code PACommentaryRoot } Expected response if the commentary generation is completed in a short span, returns JSON.
*
*
202 : {@code PACommentaryGetStatusRoot } Expected response, contains the poll URL in the Location header.
*/
public static class GeneratePAPortfolioCommentaryResponseWrapper {
public final int statusCode;
public final Object response;
public GeneratePAPortfolioCommentaryResponseWrapper(int statusCode, Object response) {
this.statusCode = statusCode;
this.response = response;
}
public int getStatusCode() { return statusCode; }
public Object getResponse() { return response; }
public PACommentaryRoot getResponse201() throws ApiException {
if (this.statusCode != 201) {
throw new ApiException(500, "Invalid response getter called. getResponse201 can't return a " + this.statusCode + " response");
}
return (PACommentaryRoot) this.response;
}
public PACommentaryGetStatusRoot getResponse202() throws ApiException {
if (this.statusCode != 202) {
throw new ApiException(500, "Invalid response getter called. getResponse202 can't return a " + this.statusCode + " response");
}
return (PACommentaryGetStatusRoot) this.response;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GeneratePAPortfolioCommentaryResponseWrapper other = (GeneratePAPortfolioCommentaryResponseWrapper) 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 GeneratePAPortfolioCommentaryResponseWrapper {\n"
+ " statusCode: " + statusCode + "\n"
+ " response: "
+ Objects.toString(response).replace("\n", "\n ")
+ "\n}";
}
}
/**
* Wrapper to support GET /analytics/engines/pa/v3/calculations/{id}/units/{unitId}/commentary/status returning different types
* per status code.
*
*
* Responses:
*
*
200 : {@code PACommentaryStatusRoot } Expected response once commentary is completed.
*
*
202 : {@code PACommentaryGetStatusRoot } Expected response returned if the commentary generation is not yet completed, should contain X-FactSet-Api-PickUp-Progress header.
*/
public static class GetPAPortfolioCommentaryStatusByIdResponseWrapper {
public final int statusCode;
public final Object response;
public GetPAPortfolioCommentaryStatusByIdResponseWrapper(int statusCode, Object response) {
this.statusCode = statusCode;
this.response = response;
}
public int getStatusCode() { return statusCode; }
public Object getResponse() { return response; }
public PACommentaryStatusRoot getResponse200() throws ApiException {
if (this.statusCode != 200) {
throw new ApiException(500, "Invalid response getter called. getResponse200 can't return a " + this.statusCode + " response");
}
return (PACommentaryStatusRoot) this.response;
}
public PACommentaryGetStatusRoot getResponse202() throws ApiException {
if (this.statusCode != 202) {
throw new ApiException(500, "Invalid response getter called. getResponse202 can't return a " + this.statusCode + " response");
}
return (PACommentaryGetStatusRoot) this.response;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetPAPortfolioCommentaryStatusByIdResponseWrapper other = (GetPAPortfolioCommentaryStatusByIdResponseWrapper) 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 GetPAPortfolioCommentaryStatusByIdResponseWrapper {\n"
+ " statusCode: " + statusCode + "\n"
+ " response: "
+ Objects.toString(response).replace("\n", "\n ")
+ "\n}";
}
}
/**
* Wrapper to support POST /analytics/engines/pa/v3/calculations returning different types
* per status code.
*
*
* Responses:
*
*
200 : {@code CalculationStatusRoot } Expected response, if the calculation has one unit and is completed with an error.
*
*
201 : {@code ObjectRoot } Expected response if the calculation has one unit and is completed in a short span, returns JSON in the format specified in the Calculation parameters.
*
*
202 : {@code CalculationStatusRoot } 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 CalculationStatusRoot getResponse200() throws ApiException {
if (this.statusCode != 200) {
throw new ApiException(500, "Invalid response getter called. getResponse200 can't return a " + this.statusCode + " response");
}
return (CalculationStatusRoot) this.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 CalculationStatusRoot getResponse202() throws ApiException {
if (this.statusCode != 202) {
throw new ApiException(500, "Invalid response getter called. getResponse202 can't return a " + this.statusCode + " response");
}
return (CalculationStatusRoot) 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 /analytics/engines/pa/v3/calculations/{id} returning different types
* per status code.
*
*
* Responses:
*
*
200 : {@code CalculationStatusRoot } Expected response, if the calculation has one unit and is completed with an error.
*
*
201 : {@code ObjectRoot } Expected response if the calculation has one unit and is completed in a short span, returns JSON in the format specified in the Calculation parameters.
*
*
202 : {@code CalculationStatusRoot } 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 CalculationStatusRoot getResponse200() throws ApiException {
if (this.statusCode != 200) {
throw new ApiException(500, "Invalid response getter called. getResponse200 can't return a " + this.statusCode + " response");
}
return (CalculationStatusRoot) this.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 CalculationStatusRoot getResponse202() throws ApiException {
if (this.statusCode != 202) {
throw new ApiException(500, "Invalid response getter called. getResponse202 can't return a " + this.statusCode + " response");
}
return (CalculationStatusRoot) 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 PA 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 PA 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 PA 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 PA 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 = "/analytics/engines/pa/v3/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("PaCalculationsApi.cancelCalculationById", localVarPath, "DELETE", localVarQueryParams, localVarPostBody,
localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
localVarAuthNames, cancelCalculationByIdResponseTypeMap, false);
return apiResponse;
}
/**
* Generate PA portfolio commentary by calculation and unit id.
* This endpoint can be used to generate FactSet's AI-generated PA portfolio commentary based on a previously successful calculation. Remarks: * <b>These endpoints are currently beta and are exposed to elicit client feedback on the usability and accuracy of the GenAI generated commentaries. A limit of five commentaries per day is set to control costs during testing.</b> * The PA component used in the calculation must be an attribution tile. * The \"Variation in Average Weight\" column must be included along with those required as specified on the [OA page](https://my.apps.factset.com/oa/pages/13632#portfolio_commentary) in the component for successful commentary generation; otherwise, the request will result in an error. * PA portfolio commentary generation is not supported for multi-port requests. * The POST calculation must use a single portfolio and a benchmark to generate the commentary. * PA portfolio commentary with sub-period analysis will be returned only when the frequency is set to something other than \"single\" and the report contains more than one sub-period.
* @param id Successful calculation id (required)
* @param unitId Unit id associated with the successful calculation id (required)
* @return GeneratePAPortfolioCommentaryResponseWrapper
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
201
Expected response if the commentary generation is completed in a short span, returns 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.
202
Expected response, contains the poll URL in the Location header.
* Location - URL to poll for the resulting commentary * 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.
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. 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 GeneratePAPortfolioCommentaryResponseWrapper generatePAPortfolioCommentary(String id, String unitId) throws ApiException {
return generatePAPortfolioCommentaryWithHttpInfo(id, unitId).getData();
}
/**
* Generate PA portfolio commentary by calculation and unit id.
* This endpoint can be used to generate FactSet's AI-generated PA portfolio commentary based on a previously successful calculation. Remarks: * <b>These endpoints are currently beta and are exposed to elicit client feedback on the usability and accuracy of the GenAI generated commentaries. A limit of five commentaries per day is set to control costs during testing.</b> * The PA component used in the calculation must be an attribution tile. * The \"Variation in Average Weight\" column must be included along with those required as specified on the [OA page](https://my.apps.factset.com/oa/pages/13632#portfolio_commentary) in the component for successful commentary generation; otherwise, the request will result in an error. * PA portfolio commentary generation is not supported for multi-port requests. * The POST calculation must use a single portfolio and a benchmark to generate the commentary. * PA portfolio commentary with sub-period analysis will be returned only when the frequency is set to something other than \"single\" and the report contains more than one sub-period.
* @param id Successful calculation id (required)
* @param unitId Unit id associated with the successful calculation id (required)
* @return ApiResponse<GeneratePAPortfolioCommentaryResponseWrapper>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
201
Expected response if the commentary generation is completed in a short span, returns 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.
202
Expected response, contains the poll URL in the Location header.
* Location - URL to poll for the resulting commentary * 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.
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. 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 generatePAPortfolioCommentaryWithHttpInfo(String id, String unitId) 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 generatePAPortfolioCommentary");
}
// verify the required parameter 'unitId' is set
if (unitId == null) {
throw new ApiException(400, "Missing the required parameter 'unitId' when calling generatePAPortfolioCommentary");
}
// create path and map variables
String localVarPath = "/analytics/engines/pa/v3/calculations/{id}/units/{unitId}/commentary"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
.replaceAll("\\{" + "unitId" + "\\}", apiClient.escapeString(unitId.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<
Object
> apiResponse = apiClient.invokeAPI("PaCalculationsApi.generatePAPortfolioCommentary", localVarPath, "POST", localVarQueryParams, localVarPostBody,
localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
localVarAuthNames, generatePAPortfolioCommentaryResponseTypeMap, false);
int statusCode = apiResponse.getStatusCode();
GeneratePAPortfolioCommentaryResponseWrapper responseWrapper = new GeneratePAPortfolioCommentaryResponseWrapper(
statusCode,
apiResponse.getData()
);
return new ApiResponse(statusCode, apiResponse.getHeaders(), responseWrapper);
}
/**
* Get all calculations
* This endpoints returns all calculation requests.
* @param pageNumber (optional, default to 1)
* @return CalculationsSummaryRoot
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
List of calculation requests.
* 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 page number.
* 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
No calculation 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.
406
Unsupported Accept 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. Wait till the time specified in Retry-After header value to make further requests.
* 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. * 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 CalculationsSummaryRoot getAllCalculations(Integer pageNumber) throws ApiException {
return getAllCalculationsWithHttpInfo(pageNumber).getData();
}
/**
* Get all calculations
* This endpoints returns all calculation requests.
* @param pageNumber (optional, default to 1)
* @return ApiResponse<CalculationsSummaryRoot>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
List of calculation requests.
* 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 page number.
* 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
No calculation 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.
406
Unsupported Accept 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. Wait till the time specified in Retry-After header value to make further requests.
* 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. * 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 getAllCalculationsWithHttpInfo(Integer pageNumber) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/analytics/engines/pa/v3/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();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "pageNumber", pageNumber));
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<
CalculationsSummaryRoot
> apiResponse = apiClient.invokeAPI("PaCalculationsApi.getAllCalculations", localVarPath, "GET", localVarQueryParams, localVarPostBody,
localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
localVarAuthNames, getAllCalculationsResponseTypeMap, false);
return apiResponse;
}
/**
* Get PA 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 PA calculation endpoint (required)
* @return PACalculationParametersRoot
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Expected response, returns the PA 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 PACalculationParametersRoot getCalculationParameters(String id) throws ApiException {
return getCalculationParametersWithHttpInfo(id).getData();
}
/**
* Get PA 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 PA calculation endpoint (required)
* @return ApiResponse<PACalculationParametersRoot>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Expected response, returns the PA 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 = "/analytics/engines/pa/v3/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<
PACalculationParametersRoot
> apiResponse = apiClient.invokeAPI("PaCalculationsApi.getCalculationParameters", localVarPath, "GET", localVarQueryParams, localVarPostBody,
localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
localVarAuthNames, getCalculationParametersResponseTypeMap, false);
return apiResponse;
}
/**
* Get PA 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 location header will point to the result url. 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 PA calculation endpoint (required)
* @return CalculationStatusRoot
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Expected response once calculation is completed.
* 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.
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 CalculationStatusRoot getCalculationStatusById(String id) throws ApiException {
return getCalculationStatusByIdWithHttpInfo(id).getData();
}
/**
* Get PA 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 location header will point to the result url. 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 PA calculation endpoint (required)
* @return ApiResponse<CalculationStatusRoot>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Expected response once calculation is completed.
* 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.
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 = "/analytics/engines/pa/v3/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"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "FactSetApiKey", "FactSetOAuth2", "FactSetOAuth2Client" };
ApiResponse<
CalculationStatusRoot
> apiResponse = apiClient.invokeAPI("PaCalculationsApi.getCalculationStatusById", localVarPath, "GET", localVarQueryParams, localVarPostBody,
localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
localVarAuthNames, getCalculationStatusByIdResponseTypeMap, false);
return apiResponse;
}
/**
* Get PA 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 PA calculation status by id endpoint (required)
* @param unitId from url, provided from the location header in the Get PA 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 getCalculationUnitResultById(String id, String unitId) throws ApiException {
return getCalculationUnitResultByIdWithHttpInfo(id, unitId).getData();
}
/**
* Get PA 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 PA calculation status by id endpoint (required)
* @param unitId from url, provided from the location header in the Get PA 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 getCalculationUnitResultByIdWithHttpInfo(String id, String unitId) 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 getCalculationUnitResultById");
}
// verify the required parameter 'unitId' is set
if (unitId == null) {
throw new ApiException(400, "Missing the required parameter 'unitId' when calling getCalculationUnitResultById");
}
// create path and map variables
String localVarPath = "/analytics/engines/pa/v3/calculations/{id}/units/{unitId}/result"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
.replaceAll("\\{" + "unitId" + "\\}", apiClient.escapeString(unitId.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("PaCalculationsApi.getCalculationUnitResultById", localVarPath, "GET", localVarQueryParams, localVarPostBody,
localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
localVarAuthNames, getCalculationUnitResultByIdResponseTypeMap, false);
return apiResponse;
}
/**
* Get PA Portfolio commentary result by calculation and unit id.
* This endpoint retrieves the result of a previously requested portfolio commentary. If the commentary generation is complete, the commentary will be returned in a predefined JSON format.
* @param id Successful calculation id (required)
* @param unitId Unit id associated with the successful calculation id (required)
* @return PACommentaryRoot
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Expected response once the commentary generation is completed, returns JSON.
* 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.
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 PACommentaryRoot getPAPortfolioCommentaryResultById(String id, String unitId) throws ApiException {
return getPAPortfolioCommentaryResultByIdWithHttpInfo(id, unitId).getData();
}
/**
* Get PA Portfolio commentary result by calculation and unit id.
* This endpoint retrieves the result of a previously requested portfolio commentary. If the commentary generation is complete, the commentary will be returned in a predefined JSON format.
* @param id Successful calculation id (required)
* @param unitId Unit id associated with the successful calculation id (required)
* @return ApiResponse<PACommentaryRoot>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Expected response once the commentary generation is completed, returns JSON.
* 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.
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 getPAPortfolioCommentaryResultByIdWithHttpInfo(String id, String unitId) 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 getPAPortfolioCommentaryResultById");
}
// verify the required parameter 'unitId' is set
if (unitId == null) {
throw new ApiException(400, "Missing the required parameter 'unitId' when calling getPAPortfolioCommentaryResultById");
}
// create path and map variables
String localVarPath = "/analytics/engines/pa/v3/calculations/{id}/units/{unitId}/commentary/result"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
.replaceAll("\\{" + "unitId" + "\\}", apiClient.escapeString(unitId.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<
PACommentaryRoot
> apiResponse = apiClient.invokeAPI("PaCalculationsApi.getPAPortfolioCommentaryResultById", localVarPath, "GET", localVarQueryParams, localVarPostBody,
localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
localVarAuthNames, getPAPortfolioCommentaryResultByIdResponseTypeMap, false);
return apiResponse;
}
/**
* Get PA portfolio commentary status by calculation and unit id.
* This endpoint allows you to check the progress of a previously requested PA portfolio commentary. If the commentary generation is complete, the location header will provide the URL for the result.
* @param id Successful calculation id (required)
* @param unitId Unit id associated with the successful calculation id (required)
* @return GetPAPortfolioCommentaryStatusByIdResponseWrapper
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Expected response once commentary is completed.
* 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.
202
Expected response returned if the commentary generation is not yet completed, should contain X-FactSet-Api-PickUp-Progress header.
* 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.
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 GetPAPortfolioCommentaryStatusByIdResponseWrapper getPAPortfolioCommentaryStatusById(String id, String unitId) throws ApiException {
return getPAPortfolioCommentaryStatusByIdWithHttpInfo(id, unitId).getData();
}
/**
* Get PA portfolio commentary status by calculation and unit id.
* This endpoint allows you to check the progress of a previously requested PA portfolio commentary. If the commentary generation is complete, the location header will provide the URL for the result.
* @param id Successful calculation id (required)
* @param unitId Unit id associated with the successful calculation id (required)
* @return ApiResponse<GetPAPortfolioCommentaryStatusByIdResponseWrapper>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Expected response once commentary is completed.
* 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.
202
Expected response returned if the commentary generation is not yet completed, should contain X-FactSet-Api-PickUp-Progress header.
* 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.
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 getPAPortfolioCommentaryStatusByIdWithHttpInfo(String id, String unitId) 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 getPAPortfolioCommentaryStatusById");
}
// verify the required parameter 'unitId' is set
if (unitId == null) {
throw new ApiException(400, "Missing the required parameter 'unitId' when calling getPAPortfolioCommentaryStatusById");
}
// create path and map variables
String localVarPath = "/analytics/engines/pa/v3/calculations/{id}/units/{unitId}/commentary/status"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
.replaceAll("\\{" + "unitId" + "\\}", apiClient.escapeString(unitId.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<
Object
> apiResponse = apiClient.invokeAPI("PaCalculationsApi.getPAPortfolioCommentaryStatusById", localVarPath, "GET", localVarQueryParams, localVarPostBody,
localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
localVarAuthNames, getPAPortfolioCommentaryStatusByIdResponseTypeMap, false);
int statusCode = apiResponse.getStatusCode();
GetPAPortfolioCommentaryStatusByIdResponseWrapper responseWrapper = new GetPAPortfolioCommentaryStatusByIdResponseWrapper(
statusCode,
apiResponse.getData()
);
return new ApiResponse(statusCode, apiResponse.getHeaders(), responseWrapper);
}
/**
* Create and Run PA calculation
* This endpoint runs the PA calculation specified in the POST body parameters. It can take one or more calculation units as input. Remarks: * Any settings in POST body will act as a one-time override over the settings saved in the PA template. * Account identifiers must have .ACCT or .ACTM extension or BENCH: prefix. Holdings mode can be optionally set for every account. Possible values for holdings mode are B&H (Buy and Hold), TBR (Transaction based returns), OMS (Order Management System), VLT (Vaulted returns) or EXT (External Returns Data). Default holdings mode value is B&H. * If we are overriding the grouping with a frequency, we will be overriding the grouping saved to the original component and also overriding the default frequency of the Beginning of Period to whatever we pass in the request body. * If we are overriding grouping frequency without overriding the group id it will not be applied to the default groupings saved to the original component. * Componentdetail supports securities, groups, groupsall, and totals levels of granularity. However, if no value is passed, the default value is 'securities'. Additionally, while 'groupsall' returns all the group levels in the PA component, setting componentdetail to 'groups' only returns the expanded or collapsed group levels within the PA component.
* @param xFactSetApiLongRunningDeadline Long running deadline in seconds when only one unit is passed in the POST body. 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 paCalculationParametersRoot Calculation Parameters (optional)
* @return PostAndCalculateResponseWrapper
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Expected response, if the calculation has one unit and is completed with an error.
* 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.
201
Expected response if the calculation has one unit and 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.
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 PostAndCalculateResponseWrapper postAndCalculate(Integer xFactSetApiLongRunningDeadline, String cacheControl, PACalculationParametersRoot paCalculationParametersRoot) throws ApiException {
return postAndCalculateWithHttpInfo(xFactSetApiLongRunningDeadline, cacheControl, paCalculationParametersRoot).getData();
}
/**
* Create and Run PA calculation
* This endpoint runs the PA calculation specified in the POST body parameters. It can take one or more calculation units as input. Remarks: * Any settings in POST body will act as a one-time override over the settings saved in the PA template. * Account identifiers must have .ACCT or .ACTM extension or BENCH: prefix. Holdings mode can be optionally set for every account. Possible values for holdings mode are B&H (Buy and Hold), TBR (Transaction based returns), OMS (Order Management System), VLT (Vaulted returns) or EXT (External Returns Data). Default holdings mode value is B&H. * If we are overriding the grouping with a frequency, we will be overriding the grouping saved to the original component and also overriding the default frequency of the Beginning of Period to whatever we pass in the request body. * If we are overriding grouping frequency without overriding the group id it will not be applied to the default groupings saved to the original component. * Componentdetail supports securities, groups, groupsall, and totals levels of granularity. However, if no value is passed, the default value is 'securities'. Additionally, while 'groupsall' returns all the group levels in the PA component, setting componentdetail to 'groups' only returns the expanded or collapsed group levels within the PA component.
* @param xFactSetApiLongRunningDeadline Long running deadline in seconds when only one unit is passed in the POST body. 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 paCalculationParametersRoot Calculation Parameters (optional)
* @return ApiResponse<PostAndCalculateResponseWrapper>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Expected response, if the calculation has one unit and is completed with an error.
* 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.
201
Expected response if the calculation has one unit and 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.
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 postAndCalculateWithHttpInfo(Integer xFactSetApiLongRunningDeadline, String cacheControl, PACalculationParametersRoot paCalculationParametersRoot) throws ApiException {
Object localVarPostBody = paCalculationParametersRoot;
// create path and map variables
String localVarPath = "/analytics/engines/pa/v3/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("PaCalculationsApi.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 PA calculation and run it.
* This endpoint updates and run the PA calculation specified in the PUT body parameters. This also allows creating new PA calculations with custom ids. It can take one or more calculation units as input. Remarks: * Any settings in PUT body will act as a one-time override over the settings saved in the PA template. * Account identifiers must have .ACCT or .ACTM extension or BENCH: prefix. Holdings mode can be optionally set for every account. Possible values for holdings mode are B&H (Buy and Hold), TBR (Transaction based returns), OMS (Order Management System), VLT (Vaulted returns) or EXT (External Returns Data). Default holdings mode value is B&H. * If we are overriding the grouping with a frequency, we will be overriding the grouping saved to the original component and also overriding the default frequency of the Beginning of Period to whatever we pass in the request body. * If we are overriding grouping frequency without overriding the group id it will not be applied to the default groupings saved to the original component. * Componentdetail supports securities, groups, groupsall, and totals levels of granularity. However, if no value is passed, the default value is 'securities'. Additionally, while 'groupsall' returns all the group levels in the PA component, setting componentdetail to 'groups' only returns the expanded or collapsed group levels within the PA component.
* @param id from url, provided from the location header in the Create and Run PA calculation endpoint (required)
* @param xFactSetApiLongRunningDeadline Long running deadline in seconds when only one unit is passed in the PUT body. 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 paCalculationParametersRoot Calculation Parameters (optional)
* @return PutAndCalculateResponseWrapper
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Expected response, if the calculation has one unit and is completed with an error.
* 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.
201
Expected response if the calculation has one unit and 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, PACalculationParametersRoot paCalculationParametersRoot) throws ApiException {
return putAndCalculateWithHttpInfo(id, xFactSetApiLongRunningDeadline, cacheControl, paCalculationParametersRoot).getData();
}
/**
* Create or Update PA calculation and run it.
* This endpoint updates and run the PA calculation specified in the PUT body parameters. This also allows creating new PA calculations with custom ids. It can take one or more calculation units as input. Remarks: * Any settings in PUT body will act as a one-time override over the settings saved in the PA template. * Account identifiers must have .ACCT or .ACTM extension or BENCH: prefix. Holdings mode can be optionally set for every account. Possible values for holdings mode are B&H (Buy and Hold), TBR (Transaction based returns), OMS (Order Management System), VLT (Vaulted returns) or EXT (External Returns Data). Default holdings mode value is B&H. * If we are overriding the grouping with a frequency, we will be overriding the grouping saved to the original component and also overriding the default frequency of the Beginning of Period to whatever we pass in the request body. * If we are overriding grouping frequency without overriding the group id it will not be applied to the default groupings saved to the original component. * Componentdetail supports securities, groups, groupsall, and totals levels of granularity. However, if no value is passed, the default value is 'securities'. Additionally, while 'groupsall' returns all the group levels in the PA component, setting componentdetail to 'groups' only returns the expanded or collapsed group levels within the PA component.
* @param id from url, provided from the location header in the Create and Run PA calculation endpoint (required)
* @param xFactSetApiLongRunningDeadline Long running deadline in seconds when only one unit is passed in the PUT body. 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 paCalculationParametersRoot Calculation Parameters (optional)
* @return ApiResponse<PutAndCalculateResponseWrapper>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Expected response, if the calculation has one unit and is completed with an error.
* 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.
201
Expected response if the calculation has one unit and 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, PACalculationParametersRoot paCalculationParametersRoot) throws ApiException {
Object localVarPostBody = paCalculationParametersRoot;
// 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 = "/analytics/engines/pa/v3/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("PaCalculationsApi.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);
}
}