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

com.seeq.api.UsageApi Maven / Gradle / Ivy

There is a newer version: 66.0.0-v202410141803
Show newest version
package com.seeq.api;

import com.seeq.ApiException;
import com.seeq.ApiClient;
import com.seeq.Configuration;
import com.seeq.model.*;
import com.seeq.Pair;

import javax.ws.rs.core.GenericType;
import javax.ws.rs.ProcessingException;

import com.seeq.model.UsageOutputListV1;
import com.seeq.model.UsageTypesV1;


import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class UsageApi {
    private ApiClient apiClient;
    private long retryTimeout = 5_000; // Default of 5 seconds

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

    public UsageApi(ApiClient apiClient) {
        this.apiClient = apiClient;
    }

    public void setRetryTimeout(long retryTimeout) {
        this.retryTimeout = retryTimeout;
    }

    public long getRetryTimeout() {
        return this.retryTimeout;
    }

    public ApiClient getApiClient() {
        return apiClient;
    }

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

    /**
    * Get the list of available types that can be used as filter values for the reporting endpoint
    * 
    * @return UsageTypesV1
    * @throws ApiException if fails to make API call
    */
    public UsageTypesV1 getTypes() throws ApiException {
        ApiClient.ApiResponse localVarResponse = getTypesWithHttpInfo();
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Get the list of available types that can be used as filter values for the reporting endpoint
    * 
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getTypesWithHttpInfo() throws ApiException {
        Map localVarHeaderParams = new HashMap();
        return getTypesWithHeadersAndHttpInfo(localVarHeaderParams);
        
    }

    /**
    * Get the list of available types that can be used as filter values for the reporting endpoint
    * 
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getTypesWithHeadersAndHttpInfo(Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
                localVarHeaderParams.putAll(customHeaders);
        return getTypesInternal(localVarQueryParams, localVarHeaderParams);
    }
    
    private ApiClient.ApiResponse getTypesInternal(List queryParams, Map headerParams) throws ApiException {
        Object localVarPostBody = null;
        // create path and map variables
        String localVarPath = "/usage/types";

        // query params
        Map localVarFormParams = new HashMap();

        
        final String[] localVarAccepts = {
        "application/vnd.seeq.v1+json"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

        final String[] localVarContentTypes = {
        
        };
        final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

        String[] localVarAuthNames = new String[] { "api_key" };

        long apiClientInvocationTime = System.currentTimeMillis();
        while(true) {
            try {
                GenericType localVarReturnType = new GenericType() {};
                return apiClient.invokeAPIWithHttpInfo(localVarPath, "GET", queryParams, localVarPostBody, headerParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
                // Possible exceptions:
                // ===================
                // * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
                //    during conversion of the response entity data to an instance of a particular Java type).
                // * ProcessingException - in case the request processing or subsequent I/O operation fails.
                // * WebApplicationException - in case the response status code of the response returned by the server is not
                //    successful and the specified response type is not Response.
                // * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
                //    in ApiException(s)
            } catch (ApiException | ProcessingException e) {
                if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
                    long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
                    if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
                        continue;
                    }
                }
                throw e;
            }
        } // while
    }
    /**
    * Get usage records for the specified time range. Results will be sorted by date if aggregating by day or month, otherwise by amount descending and limited to the first 500 records
    * 
    * @param startTime Start time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param endTime End time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param type Filter by type of usage (e.g. Analysis, Screenshot) (optional)
    * @param source Filter by any part of the origin label or origin url fields (optional)
    * @param unit Filter by the unit that the usage is measured in (e.g. Bytes, Credits, Any). Default is Bytes. (optional, default to Bytes)
    * @param identityId Filter by the UUID of the user who initiated the request (optional)
    * @param aggregateBy Aggregate the usage records by one or more fields. Cannot aggregate by both Day and Month at the same time. (optional)
    * @param cacheTypes The cache types to include in this query. If not set all will be returned. (optional)
    * @return UsageOutputListV1
    * @throws ApiException if fails to make API call
    */
    public UsageOutputListV1 getUsage(String startTime, String endTime, List type, String source, String unit, List identityId, List aggregateBy, List cacheTypes) throws ApiException {
        ApiClient.ApiResponse localVarResponse = getUsageWithHttpInfo(startTime, endTime, type, source, unit, identityId, aggregateBy, cacheTypes);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Get usage records for the specified time range. Results will be sorted by date if aggregating by day or month, otherwise by amount descending and limited to the first 500 records
    * 
    * @param startTime Start time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param endTime End time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param type Filter by type of usage (e.g. Analysis, Screenshot) (optional)
    * @param source Filter by any part of the origin label or origin url fields (optional)
    * @param unit Filter by the unit that the usage is measured in (e.g. Bytes, Credits, Any). Default is Bytes. (optional, default to Bytes)
    * @param identityId Filter by the UUID of the user who initiated the request (optional)
    * @param aggregateBy Aggregate the usage records by one or more fields. Cannot aggregate by both Day and Month at the same time. (optional)
    * @param cacheTypes The cache types to include in this query. If not set all will be returned. (optional)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getUsageWithHttpInfo(String startTime, String endTime, List type, String source, String unit, List identityId, List aggregateBy, List cacheTypes) throws ApiException {
        Map localVarHeaderParams = new HashMap();
        return getUsageWithHeadersAndHttpInfo(startTime, endTime, type, source, unit, identityId, aggregateBy, cacheTypes, localVarHeaderParams);
        
    }

    /**
    * Get usage records for the specified time range. Results will be sorted by date if aggregating by day or month, otherwise by amount descending and limited to the first 500 records
    * 
    * @param startTime Start time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param endTime End time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param type Filter by type of usage (e.g. Analysis, Screenshot) (optional)
    * @param source Filter by any part of the origin label or origin url fields (optional)
    * @param unit Filter by the unit that the usage is measured in (e.g. Bytes, Credits, Any). Default is Bytes. (optional, default to Bytes)
    * @param identityId Filter by the UUID of the user who initiated the request (optional)
    * @param aggregateBy Aggregate the usage records by one or more fields. Cannot aggregate by both Day and Month at the same time. (optional)
    * @param cacheTypes The cache types to include in this query. If not set all will be returned. (optional)
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getUsageWithHeadersAndHttpInfo(String startTime, String endTime, List type, String source, String unit, List identityId, List aggregateBy, List cacheTypes, Map customHeaders) throws ApiException {
          // verify the required query parameter 'startTime' is set
        if (startTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'startTime' when calling getUsage");
        }
          // verify the required query parameter 'endTime' is set
        if (endTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'endTime' when calling getUsage");
        }
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "startTime", startTime));
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "endTime", endTime));
        localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "type", type));
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "source", source));
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "unit", unit));
        localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "identityId", identityId));
        localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "aggregateBy", aggregateBy));
        localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "cacheTypes", cacheTypes));
                localVarHeaderParams.putAll(customHeaders);
        return getUsageInternal(localVarQueryParams, localVarHeaderParams);
    }
    
    private ApiClient.ApiResponse getUsageInternal(List queryParams, Map headerParams) throws ApiException {
        Object localVarPostBody = null;
        // create path and map variables
        String localVarPath = "/usage";

        // query params
        Map localVarFormParams = new HashMap();

        
        final String[] localVarAccepts = {
        "application/vnd.seeq.v1+json"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

        final String[] localVarContentTypes = {
        
        };
        final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

        String[] localVarAuthNames = new String[] { "api_key" };

        long apiClientInvocationTime = System.currentTimeMillis();
        while(true) {
            try {
                GenericType localVarReturnType = new GenericType() {};
                return apiClient.invokeAPIWithHttpInfo(localVarPath, "GET", queryParams, localVarPostBody, headerParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
                // Possible exceptions:
                // ===================
                // * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
                //    during conversion of the response entity data to an instance of a particular Java type).
                // * ProcessingException - in case the request processing or subsequent I/O operation fails.
                // * WebApplicationException - in case the response status code of the response returned by the server is not
                //    successful and the specified response type is not Response.
                // * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
                //    in ApiException(s)
            } catch (ApiException | ProcessingException e) {
                if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
                    long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
                    if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
                        continue;
                    }
                }
                throw e;
            }
        } // while
    }
    // OVERLOADS START

    /**
    * Get usage records for the specified time range. Results will be sorted by date if aggregating by day or month, otherwise by amount descending and limited to the first 500 records
    *
    * @param startTime Start time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param endTime End time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param type Filter by type of usage (e.g. Analysis, Screenshot) (optional)
    * @param source Filter by any part of the origin label or origin url fields (optional)
    * @param unit Filter by the unit that the usage is measured in (e.g. Bytes, Credits, Any). Default is Bytes. (optional)
    * @param identityId Filter by the UUID of the user who initiated the request (optional)
    * @param aggregateBy Aggregate the usage records by one or more fields. Cannot aggregate by both Day and Month at the same time. (optional)
    * @return UsageOutputListV1
    * @throws ApiException if fails to make API call
    */
    public UsageOutputListV1 getUsage(String startTime, String endTime, List type, String source, String unit, List identityId, List aggregateBy) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        if (startTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'startTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "startTime", startTime));

        if (endTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'endTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "endTime", endTime));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "type", type));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "source", source));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "unit", unit));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "identityId", identityId));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "aggregateBy", aggregateBy));

        ApiClient.ApiResponse localVarResponse = getUsageInternal(localVarQueryParams, localVarHeaderParams);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }

    /**
    * Get usage records for the specified time range. Results will be sorted by date if aggregating by day or month, otherwise by amount descending and limited to the first 500 records
    * @param startTime Start time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param endTime End time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param type Filter by type of usage (e.g. Analysis, Screenshot) (optional)
    * @param source Filter by any part of the origin label or origin url fields (optional)
    * @param unit Filter by the unit that the usage is measured in (e.g. Bytes, Credits, Any). Default is Bytes. (optional)
    * @param identityId Filter by the UUID of the user who initiated the request (optional)
    * @param aggregateBy Aggregate the usage records by one or more fields. Cannot aggregate by both Day and Month at the same time. (optional)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getUsageWithHttpInfo(String startTime, String endTime, List type, String source, String unit, List identityId, List aggregateBy) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        if (startTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'startTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "startTime", startTime));

        if (endTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'endTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "endTime", endTime));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "type", type));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "source", source));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "unit", unit));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "identityId", identityId));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "aggregateBy", aggregateBy));

        return getUsageInternal(localVarQueryParams, localVarHeaderParams);
    }

    /**
    * Get usage records for the specified time range. Results will be sorted by date if aggregating by day or month, otherwise by amount descending and limited to the first 500 records
    *
    * @param startTime Start time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param endTime End time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param type Filter by type of usage (e.g. Analysis, Screenshot) (optional)
    * @param source Filter by any part of the origin label or origin url fields (optional)
    * @param unit Filter by the unit that the usage is measured in (e.g. Bytes, Credits, Any). Default is Bytes. (optional)
    * @param identityId Filter by the UUID of the user who initiated the request (optional)
    * @param aggregateBy Aggregate the usage records by one or more fields. Cannot aggregate by both Day and Month at the same time. (optional)
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getUsageWithHeadersAndHttpInfo(String startTime, String endTime, List type, String source, String unit, List identityId, List aggregateBy, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        if (startTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'startTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "startTime", startTime));

        if (endTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'endTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "endTime", endTime));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "type", type));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "source", source));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "unit", unit));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "identityId", identityId));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "aggregateBy", aggregateBy));

        localVarHeaderParams.putAll(customHeaders);
        return getUsageInternal(localVarQueryParams, localVarHeaderParams);
    }


    /**
    * Get usage records for the specified time range. Results will be sorted by date if aggregating by day or month, otherwise by amount descending and limited to the first 500 records
    *
    * @param startTime Start time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param endTime End time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param type Filter by type of usage (e.g. Analysis, Screenshot) (optional)
    * @param source Filter by any part of the origin label or origin url fields (optional)
    * @param unit Filter by the unit that the usage is measured in (e.g. Bytes, Credits, Any). Default is Bytes. (optional)
    * @param identityId Filter by the UUID of the user who initiated the request (optional)
    * @return UsageOutputListV1
    * @throws ApiException if fails to make API call
    */
    public UsageOutputListV1 getUsage(String startTime, String endTime, List type, String source, String unit, List identityId) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        if (startTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'startTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "startTime", startTime));

        if (endTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'endTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "endTime", endTime));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "type", type));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "source", source));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "unit", unit));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "identityId", identityId));

        ApiClient.ApiResponse localVarResponse = getUsageInternal(localVarQueryParams, localVarHeaderParams);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }

    /**
    * Get usage records for the specified time range. Results will be sorted by date if aggregating by day or month, otherwise by amount descending and limited to the first 500 records
    * @param startTime Start time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param endTime End time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param type Filter by type of usage (e.g. Analysis, Screenshot) (optional)
    * @param source Filter by any part of the origin label or origin url fields (optional)
    * @param unit Filter by the unit that the usage is measured in (e.g. Bytes, Credits, Any). Default is Bytes. (optional)
    * @param identityId Filter by the UUID of the user who initiated the request (optional)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getUsageWithHttpInfo(String startTime, String endTime, List type, String source, String unit, List identityId) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        if (startTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'startTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "startTime", startTime));

        if (endTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'endTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "endTime", endTime));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "type", type));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "source", source));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "unit", unit));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "identityId", identityId));

        return getUsageInternal(localVarQueryParams, localVarHeaderParams);
    }

    /**
    * Get usage records for the specified time range. Results will be sorted by date if aggregating by day or month, otherwise by amount descending and limited to the first 500 records
    *
    * @param startTime Start time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param endTime End time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param type Filter by type of usage (e.g. Analysis, Screenshot) (optional)
    * @param source Filter by any part of the origin label or origin url fields (optional)
    * @param unit Filter by the unit that the usage is measured in (e.g. Bytes, Credits, Any). Default is Bytes. (optional)
    * @param identityId Filter by the UUID of the user who initiated the request (optional)
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getUsageWithHeadersAndHttpInfo(String startTime, String endTime, List type, String source, String unit, List identityId, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        if (startTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'startTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "startTime", startTime));

        if (endTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'endTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "endTime", endTime));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "type", type));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "source", source));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "unit", unit));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "identityId", identityId));

        localVarHeaderParams.putAll(customHeaders);
        return getUsageInternal(localVarQueryParams, localVarHeaderParams);
    }


    /**
    * Get usage records for the specified time range. Results will be sorted by date if aggregating by day or month, otherwise by amount descending and limited to the first 500 records
    *
    * @param startTime Start time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param endTime End time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param type Filter by type of usage (e.g. Analysis, Screenshot) (optional)
    * @param source Filter by any part of the origin label or origin url fields (optional)
    * @param unit Filter by the unit that the usage is measured in (e.g. Bytes, Credits, Any). Default is Bytes. (optional)
    * @return UsageOutputListV1
    * @throws ApiException if fails to make API call
    */
    public UsageOutputListV1 getUsage(String startTime, String endTime, List type, String source, String unit) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        if (startTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'startTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "startTime", startTime));

        if (endTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'endTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "endTime", endTime));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "type", type));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "source", source));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "unit", unit));

        ApiClient.ApiResponse localVarResponse = getUsageInternal(localVarQueryParams, localVarHeaderParams);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }

    /**
    * Get usage records for the specified time range. Results will be sorted by date if aggregating by day or month, otherwise by amount descending and limited to the first 500 records
    * @param startTime Start time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param endTime End time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param type Filter by type of usage (e.g. Analysis, Screenshot) (optional)
    * @param source Filter by any part of the origin label or origin url fields (optional)
    * @param unit Filter by the unit that the usage is measured in (e.g. Bytes, Credits, Any). Default is Bytes. (optional)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getUsageWithHttpInfo(String startTime, String endTime, List type, String source, String unit) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        if (startTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'startTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "startTime", startTime));

        if (endTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'endTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "endTime", endTime));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "type", type));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "source", source));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "unit", unit));

        return getUsageInternal(localVarQueryParams, localVarHeaderParams);
    }

    /**
    * Get usage records for the specified time range. Results will be sorted by date if aggregating by day or month, otherwise by amount descending and limited to the first 500 records
    *
    * @param startTime Start time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param endTime End time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param type Filter by type of usage (e.g. Analysis, Screenshot) (optional)
    * @param source Filter by any part of the origin label or origin url fields (optional)
    * @param unit Filter by the unit that the usage is measured in (e.g. Bytes, Credits, Any). Default is Bytes. (optional)
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getUsageWithHeadersAndHttpInfo(String startTime, String endTime, List type, String source, String unit, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        if (startTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'startTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "startTime", startTime));

        if (endTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'endTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "endTime", endTime));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "type", type));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "source", source));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "unit", unit));

        localVarHeaderParams.putAll(customHeaders);
        return getUsageInternal(localVarQueryParams, localVarHeaderParams);
    }


    /**
    * Get usage records for the specified time range. Results will be sorted by date if aggregating by day or month, otherwise by amount descending and limited to the first 500 records
    *
    * @param startTime Start time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param endTime End time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param type Filter by type of usage (e.g. Analysis, Screenshot) (optional)
    * @param source Filter by any part of the origin label or origin url fields (optional)
    * @return UsageOutputListV1
    * @throws ApiException if fails to make API call
    */
    public UsageOutputListV1 getUsage(String startTime, String endTime, List type, String source) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        if (startTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'startTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "startTime", startTime));

        if (endTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'endTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "endTime", endTime));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "type", type));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "source", source));

        ApiClient.ApiResponse localVarResponse = getUsageInternal(localVarQueryParams, localVarHeaderParams);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }

    /**
    * Get usage records for the specified time range. Results will be sorted by date if aggregating by day or month, otherwise by amount descending and limited to the first 500 records
    * @param startTime Start time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param endTime End time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param type Filter by type of usage (e.g. Analysis, Screenshot) (optional)
    * @param source Filter by any part of the origin label or origin url fields (optional)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getUsageWithHttpInfo(String startTime, String endTime, List type, String source) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        if (startTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'startTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "startTime", startTime));

        if (endTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'endTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "endTime", endTime));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "type", type));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "source", source));

        return getUsageInternal(localVarQueryParams, localVarHeaderParams);
    }

    /**
    * Get usage records for the specified time range. Results will be sorted by date if aggregating by day or month, otherwise by amount descending and limited to the first 500 records
    *
    * @param startTime Start time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param endTime End time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param type Filter by type of usage (e.g. Analysis, Screenshot) (optional)
    * @param source Filter by any part of the origin label or origin url fields (optional)
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getUsageWithHeadersAndHttpInfo(String startTime, String endTime, List type, String source, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        if (startTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'startTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "startTime", startTime));

        if (endTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'endTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "endTime", endTime));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "type", type));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "source", source));

        localVarHeaderParams.putAll(customHeaders);
        return getUsageInternal(localVarQueryParams, localVarHeaderParams);
    }


    /**
    * Get usage records for the specified time range. Results will be sorted by date if aggregating by day or month, otherwise by amount descending and limited to the first 500 records
    *
    * @param startTime Start time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param endTime End time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param type Filter by type of usage (e.g. Analysis, Screenshot) (optional)
    * @return UsageOutputListV1
    * @throws ApiException if fails to make API call
    */
    public UsageOutputListV1 getUsage(String startTime, String endTime, List type) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        if (startTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'startTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "startTime", startTime));

        if (endTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'endTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "endTime", endTime));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "type", type));

        ApiClient.ApiResponse localVarResponse = getUsageInternal(localVarQueryParams, localVarHeaderParams);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }

    /**
    * Get usage records for the specified time range. Results will be sorted by date if aggregating by day or month, otherwise by amount descending and limited to the first 500 records
    * @param startTime Start time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param endTime End time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param type Filter by type of usage (e.g. Analysis, Screenshot) (optional)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getUsageWithHttpInfo(String startTime, String endTime, List type) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        if (startTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'startTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "startTime", startTime));

        if (endTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'endTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "endTime", endTime));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "type", type));

        return getUsageInternal(localVarQueryParams, localVarHeaderParams);
    }

    /**
    * Get usage records for the specified time range. Results will be sorted by date if aggregating by day or month, otherwise by amount descending and limited to the first 500 records
    *
    * @param startTime Start time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param endTime End time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param type Filter by type of usage (e.g. Analysis, Screenshot) (optional)
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getUsageWithHeadersAndHttpInfo(String startTime, String endTime, List type, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        if (startTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'startTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "startTime", startTime));

        if (endTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'endTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "endTime", endTime));

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "type", type));

        localVarHeaderParams.putAll(customHeaders);
        return getUsageInternal(localVarQueryParams, localVarHeaderParams);
    }


    /**
    * Get usage records for the specified time range. Results will be sorted by date if aggregating by day or month, otherwise by amount descending and limited to the first 500 records
    *
    * @param startTime Start time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param endTime End time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @return UsageOutputListV1
    * @throws ApiException if fails to make API call
    */
    public UsageOutputListV1 getUsage(String startTime, String endTime) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        if (startTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'startTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "startTime", startTime));

        if (endTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'endTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "endTime", endTime));

        ApiClient.ApiResponse localVarResponse = getUsageInternal(localVarQueryParams, localVarHeaderParams);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }

    /**
    * Get usage records for the specified time range. Results will be sorted by date if aggregating by day or month, otherwise by amount descending and limited to the first 500 records
    * @param startTime Start time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param endTime End time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getUsageWithHttpInfo(String startTime, String endTime) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        if (startTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'startTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "startTime", startTime));

        if (endTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'endTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "endTime", endTime));

        return getUsageInternal(localVarQueryParams, localVarHeaderParams);
    }

    /**
    * Get usage records for the specified time range. Results will be sorted by date if aggregating by day or month, otherwise by amount descending and limited to the first 500 records
    *
    * @param startTime Start time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param endTime End time for the time frame (YYYY-MM-DDThh:mm:ss±hh:mm) (required)
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getUsageWithHeadersAndHttpInfo(String startTime, String endTime, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        if (startTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'startTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "startTime", startTime));

        if (endTime == null) {
            throw new ApiException(400, "Missing the required query parameter 'endTime' when calling getUsage");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "endTime", endTime));

        localVarHeaderParams.putAll(customHeaders);
        return getUsageInternal(localVarQueryParams, localVarHeaderParams);
    }

// OVERLOADS END
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy