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

com.factset.sdk.FactSetGlobalPrices.api.SharesOutstandingApi Maven / Gradle / Ivy

There is a newer version: 3.1.2
Show newest version
package com.factset.sdk.FactSetGlobalPrices.api;

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

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

import com.factset.sdk.FactSetGlobalPrices.models.BatchStatusResponse;
import com.factset.sdk.FactSetGlobalPrices.models.SharesOutstandingRequest;
import com.factset.sdk.FactSetGlobalPrices.models.SharesOutstandingResponse;
import com.factset.sdk.FactSetGlobalPrices.models.SoErrorResponse;

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

public class SharesOutstandingApi {
  private ApiClient apiClient;

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

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

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

  
 /**
   * Wrapper to support GET /factset-global-prices/v1/security-shares returning different types
   * per status code.
   *
   * 

* Responses: *

    *
  • 200 : {@code SharesOutstandingResponse }
    Array of security shares outstanding information for a given date range and list of securities
  • * *
  • 202 : {@code BatchStatusResponse }
    Batch request has been accepted.
  • *
* *

* Example: *

{@code
   * GetSharesOutstandingResponseWrapper response = ...;
   * switch (response.statusCode) {
   *   case 200:
   *     SharesOutstandingResponse data200 = response.getResponse200();
   *     break;
   *   case 202:
   *     BatchStatusResponse data202 = response.getResponse202();
   *     break;
   *  }
   * }
*/ public static class GetSharesOutstandingResponseWrapper { public final int statusCode; public final Object response; public GetSharesOutstandingResponseWrapper(int statusCode, Object response) { this.statusCode = statusCode; this.response = response; } public int getStatusCode() { return statusCode; } public Object getResponse() { return response; } public SharesOutstandingResponse getResponse200() throws ApiException { if (this.statusCode != 200) { throw new ApiException(500, "Invalid response getter called. getResponse200 can't return a " + this.statusCode + " response"); } return (SharesOutstandingResponse) 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; } GetSharesOutstandingResponseWrapper other = (GetSharesOutstandingResponseWrapper) 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 GetSharesOutstandingResponseWrapper {\n" + " statusCode: " + statusCode + "\n" + " response: " + Objects.toString(response).replace("\n", "\n ") + "\n}"; } } /** * Wrapper to support POST /factset-global-prices/v1/security-shares returning different types * per status code. * *

* Responses: *

    *
  • 200 : {@code SharesOutstandingResponse }
    Array of shares outstanding
  • * *
  • 202 : {@code BatchStatusResponse }
    Batch request has been accepted.
  • *
* *

* Example: *

{@code
   * PostSharesOutstandingResponseWrapper response = ...;
   * switch (response.statusCode) {
   *   case 200:
   *     SharesOutstandingResponse data200 = response.getResponse200();
   *     break;
   *   case 202:
   *     BatchStatusResponse data202 = response.getResponse202();
   *     break;
   *  }
   * }
*/ public static class PostSharesOutstandingResponseWrapper { public final int statusCode; public final Object response; public PostSharesOutstandingResponseWrapper(int statusCode, Object response) { this.statusCode = statusCode; this.response = response; } public int getStatusCode() { return statusCode; } public Object getResponse() { return response; } public SharesOutstandingResponse getResponse200() throws ApiException { if (this.statusCode != 200) { throw new ApiException(500, "Invalid response getter called. getResponse200 can't return a " + this.statusCode + " response"); } return (SharesOutstandingResponse) 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; } PostSharesOutstandingResponseWrapper other = (PostSharesOutstandingResponseWrapper) 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 PostSharesOutstandingResponseWrapper {\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; } /** * Gets Shares Outstanding information for securities. * Returns security level shares outstanding data for the given ids and dates. At this time, all values returned are split adjusted. * @param ids The requested list of security identifiers. Accepted ID types include Market Tickers, SEDOL, ISINs, CUSIPs, or FactSet Permanent Ids.<p>***ids limit** = 50 per both non-batch request and batch 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, it's advised for any requests with large request lines to be requested through the respective \"POST\" method.</p>* (required) * @param startDate The start date requested for a given date range in **YYYY-MM-DD** format. The input start date must be before the input end date. Future dates (T+1) are not accepted in this endpoint. (optional, default to 2021-08-27T00:00:00.000Z) * @param endDate The end date requested for a given date range in **YYYY-MM-DD** format. The input end date must be after the input start date. Future dates (T+1) are not accepted in this endpoint. (optional) * @param frequency Controls the display frequency of the data returned. * **D** = Daily * **AD** = Actual Daily * **W** = Weekly, based on the last day of the week of the start date. * **M** = Monthly, based on the last trading day of the month. * **AM** = Monthly, based on the start date (e.g., if the start date is June 16, data is displayed for June 16, May 16, April 16 etc.). * **AQ** = Actual Quarterly * **CQ** = Quarterly based on the last trading day of the calendar quarter (March, June, September, or December). * **ASA** = Actual Semi-annual * **CSA** = Calendar Semi-annual * **AY** = Actual Annual, based on the start date. * **CY** = Calendar Annual, based on the last trading day of the calendar year. (optional, default to D) * @param calendar Calendar of data returned. SEVENDAY includes weekends. (optional, default to FIVEDAY) * @param batch Enables the ability to asynchronously \"batch\" the request, supporting a long-running request for up to 20 minutes. Upon requesting batch=Y, the service will respond with an HTTP Status Code of 202. Once a batch request is submitted, use batch status to see if the job has been completed. Once completed, retrieve the results of the request via batch-result. When using Batch, ids limit is increased to 10000 ids per request, though limits on query string via GET method still apply. It's advised to submit large lists of ids via POST method. <B>Please note that the number of unique currencies present in the requested ids is limited to 50 per request.</B> (optional, default to N) * @return GetSharesOutstandingResponseWrapper * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 Array of security shares outstanding information for a given date range and list of securities -
202 Batch request has been accepted. * Location - Path to Batch Request result.
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 GetSharesOutstandingResponseWrapper getSharesOutstanding(java.util.List ids, String startDate, String endDate, String frequency, String calendar, String batch) throws ApiException { return getSharesOutstandingWithHttpInfo(ids, startDate, endDate, frequency, calendar, batch).getData(); } /** * Gets Shares Outstanding information for securities. * Returns security level shares outstanding data for the given ids and dates. At this time, all values returned are split adjusted. * @param ids The requested list of security identifiers. Accepted ID types include Market Tickers, SEDOL, ISINs, CUSIPs, or FactSet Permanent Ids.<p>***ids limit** = 50 per both non-batch request and batch 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, it's advised for any requests with large request lines to be requested through the respective \"POST\" method.</p>* (required) * @param startDate The start date requested for a given date range in **YYYY-MM-DD** format. The input start date must be before the input end date. Future dates (T+1) are not accepted in this endpoint. (optional, default to 2021-08-27T00:00:00.000Z) * @param endDate The end date requested for a given date range in **YYYY-MM-DD** format. The input end date must be after the input start date. Future dates (T+1) are not accepted in this endpoint. (optional) * @param frequency Controls the display frequency of the data returned. * **D** = Daily * **AD** = Actual Daily * **W** = Weekly, based on the last day of the week of the start date. * **M** = Monthly, based on the last trading day of the month. * **AM** = Monthly, based on the start date (e.g., if the start date is June 16, data is displayed for June 16, May 16, April 16 etc.). * **AQ** = Actual Quarterly * **CQ** = Quarterly based on the last trading day of the calendar quarter (March, June, September, or December). * **ASA** = Actual Semi-annual * **CSA** = Calendar Semi-annual * **AY** = Actual Annual, based on the start date. * **CY** = Calendar Annual, based on the last trading day of the calendar year. (optional, default to D) * @param calendar Calendar of data returned. SEVENDAY includes weekends. (optional, default to FIVEDAY) * @param batch Enables the ability to asynchronously \"batch\" the request, supporting a long-running request for up to 20 minutes. Upon requesting batch=Y, the service will respond with an HTTP Status Code of 202. Once a batch request is submitted, use batch status to see if the job has been completed. Once completed, retrieve the results of the request via batch-result. When using Batch, ids limit is increased to 10000 ids per request, though limits on query string via GET method still apply. It's advised to submit large lists of ids via POST method. <B>Please note that the number of unique currencies present in the requested ids is limited to 50 per request.</B> (optional, default to N) * @return ApiResponse<GetSharesOutstandingResponseWrapper> * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 Array of security shares outstanding information for a given date range and list of securities -
202 Batch request has been accepted. * Location - Path to Batch Request result.
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 getSharesOutstandingWithHttpInfo(java.util.List ids, String startDate, String endDate, String frequency, String calendar, String batch) 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 getSharesOutstanding"); } // create path and map variables String localVarPath = "/factset-global-prices/v1/security-shares"; // 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("", "startDate", startDate)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "endDate", endDate)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "frequency", frequency)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "calendar", calendar)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "batch", batch)); 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("SharesOutstandingApi.getSharesOutstanding", localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, getSharesOutstandingResponseTypeMap, false); int statusCode = apiResponse.getStatusCode(); GetSharesOutstandingResponseWrapper responseWrapper = new GetSharesOutstandingResponseWrapper( statusCode, apiResponse.getData() ); return new ApiResponse(statusCode, apiResponse.getHeaders(), responseWrapper); } /** * Gets Shares Outstanding information for securities. * Returns security level shares outstanding data for the given ids and dates. At this time, all values returned are split adjusted. * @param sharesOutstandingRequest Request object for `Shares Outstanding`. (required) * @return PostSharesOutstandingResponseWrapper * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 Array of shares outstanding -
202 Batch request has been accepted. * Location - Path to Batch Request result.
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 PostSharesOutstandingResponseWrapper postSharesOutstanding(SharesOutstandingRequest sharesOutstandingRequest) throws ApiException { return postSharesOutstandingWithHttpInfo(sharesOutstandingRequest).getData(); } /** * Gets Shares Outstanding information for securities. * Returns security level shares outstanding data for the given ids and dates. At this time, all values returned are split adjusted. * @param sharesOutstandingRequest Request object for `Shares Outstanding`. (required) * @return ApiResponse<PostSharesOutstandingResponseWrapper> * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 Array of shares outstanding -
202 Batch request has been accepted. * Location - Path to Batch Request result.
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 postSharesOutstandingWithHttpInfo(SharesOutstandingRequest sharesOutstandingRequest) throws ApiException { Object localVarPostBody = sharesOutstandingRequest; // verify the required parameter 'sharesOutstandingRequest' is set if (sharesOutstandingRequest == null) { throw new ApiException(400, "Missing the required parameter 'sharesOutstandingRequest' when calling postSharesOutstanding"); } // create path and map variables String localVarPath = "/factset-global-prices/v1/security-shares"; // 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< Object > apiResponse = apiClient.invokeAPI("SharesOutstandingApi.postSharesOutstanding", localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, postSharesOutstandingResponseTypeMap, false); int statusCode = apiResponse.getStatusCode(); PostSharesOutstandingResponseWrapper responseWrapper = new PostSharesOutstandingResponseWrapper( statusCode, apiResponse.getData() ); return new ApiResponse(statusCode, apiResponse.getHeaders(), responseWrapper); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy