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

com.finbourne.insights.api.AccessEvaluationsApi Maven / Gradle / Ivy

There is a newer version: 2.0.54
Show newest version
/*
 * FINBOURNE Insights API
 *
 * Contact: [email protected]
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

package com.finbourne.insights.api;

import com.finbourne.insights.ApiCallback;
import com.finbourne.insights.ApiClient;
import com.finbourne.insights.ApiException;
import com.finbourne.insights.ApiResponse;
import com.finbourne.insights.Configuration;
import com.finbourne.insights.Pair;
import com.finbourne.insights.ProgressRequestBody;
import com.finbourne.insights.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import com.finbourne.insights.model.AccessEvaluationLog;
import com.finbourne.insights.model.LusidProblemDetails;
import com.finbourne.insights.model.LusidValidationProblemDetails;
import java.time.OffsetDateTime;
import com.finbourne.insights.model.ResourceListWithHistogramOfAccessEvaluationLog;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class AccessEvaluationsApi {
    private ApiClient localVarApiClient;
    private int localHostIndex;
    private String localCustomBaseUrl;

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

    public AccessEvaluationsApi(ApiClient apiClient) {
        this.localVarApiClient = apiClient;
    }

    public ApiClient getApiClient() {
        return localVarApiClient;
    }

    public void setApiClient(ApiClient apiClient) {
        this.localVarApiClient = apiClient;
    }

    public int getHostIndex() {
        return localHostIndex;
    }

    public void setHostIndex(int hostIndex) {
        this.localHostIndex = hostIndex;
    }

    public String getCustomBaseUrl() {
        return localCustomBaseUrl;
    }

    public void setCustomBaseUrl(String customBaseUrl) {
        this.localCustomBaseUrl = customBaseUrl;
    }

    private okhttp3.Call getAccessEvaluationLogCall(String id, final ApiCallback _callback) throws ApiException {
        String basePath = null;
        // Operation Servers
        String[] localBasePaths = new String[] {  };

        // Determine Base Path to Use
        if (localCustomBaseUrl != null){
            basePath = localCustomBaseUrl;
        } else if ( localBasePaths.length > 0 ) {
            basePath = localBasePaths[localHostIndex];
        } else {
            basePath = null;
        }

        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/api/access/{id}"
            .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));

        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
        Map localVarCookieParams = new HashMap();
        Map localVarFormParams = new HashMap();

        final String[] localVarAccepts = {
            "text/plain",
            "application/json",
            "text/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        if (localVarContentType != null) {
            localVarHeaderParams.put("Content-Type", localVarContentType);
        }

        String[] localVarAuthNames = new String[] { "oauth2" };
        return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getAccessEvaluationLogValidateBeforeCall(String id, final ApiCallback _callback) throws ApiException {
        // verify the required parameter 'id' is set
        if (id == null) {
            throw new ApiException("Missing the required parameter 'id' when calling getAccessEvaluationLog(Async)");
        }

        return getAccessEvaluationLogCall(id, _callback);

    }


    private ApiResponse getAccessEvaluationLogWithHttpInfo(String id) throws ApiException {
        okhttp3.Call localVarCall = getAccessEvaluationLogValidateBeforeCall(id, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    private okhttp3.Call getAccessEvaluationLogAsync(String id, final ApiCallback _callback) throws ApiException {

        okhttp3.Call localVarCall = getAccessEvaluationLogValidateBeforeCall(id, _callback);
        Type localVarReturnType = new TypeToken(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }

    public class APIgetAccessEvaluationLogRequest {
        private final String id;

        private APIgetAccessEvaluationLogRequest(String id) {
            this.id = id;
        }

        /**
         * Build call for getAccessEvaluationLog
         * @param _callback ApiCallback API callback
         * @return Call to execute
         * @throws ApiException If fail to serialize the request body object
         * @http.response.details
         
Status Code Description Response Headers
200 Success -
400 The details of the input related failure -
0 Error response -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return getAccessEvaluationLogCall(id, _callback); } /** * Execute getAccessEvaluationLog request * @return AccessEvaluationLog * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 Success -
400 The details of the input related failure -
0 Error response -
*/ public AccessEvaluationLog execute() throws ApiException { ApiResponse localVarResp = getAccessEvaluationLogWithHttpInfo(id); return localVarResp.getData(); } /** * Execute getAccessEvaluationLog request with HTTP info returned * @return ApiResponse<AccessEvaluationLog> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 Success -
400 The details of the input related failure -
0 Error response -
*/ public ApiResponse executeWithHttpInfo() throws ApiException { return getAccessEvaluationLogWithHttpInfo(id); } /** * Execute getAccessEvaluationLog request (asynchronously) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 Success -
400 The details of the input related failure -
0 Error response -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return getAccessEvaluationLogAsync(id, _callback); } } /** * [EARLY ACCESS] GetAccessEvaluationLog: Get the log for a specific access evaluation. This endpoint will be deprecated in the near future. * * @param id The identifier of the access evaluation to obtain the log for. (required) * @return APIgetAccessEvaluationLogRequest * @http.response.details
Status Code Description Response Headers
200 Success -
400 The details of the input related failure -
0 Error response -
*/ public APIgetAccessEvaluationLogRequest getAccessEvaluationLog(String id) { return new APIgetAccessEvaluationLogRequest(id); } private okhttp3.Call listAccessEvaluationLogsCall(OffsetDateTime startAt, OffsetDateTime endAt, String filter, String sortBy, Integer limit, String page, String histogramInterval, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = null; // create path and map variables String localVarPath = "/api/access"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (startAt != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("startAt", startAt)); } if (endAt != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("endAt", endAt)); } if (filter != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter", filter)); } if (sortBy != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("sortBy", sortBy)); } if (limit != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); } if (page != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); } if (histogramInterval != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("histogramInterval", histogramInterval)); } final String[] localVarAccepts = { "text/plain", "application/json", "text/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "oauth2" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call listAccessEvaluationLogsValidateBeforeCall(OffsetDateTime startAt, OffsetDateTime endAt, String filter, String sortBy, Integer limit, String page, String histogramInterval, final ApiCallback _callback) throws ApiException { return listAccessEvaluationLogsCall(startAt, endAt, filter, sortBy, limit, page, histogramInterval, _callback); } private ApiResponse listAccessEvaluationLogsWithHttpInfo(OffsetDateTime startAt, OffsetDateTime endAt, String filter, String sortBy, Integer limit, String page, String histogramInterval) throws ApiException { okhttp3.Call localVarCall = listAccessEvaluationLogsValidateBeforeCall(startAt, endAt, filter, sortBy, limit, page, histogramInterval, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call listAccessEvaluationLogsAsync(OffsetDateTime startAt, OffsetDateTime endAt, String filter, String sortBy, Integer limit, String page, String histogramInterval, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = listAccessEvaluationLogsValidateBeforeCall(startAt, endAt, filter, sortBy, limit, page, histogramInterval, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class APIlistAccessEvaluationLogsRequest { private OffsetDateTime startAt; private OffsetDateTime endAt; private String filter; private String sortBy; private Integer limit; private String page; private String histogramInterval; private APIlistAccessEvaluationLogsRequest() { } /** * Set startAt * @param startAt Start date from which point to fetch logs. (optional) * @return APIlistAccessEvaluationLogsRequest */ public APIlistAccessEvaluationLogsRequest startAt(OffsetDateTime startAt) { this.startAt = startAt; return this; } /** * Set endAt * @param endAt End date to which point to fetch logs. (optional) * @return APIlistAccessEvaluationLogsRequest */ public APIlistAccessEvaluationLogsRequest endAt(OffsetDateTime endAt) { this.endAt = endAt; return this; } /** * Set filter * @param filter Expression to filter the result set. Read more about <see href=\"https://support.lusid.com/filtering-results-from-lusid\"> filtering results from LUSID</see>. (optional) * @return APIlistAccessEvaluationLogsRequest */ public APIlistAccessEvaluationLogsRequest filter(String filter) { this.filter = filter; return this; } /** * Set sortBy * @param sortBy Order the results by these fields. Use the '-' sign to denote descending order e.g. -MyFieldName. Multiple fields can be denoted by a comma e.g. -MyFieldName,AnotherFieldName,-AFurtherFieldName (optional) * @return APIlistAccessEvaluationLogsRequest */ public APIlistAccessEvaluationLogsRequest sortBy(String sortBy) { this.sortBy = sortBy; return this; } /** * Set limit * @param limit When paginating, only return this number of records. The minimum value is 0 and the maximum is 10000. (optional) * @return APIlistAccessEvaluationLogsRequest */ public APIlistAccessEvaluationLogsRequest limit(Integer limit) { this.limit = limit; return this; } /** * Set page * @param page Encoded page string returned from a previous search result that will retrieve the next page of data. When this field is supplied, filter and sortby fields should not be supplied. (optional) * @return APIlistAccessEvaluationLogsRequest */ public APIlistAccessEvaluationLogsRequest page(String page) { this.page = page; return this; } /** * Set histogramInterval * @param histogramInterval The interval for an included histogram of the logs (optional) * @return APIlistAccessEvaluationLogsRequest */ public APIlistAccessEvaluationLogsRequest histogramInterval(String histogramInterval) { this.histogramInterval = histogramInterval; return this; } /** * Build call for listAccessEvaluationLogs * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 Success -
400 The details of the input related failure -
0 Error response -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return listAccessEvaluationLogsCall(startAt, endAt, filter, sortBy, limit, page, histogramInterval, _callback); } /** * Execute listAccessEvaluationLogs request * @return ResourceListWithHistogramOfAccessEvaluationLog * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 Success -
400 The details of the input related failure -
0 Error response -
*/ public ResourceListWithHistogramOfAccessEvaluationLog execute() throws ApiException { ApiResponse localVarResp = listAccessEvaluationLogsWithHttpInfo(startAt, endAt, filter, sortBy, limit, page, histogramInterval); return localVarResp.getData(); } /** * Execute listAccessEvaluationLogs request with HTTP info returned * @return ApiResponse<ResourceListWithHistogramOfAccessEvaluationLog> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 Success -
400 The details of the input related failure -
0 Error response -
*/ public ApiResponse executeWithHttpInfo() throws ApiException { return listAccessEvaluationLogsWithHttpInfo(startAt, endAt, filter, sortBy, limit, page, histogramInterval); } /** * Execute listAccessEvaluationLogs request (asynchronously) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 Success -
400 The details of the input related failure -
0 Error response -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return listAccessEvaluationLogsAsync(startAt, endAt, filter, sortBy, limit, page, histogramInterval, _callback); } } /** * [EARLY ACCESS] ListAccessEvaluationLogs: List the logs for access evaluations. * * @return APIlistAccessEvaluationLogsRequest * @http.response.details
Status Code Description Response Headers
200 Success -
400 The details of the input related failure -
0 Error response -
*/ public APIlistAccessEvaluationLogsRequest listAccessEvaluationLogs() { return new APIlistAccessEvaluationLogsRequest(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy