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.
*/
public static class GetBatchDataResponseWrapper {
public final int statusCode;
public final Object response;
public GetBatchDataResponseWrapper(int statusCode, Object response) {
this.statusCode = statusCode;
this.response = response;
}
public int getStatusCode() { return statusCode; }
public Object getResponse() { return response; }
public BatchResultResponse getResponse200() throws ApiException {
if (this.statusCode != 200) {
throw new ApiException(500, "Invalid response getter called. getResponse200 can't return a " + this.statusCode + " response");
}
return (BatchResultResponse) this.response;
}
public BatchStatusResponse getResponse202() throws ApiException {
if (this.statusCode != 202) {
throw new ApiException(500, "Invalid response getter called. getResponse202 can't return a " + this.statusCode + " response");
}
return (BatchStatusResponse) this.response;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetBatchDataResponseWrapper other = (GetBatchDataResponseWrapper) 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 GetBatchDataResponseWrapper {\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;
}
/**
* Returns the response for a Batch Request
* Returns the response data for the underlying batch request that is specified by the id. By default, this endpoint will return data as JSON. If you wish to receive your data in CSV format, you can edit the header to have the \"accept\" parameter as \"text/csv\" instead of \"application/json\".
* @param id Batch Request identifier. (required)
* @return GetBatchDataResponseWrapper
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Request Response Object when the batch request has been completed and the response is created
-
202
The batch Request has not finished and the result has NOT been created.
-
404
Resource not found.
-
*/
public GetBatchDataResponseWrapper getBatchData(java.util.UUID id) throws ApiException {
return getBatchDataWithHttpInfo(id).getData();
}
/**
* Returns the response for a Batch Request
* Returns the response data for the underlying batch request that is specified by the id. By default, this endpoint will return data as JSON. If you wish to receive your data in CSV format, you can edit the header to have the \"accept\" parameter as \"text/csv\" instead of \"application/json\".
* @param id Batch Request identifier. (required)
* @return ApiResponse<GetBatchDataResponseWrapper>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Request Response Object when the batch request has been completed and the response is created
-
202
The batch Request has not finished and the result has NOT been created.
-
404
Resource not found.
-
*/
public ApiResponse getBatchDataWithHttpInfo(java.util.UUID 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 getBatchData");
}
// create path and map variables
String localVarPath = "/factset-global-prices/v1/batch-result";
// 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("", "id", id));
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("BatchProcessingApi.getBatchData", localVarPath, "GET", localVarQueryParams, localVarPostBody,
localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
localVarAuthNames, getBatchDataResponseTypeMap, false);
int statusCode = apiResponse.getStatusCode();
GetBatchDataResponseWrapper responseWrapper = new GetBatchDataResponseWrapper(
statusCode,
apiResponse.getData()
);
return new ApiResponse(statusCode, apiResponse.getHeaders(), responseWrapper);
}
/**
* Returns the status for a Batch Request
* Return the status for the underlying batch request that is specified by the id.
* @param id Batch Request identifier. (required)
* @return BatchStatusResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
201
The batch Request has been completed and the response has been created.
* Location - Path to Batch Request result.
202
The batch Request has not finished and the result has NOT been created.
-
404
Resource not found.
-
*/
public BatchStatusResponse getBatchStatus(java.util.UUID id) throws ApiException {
return getBatchStatusWithHttpInfo(id).getData();
}
/**
* Returns the status for a Batch Request
* Return the status for the underlying batch request that is specified by the id.
* @param id Batch Request identifier. (required)
* @return ApiResponse<BatchStatusResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
201
The batch Request has been completed and the response has been created.
* Location - Path to Batch Request result.
202
The batch Request has not finished and the result has NOT been created.
-
404
Resource not found.
-
*/
public ApiResponse getBatchStatusWithHttpInfo(java.util.UUID 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 getBatchStatus");
}
// create path and map variables
String localVarPath = "/factset-global-prices/v1/batch-status";
// 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("", "id", id));
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<
BatchStatusResponse
> apiResponse = apiClient.invokeAPI("BatchProcessingApi.getBatchStatus", localVarPath, "GET", localVarQueryParams, localVarPostBody,
localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
localVarAuthNames, getBatchStatusResponseTypeMap, false);
return apiResponse;
}
}