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

com.finbourne.notifications.api.DeliveriesApi Maven / Gradle / Ivy

There is a newer version: 2.0.68
Show newest version
/*
 * FINBOURNE Notifications 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.notifications.api;

import com.finbourne.notifications.ApiCallback;
import com.finbourne.notifications.ApiClient;
import com.finbourne.notifications.ApiException;
import com.finbourne.notifications.ApiResponse;
import com.finbourne.notifications.Configuration;
import com.finbourne.notifications.Pair;
import com.finbourne.notifications.ProgressRequestBody;
import com.finbourne.notifications.ProgressResponseBody;
import com.finbourne.notifications.extensions.ConfigurationOptions;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import com.finbourne.notifications.model.LusidProblemDetails;
import com.finbourne.notifications.model.LusidValidationProblemDetails;
import com.finbourne.notifications.model.ResourceListOfDelivery;

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

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

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

    public DeliveriesApi(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 listDeliveriesCall(String page, Integer limit, String filter, final ApiCallback _callback) throws ApiException {
        return listDeliveriesCall(page, limit, filter,  _callback, new ConfigurationOptions());
    }

    private okhttp3.Call listDeliveriesCall(String page, Integer limit, String filter, final ApiCallback _callback, ConfigurationOptions opts) 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/deliveries";

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

        if (page != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
        }

        if (limit != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit));
        }

        if (filter != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter", filter));
        }

        final String[] localVarAccepts = {
            "application/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, opts);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call listDeliveriesValidateBeforeCall(String page, Integer limit, String filter, final ApiCallback _callback, ConfigurationOptions opts) throws ApiException {
        return listDeliveriesCall(page, limit, filter, _callback, opts);

    }


    private ApiResponse listDeliveriesWithHttpInfo(String page, Integer limit, String filter) throws ApiException {
        okhttp3.Call localVarCall = listDeliveriesValidateBeforeCall(page, limit, filter, null, new ConfigurationOptions());
        Type localVarReturnType = new TypeToken(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    private ApiResponse listDeliveriesWithHttpInfo(String page, Integer limit, String filter, ConfigurationOptions opts) throws ApiException {
        okhttp3.Call localVarCall = listDeliveriesValidateBeforeCall(page, limit, filter, null, opts);
        Type localVarReturnType = new TypeToken(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    private okhttp3.Call listDeliveriesAsync(String page, Integer limit, String filter, final ApiCallback _callback) throws ApiException {

        okhttp3.Call localVarCall = listDeliveriesValidateBeforeCall(page, limit, filter, _callback, new ConfigurationOptions());
        Type localVarReturnType = new TypeToken(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }

    private okhttp3.Call listDeliveriesAsync(String page, Integer limit, String filter, final ApiCallback _callback, ConfigurationOptions opts) throws ApiException {

        okhttp3.Call localVarCall = listDeliveriesValidateBeforeCall(page, limit, filter, _callback, opts);
        Type localVarReturnType = new TypeToken(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }

    public class APIlistDeliveriesRequest {
        private String page;
        private Integer limit;
        private String filter;

        private APIlistDeliveriesRequest() {
        }

        /**
         * Set page
         * @param page The pagination token to use to continue listing delivery attempts. This value is returned from the previous call. When this field is supplied the filter field should not be supplied. (optional)
         * @return APIlistDeliveriesRequest
         */
        public APIlistDeliveriesRequest page(String page) {
            this.page = page;
            return this;
        }

        /**
         * Set limit
         * @param limit The maximum number of delivery attempts to retrieve. Defaults to 200 if not specified. (optional)
         * @return APIlistDeliveriesRequest
         */
        public APIlistDeliveriesRequest limit(Integer limit) {
            this.limit = limit;
            return this;
        }

        /**
         * Set filter
         * @param filter Expression to filter the result set. For more information about filtering results, see https://support.lusid.com/knowledgebase/article/KA-01914.  By default, we set this filter to only query for the last week's worth of Deliveries, however if a filter is explicitly set, this will be overriden.  An example filter to override the attempt time date might be 'AttemptTime gt 2023-08-25' for example (optional)
         * @return APIlistDeliveriesRequest
         */
        public APIlistDeliveriesRequest filter(String filter) {
            this.filter = filter;
            return this;
        }

        /**
         * Build call for listDeliveries
         * @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 -
404 No deliveries exists with the provided filter(s) -
0 Error response -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return listDeliveriesCall(page, limit, filter, _callback); } /** * Execute listDeliveries request * @return ResourceListOfDelivery * @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 -
404 No deliveries exists with the provided filter(s) -
0 Error response -
*/ public ResourceListOfDelivery execute() throws ApiException { ApiResponse localVarResp = listDeliveriesWithHttpInfo(page, limit, filter); return localVarResp.getData(); } /** * Execute listDeliveries request. Use any specified configuration options to override any other configuration for this request only. * @return ResourceListOfDelivery * @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 -
404 No deliveries exists with the provided filter(s) -
0 Error response -
*/ public ResourceListOfDelivery execute(ConfigurationOptions opts) throws ApiException { ApiResponse localVarResp = listDeliveriesWithHttpInfo(page, limit, filter, opts); return localVarResp.getData(); } /** * Execute listDeliveries request with HTTP info returned * @return ApiResponse<ResourceListOfDelivery> * @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 -
404 No deliveries exists with the provided filter(s) -
0 Error response -
*/ public ApiResponse executeWithHttpInfo() throws ApiException { return listDeliveriesWithHttpInfo(page, limit, filter); } /** * Execute listDeliveries request with HTTP info returned. Use any specified configuration options to override any other configuration for this request only. * @return ApiResponse<ResourceListOfDelivery> * @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 -
404 No deliveries exists with the provided filter(s) -
0 Error response -
*/ public ApiResponse executeWithHttpInfo(ConfigurationOptions opts) throws ApiException { return listDeliveriesWithHttpInfo(page, limit, filter, opts); } /** * Execute listDeliveries 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 -
404 No deliveries exists with the provided filter(s) -
0 Error response -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return listDeliveriesAsync(page, limit, filter, _callback); } /** * Execute listDeliveries request (asynchronously). Use any specified configuration options to override any other configuration for this request only. * @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 -
404 No deliveries exists with the provided filter(s) -
0 Error response -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback, ConfigurationOptions opts) throws ApiException { return listDeliveriesAsync(page, limit, filter, _callback, opts); } } /** * [EXPERIMENTAL] ListDeliveries: List Deliveries * Currently only returns deliveries with failed attempts. * @return APIlistDeliveriesRequest * @http.response.details
Status Code Description Response Headers
200 Success -
400 The details of the input related failure -
404 No deliveries exists with the provided filter(s) -
0 Error response -
*/ public APIlistDeliveriesRequest listDeliveries() { return new APIlistDeliveriesRequest(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy