com.factset.sdk.FactSetFunds.api.GroupHoldingsApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of factsetfunds Show documentation
Show all versions of factsetfunds Show documentation
FactSet SDK for Java - factsetfunds
package com.factset.sdk.FactSetFunds.api;
import com.factset.sdk.FactSetFunds.ApiException;
import com.factset.sdk.FactSetFunds.ApiClient;
import com.factset.sdk.FactSetFunds.ApiResponse;
import com.factset.sdk.FactSetFunds.Configuration;
import com.factset.sdk.FactSetFunds.Pair;
import jakarta.ws.rs.core.GenericType;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import com.factset.sdk.FactSetFunds.models.ErrorResponse;
import com.factset.sdk.FactSetFunds.models.GroupHoldingsRequest;
import com.factset.sdk.FactSetFunds.models.GroupHoldingsResponse;
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class GroupHoldingsApi {
private ApiClient apiClient;
public GroupHoldingsApi() {
this(Configuration.getDefaultApiClient());
}
public GroupHoldingsApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
private static final Map getGroupHoldingsResponseTypeMap = new HashMap();
static {
getGroupHoldingsResponseTypeMap.put(200, new GenericType(){});
getGroupHoldingsResponseTypeMap.put(400, new GenericType(){});
getGroupHoldingsResponseTypeMap.put(401, new GenericType(){});
getGroupHoldingsResponseTypeMap.put(403, new GenericType(){});
getGroupHoldingsResponseTypeMap.put(415, new GenericType(){});
getGroupHoldingsResponseTypeMap.put(500, new GenericType(){});
}
private static final Map getGroupHoldingsForListResponseTypeMap = new HashMap();
static {
getGroupHoldingsForListResponseTypeMap.put(200, new GenericType(){});
getGroupHoldingsForListResponseTypeMap.put(400, new GenericType(){});
getGroupHoldingsForListResponseTypeMap.put(401, new GenericType(){});
getGroupHoldingsForListResponseTypeMap.put(403, new GenericType(){});
getGroupHoldingsForListResponseTypeMap.put(415, new GenericType(){});
getGroupHoldingsForListResponseTypeMap.put(500, new GenericType(){});
}
/**
* Get the API client
*
* @return API client
*/
public ApiClient getApiClient() {
return apiClient;
}
/**
* Set the API client
*
* @param apiClient an instance of API client
*/
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Get group holdings for a specific date and group.
* Retrieves the holding percentages for the group and funds specified. Available groups are: * **ASSET** = Asset Class * **ASSETISTYP** = Issue Type with Asset Class * **CAPGRP** = Cap Group * **CNTRY** = Country * **EXCHANGE** = Exchange * **INDUSTRY** = Industry * **ISSUE_TYPE** = Issue Type * **REGION** = Region * **SECTOR** = Sector * **ULTPARENT** = Ultimate Parent
* @param ids The requested fund identifier. FactSet Identifiers, tickers, CUSIP, SEDOL, and ISIN are accepted inputs. <p>***ids limit** = 1000 per request*</p> *<p>Make note, GET Method URL request lines are also limited to a total length of 8192 bytes (8KB). In cases where the service allows for thousands of ids, which may lead to exceeding this request line limit of 8KB, its advised for any requests with large request lines to be requested through the respective \"POST\" method.</p>* (required)
* @param asOfDate As of date for historical group holdings in **YYYY-MM-DD** format. If left blank, the API will default to latest available completed period. (optional)
* @param group Controls the group of the data returned. * **ASSET** = Asset Class * **ASSETISTYP** = Issue Type with Asset Class * **CAPGRP** = Cap Group * **CNTRY** = Country * **EXCHANGE** = Exchange * **INDUSTRY** = Industry * **ISSUE_TYPE** = Issue Type * **REGION** = Region * **SECTOR** = Sector * **ULTPARENT** = Ultimate Parent (optional, default to CNTRY)
* @return GroupHoldingsResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code Description Response Headers
200 The Group Holdings response object. -
400 Bad Request. This can occur for several reasons. Please review the \"message\" for more details. -
401 Unauthenticated USERNAME-SERIAL. Ensure you are logged in and have successfully generated an API KEY for the IP range you are connecting from. For more help, select the **Report Issue** in the top right corner of this Developer Portal specification card and choose Connectivity 401 or 403 Responses. -
403 The USERNAME-SERIAL attempted to request the endpoint is not authorized to access. The request was a legal request, but the server is refusing to respond. Please reach out to FactSet Account Team for assistance with authorization. -
415 Unsupported Media Type. This error may be returned when the caller sends a resource in a format that is not accepted by the server. This can be fixed by ensuring that Content-Type header is set to the correct value. In this instance, \"application/json\" would be the appropriate value. -
500 Internal Server Error. -
*/
public GroupHoldingsResponse getGroupHoldings(java.util.List ids, String asOfDate, String group) throws ApiException {
return getGroupHoldingsWithHttpInfo(ids, asOfDate, group).getData();
}
/**
* Get group holdings for a specific date and group.
* Retrieves the holding percentages for the group and funds specified. Available groups are: * **ASSET** = Asset Class * **ASSETISTYP** = Issue Type with Asset Class * **CAPGRP** = Cap Group * **CNTRY** = Country * **EXCHANGE** = Exchange * **INDUSTRY** = Industry * **ISSUE_TYPE** = Issue Type * **REGION** = Region * **SECTOR** = Sector * **ULTPARENT** = Ultimate Parent
* @param ids The requested fund identifier. FactSet Identifiers, tickers, CUSIP, SEDOL, and ISIN are accepted inputs. <p>***ids limit** = 1000 per request*</p> *<p>Make note, GET Method URL request lines are also limited to a total length of 8192 bytes (8KB). In cases where the service allows for thousands of ids, which may lead to exceeding this request line limit of 8KB, its advised for any requests with large request lines to be requested through the respective \"POST\" method.</p>* (required)
* @param asOfDate As of date for historical group holdings in **YYYY-MM-DD** format. If left blank, the API will default to latest available completed period. (optional)
* @param group Controls the group of the data returned. * **ASSET** = Asset Class * **ASSETISTYP** = Issue Type with Asset Class * **CAPGRP** = Cap Group * **CNTRY** = Country * **EXCHANGE** = Exchange * **INDUSTRY** = Industry * **ISSUE_TYPE** = Issue Type * **REGION** = Region * **SECTOR** = Sector * **ULTPARENT** = Ultimate Parent (optional, default to CNTRY)
* @return ApiResponse<GroupHoldingsResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code Description Response Headers
200 The Group Holdings response object. -
400 Bad Request. This can occur for several reasons. Please review the \"message\" for more details. -
401 Unauthenticated USERNAME-SERIAL. Ensure you are logged in and have successfully generated an API KEY for the IP range you are connecting from. For more help, select the **Report Issue** in the top right corner of this Developer Portal specification card and choose Connectivity 401 or 403 Responses. -
403 The USERNAME-SERIAL attempted to request the endpoint is not authorized to access. The request was a legal request, but the server is refusing to respond. Please reach out to FactSet Account Team for assistance with authorization. -
415 Unsupported Media Type. This error may be returned when the caller sends a resource in a format that is not accepted by the server. This can be fixed by ensuring that Content-Type header is set to the correct value. In this instance, \"application/json\" would be the appropriate value. -
500 Internal Server Error. -
*/
public ApiResponse getGroupHoldingsWithHttpInfo(java.util.List ids, String asOfDate, String group) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'ids' is set
if (ids == null) {
throw new ApiException(400, "Missing the required parameter 'ids' when calling getGroupHoldings");
}
// create path and map variables
String localVarPath = "/factset-funds/v1/holdings/group";
// query params
java.util.List localVarQueryParams = new java.util.ArrayList();
java.util.Map localVarHeaderParams = new java.util.HashMap();
java.util.Map localVarCookieParams = new java.util.HashMap();
java.util.Map localVarFormParams = new java.util.HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "ids", ids));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "asOfDate", asOfDate));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "group", group));
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<
GroupHoldingsResponse
> apiResponse = apiClient.invokeAPI("GroupHoldingsApi.getGroupHoldings", localVarPath, "GET", localVarQueryParams, localVarPostBody,
localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
localVarAuthNames, getGroupHoldingsResponseTypeMap, false);
return apiResponse;
}
/**
* Get group holdings for a specific date and group.
* Retrieves the holding percentages for the group and funds specified. Available groups are: * **ASSET** = Asset Class * **ASSETISTYP** = Issue Type with Asset Class * **CAPGRP** = Cap Group * **CNTRY** = Country * **EXCHANGE** = Exchange * **INDUSTRY** = Industry * **ISSUE_TYPE** = Issue Type * **REGION** = Region * **SECTOR** = Sector * **ULTPARENT** = Ultimate Parent
* @param groupHoldingsRequest The Group Holdings request body, allowing the user to specify a list of ids, date, and group. (required)
* @return GroupHoldingsResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code Description Response Headers
200 The Group Holdings response object. -
400 Bad Request. This can occur for several reasons. Please review the \"message\" for more details. -
401 Unauthenticated USERNAME-SERIAL. Ensure you are logged in and have successfully generated an API KEY for the IP range you are connecting from. For more help, select the **Report Issue** in the top right corner of this Developer Portal specification card and choose Connectivity 401 or 403 Responses. -
403 The USERNAME-SERIAL attempted to request the endpoint is not authorized to access. The request was a legal request, but the server is refusing to respond. Please reach out to FactSet Account Team for assistance with authorization. -
415 Unsupported Media Type. This error may be returned when the caller sends a resource in a format that is not accepted by the server. This can be fixed by ensuring that Content-Type header is set to the correct value. In this instance, \"application/json\" would be the appropriate value. -
500 Internal Server Error. -
*/
public GroupHoldingsResponse getGroupHoldingsForList(GroupHoldingsRequest groupHoldingsRequest) throws ApiException {
return getGroupHoldingsForListWithHttpInfo(groupHoldingsRequest).getData();
}
/**
* Get group holdings for a specific date and group.
* Retrieves the holding percentages for the group and funds specified. Available groups are: * **ASSET** = Asset Class * **ASSETISTYP** = Issue Type with Asset Class * **CAPGRP** = Cap Group * **CNTRY** = Country * **EXCHANGE** = Exchange * **INDUSTRY** = Industry * **ISSUE_TYPE** = Issue Type * **REGION** = Region * **SECTOR** = Sector * **ULTPARENT** = Ultimate Parent
* @param groupHoldingsRequest The Group Holdings request body, allowing the user to specify a list of ids, date, and group. (required)
* @return ApiResponse<GroupHoldingsResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code Description Response Headers
200 The Group Holdings response object. -
400 Bad Request. This can occur for several reasons. Please review the \"message\" for more details. -
401 Unauthenticated USERNAME-SERIAL. Ensure you are logged in and have successfully generated an API KEY for the IP range you are connecting from. For more help, select the **Report Issue** in the top right corner of this Developer Portal specification card and choose Connectivity 401 or 403 Responses. -
403 The USERNAME-SERIAL attempted to request the endpoint is not authorized to access. The request was a legal request, but the server is refusing to respond. Please reach out to FactSet Account Team for assistance with authorization. -
415 Unsupported Media Type. This error may be returned when the caller sends a resource in a format that is not accepted by the server. This can be fixed by ensuring that Content-Type header is set to the correct value. In this instance, \"application/json\" would be the appropriate value. -
500 Internal Server Error. -
*/
public ApiResponse getGroupHoldingsForListWithHttpInfo(GroupHoldingsRequest groupHoldingsRequest) throws ApiException {
Object localVarPostBody = groupHoldingsRequest;
// verify the required parameter 'groupHoldingsRequest' is set
if (groupHoldingsRequest == null) {
throw new ApiException(400, "Missing the required parameter 'groupHoldingsRequest' when calling getGroupHoldingsForList");
}
// create path and map variables
String localVarPath = "/factset-funds/v1/holdings/group";
// query params
java.util.List localVarQueryParams = new java.util.ArrayList();
java.util.Map localVarHeaderParams = new java.util.HashMap();
java.util.Map localVarCookieParams = new java.util.HashMap();
java.util.Map localVarFormParams = new java.util.HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "FactSetApiKey", "FactSetOAuth2", "FactSetOAuth2Client" };
ApiResponse<
GroupHoldingsResponse
> apiResponse = apiClient.invokeAPI("GroupHoldingsApi.getGroupHoldingsForList", localVarPath, "POST", localVarQueryParams, localVarPostBody,
localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
localVarAuthNames, getGroupHoldingsForListResponseTypeMap, false);
return apiResponse;
}
}