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

com.segment.publicapi.api.ApiCallsApi Maven / Gradle / Ivy

There is a newer version: 58.0.0
Show newest version
/*
 * Segment Public API
 * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs.  All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace.  See the next sections for more information on how to use the Segment Public API. 
 *
 * The version of the OpenAPI document: 32.0.3
 * 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.segment.publicapi.api;

import com.segment.publicapi.ApiCallback;
import com.segment.publicapi.ApiClient;
import com.segment.publicapi.ApiException;
import com.segment.publicapi.ApiResponse;
import com.segment.publicapi.Configuration;
import com.segment.publicapi.Pair;
import com.segment.publicapi.ProgressRequestBody;
import com.segment.publicapi.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import com.segment.publicapi.models.GetDailyPerSourceAPICallsUsage200Response;
import com.segment.publicapi.models.GetDailyWorkspaceAPICallsUsage200Response;
import com.segment.publicapi.models.PaginationInput;
import com.segment.publicapi.models.RequestErrorEnvelope;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;

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

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

    public ApiCallsApi(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;
    }

    /**
     * Build call for getDailyPerSourceAPICallsUsage
     * @param period The start of the usage month in the ISO-8601 format.  This parameter exists in alpha. (required)
     * @param pagination Pagination input for per Source API calls counts.  This parameter exists in alpha. (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public okhttp3.Call getDailyPerSourceAPICallsUsageCall(String period, PaginationInput pagination, 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 = "/usage/api-calls/sources/daily"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (period != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("period", period)); } if (pagination != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); } final String[] localVarAccepts = { "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "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[] { "token" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getDailyPerSourceAPICallsUsageValidateBeforeCall(String period, PaginationInput pagination, final ApiCallback _callback) throws ApiException { // verify the required parameter 'period' is set if (period == null) { throw new ApiException("Missing the required parameter 'period' when calling getDailyPerSourceAPICallsUsage(Async)"); } // verify the required parameter 'pagination' is set if (pagination == null) { throw new ApiException("Missing the required parameter 'pagination' when calling getDailyPerSourceAPICallsUsage(Async)"); } okhttp3.Call localVarCall = getDailyPerSourceAPICallsUsageCall(period, pagination, _callback); return localVarCall; } /** * Get Daily Per Source API Calls Usage * Provides daily cumulative per-source API call counts for a usage period. * @param period The start of the usage month in the ISO-8601 format. This parameter exists in alpha. (required) * @param pagination Pagination input for per Source API calls counts. This parameter exists in alpha. (required) * @return GetDailyPerSourceAPICallsUsage200Response * @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 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public GetDailyPerSourceAPICallsUsage200Response getDailyPerSourceAPICallsUsage(String period, PaginationInput pagination) throws ApiException { ApiResponse localVarResp = getDailyPerSourceAPICallsUsageWithHttpInfo(period, pagination); return localVarResp.getData(); } /** * Get Daily Per Source API Calls Usage * Provides daily cumulative per-source API call counts for a usage period. * @param period The start of the usage month in the ISO-8601 format. This parameter exists in alpha. (required) * @param pagination Pagination input for per Source API calls counts. This parameter exists in alpha. (required) * @return ApiResponse<GetDailyPerSourceAPICallsUsage200Response> * @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 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public ApiResponse getDailyPerSourceAPICallsUsageWithHttpInfo(String period, PaginationInput pagination) throws ApiException { okhttp3.Call localVarCall = getDailyPerSourceAPICallsUsageValidateBeforeCall(period, pagination, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get Daily Per Source API Calls Usage (asynchronously) * Provides daily cumulative per-source API call counts for a usage period. * @param period The start of the usage month in the ISO-8601 format. This parameter exists in alpha. (required) * @param pagination Pagination input for per Source API calls counts. This parameter exists in alpha. (required) * @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 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public okhttp3.Call getDailyPerSourceAPICallsUsageAsync(String period, PaginationInput pagination, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getDailyPerSourceAPICallsUsageValidateBeforeCall(period, pagination, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getDailyWorkspaceAPICallsUsage * @param period The start of the usage month in the ISO-8601 format. This parameter exists in alpha. (required) * @param pagination Pagination input for Workspace API call counts. This parameter exists in alpha. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public okhttp3.Call getDailyWorkspaceAPICallsUsageCall(String period, PaginationInput pagination, 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 = "/usage/api-calls/daily"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (period != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("period", period)); } if (pagination != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); } final String[] localVarAccepts = { "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "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[] { "token" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getDailyWorkspaceAPICallsUsageValidateBeforeCall(String period, PaginationInput pagination, final ApiCallback _callback) throws ApiException { // verify the required parameter 'period' is set if (period == null) { throw new ApiException("Missing the required parameter 'period' when calling getDailyWorkspaceAPICallsUsage(Async)"); } // verify the required parameter 'pagination' is set if (pagination == null) { throw new ApiException("Missing the required parameter 'pagination' when calling getDailyWorkspaceAPICallsUsage(Async)"); } okhttp3.Call localVarCall = getDailyWorkspaceAPICallsUsageCall(period, pagination, _callback); return localVarCall; } /** * Get Daily Workspace API Calls Usage * Provides daily cumulative API call counts for a usage period. * @param period The start of the usage month in the ISO-8601 format. This parameter exists in alpha. (required) * @param pagination Pagination input for Workspace API call counts. This parameter exists in alpha. (required) * @return GetDailyWorkspaceAPICallsUsage200Response * @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 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public GetDailyWorkspaceAPICallsUsage200Response getDailyWorkspaceAPICallsUsage(String period, PaginationInput pagination) throws ApiException { ApiResponse localVarResp = getDailyWorkspaceAPICallsUsageWithHttpInfo(period, pagination); return localVarResp.getData(); } /** * Get Daily Workspace API Calls Usage * Provides daily cumulative API call counts for a usage period. * @param period The start of the usage month in the ISO-8601 format. This parameter exists in alpha. (required) * @param pagination Pagination input for Workspace API call counts. This parameter exists in alpha. (required) * @return ApiResponse<GetDailyWorkspaceAPICallsUsage200Response> * @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 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public ApiResponse getDailyWorkspaceAPICallsUsageWithHttpInfo(String period, PaginationInput pagination) throws ApiException { okhttp3.Call localVarCall = getDailyWorkspaceAPICallsUsageValidateBeforeCall(period, pagination, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get Daily Workspace API Calls Usage (asynchronously) * Provides daily cumulative API call counts for a usage period. * @param period The start of the usage month in the ISO-8601 format. This parameter exists in alpha. (required) * @param pagination Pagination input for Workspace API call counts. This parameter exists in alpha. (required) * @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 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public okhttp3.Call getDailyWorkspaceAPICallsUsageAsync(String period, PaginationInput pagination, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getDailyWorkspaceAPICallsUsageValidateBeforeCall(period, pagination, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy