Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* 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.GetEventsVolumeFromWorkspace200Response;
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 EventsApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public EventsApi() {
this(Configuration.getDefaultApiClient());
}
public EventsApi(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 getEventsVolumeFromWorkspace
* @param granularity The size of each bucket in the requested window. This parameter exists in alpha. (required)
* @param startTime The ISO8601 formatted timestamp that corresponds to the beginning of the requested time frame, inclusive. This parameter exists in alpha. (required)
* @param endTime The ISO8601 formatted timestamp that corresponds to the end of the requested time frame, noninclusive. Segment recommends that you lag queries 1 minute behind clock time to reduce the risk for latency to impact the counts. This parameter exists in alpha. (required)
* @param groupBy A comma-delimited list of strings that represents the dimensions to group the result by. The options are: `eventName`, `eventType` and `source`. This parameter exists in alpha. (optional)
* @param sourceId A list of strings which filters the results to the given SourceIds. This parameter exists in alpha. (optional)
* @param eventName A list of strings which filters the results to the given EventNames. This parameter exists in alpha. (optional)
* @param eventType A list of strings which filters the results to the given EventTypes. This parameter exists in alpha. (optional)
* @param appVersion A list of strings which filters the results to the given AppVersions. This parameter exists in alpha. (optional)
* @param pagination Pagination input for event volume by Workspace. This parameter exists in alpha. (optional)
* @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 getEventsVolumeFromWorkspaceCall(String granularity, String startTime, String endTime, List groupBy, List sourceId, List eventName, List eventType, List appVersion, 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 = "/events/volume";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (granularity != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("granularity", granularity));
}
if (startTime != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime));
}
if (endTime != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime));
}
if (groupBy != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "groupBy", groupBy));
}
if (sourceId != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "sourceId", sourceId));
}
if (eventName != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "eventName", eventName));
}
if (eventType != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "eventType", eventType));
}
if (appVersion != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "appVersion", appVersion));
}
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 getEventsVolumeFromWorkspaceValidateBeforeCall(String granularity, String startTime, String endTime, List groupBy, List sourceId, List eventName, List eventType, List appVersion, PaginationInput pagination, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'granularity' is set
if (granularity == null) {
throw new ApiException("Missing the required parameter 'granularity' when calling getEventsVolumeFromWorkspace(Async)");
}
// verify the required parameter 'startTime' is set
if (startTime == null) {
throw new ApiException("Missing the required parameter 'startTime' when calling getEventsVolumeFromWorkspace(Async)");
}
// verify the required parameter 'endTime' is set
if (endTime == null) {
throw new ApiException("Missing the required parameter 'endTime' when calling getEventsVolumeFromWorkspace(Async)");
}
okhttp3.Call localVarCall = getEventsVolumeFromWorkspaceCall(granularity, startTime, endTime, groupBy, sourceId, eventName, eventType, appVersion, pagination, _callback);
return localVarCall;
}
/**
* Get Events Volume from Workspace
* Enumerates the Workspace event volumes over time in minute increments. The rate limit for this endpoint is 20 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
* @param granularity The size of each bucket in the requested window. This parameter exists in alpha. (required)
* @param startTime The ISO8601 formatted timestamp that corresponds to the beginning of the requested time frame, inclusive. This parameter exists in alpha. (required)
* @param endTime The ISO8601 formatted timestamp that corresponds to the end of the requested time frame, noninclusive. Segment recommends that you lag queries 1 minute behind clock time to reduce the risk for latency to impact the counts. This parameter exists in alpha. (required)
* @param groupBy A comma-delimited list of strings that represents the dimensions to group the result by. The options are: `eventName`, `eventType` and `source`. This parameter exists in alpha. (optional)
* @param sourceId A list of strings which filters the results to the given SourceIds. This parameter exists in alpha. (optional)
* @param eventName A list of strings which filters the results to the given EventNames. This parameter exists in alpha. (optional)
* @param eventType A list of strings which filters the results to the given EventTypes. This parameter exists in alpha. (optional)
* @param appVersion A list of strings which filters the results to the given AppVersions. This parameter exists in alpha. (optional)
* @param pagination Pagination input for event volume by Workspace. This parameter exists in alpha. (optional)
* @return GetEventsVolumeFromWorkspace200Response
* @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 GetEventsVolumeFromWorkspace200Response getEventsVolumeFromWorkspace(String granularity, String startTime, String endTime, List groupBy, List sourceId, List eventName, List eventType, List appVersion, PaginationInput pagination) throws ApiException {
ApiResponse localVarResp = getEventsVolumeFromWorkspaceWithHttpInfo(granularity, startTime, endTime, groupBy, sourceId, eventName, eventType, appVersion, pagination);
return localVarResp.getData();
}
/**
* Get Events Volume from Workspace
* Enumerates the Workspace event volumes over time in minute increments. The rate limit for this endpoint is 20 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
* @param granularity The size of each bucket in the requested window. This parameter exists in alpha. (required)
* @param startTime The ISO8601 formatted timestamp that corresponds to the beginning of the requested time frame, inclusive. This parameter exists in alpha. (required)
* @param endTime The ISO8601 formatted timestamp that corresponds to the end of the requested time frame, noninclusive. Segment recommends that you lag queries 1 minute behind clock time to reduce the risk for latency to impact the counts. This parameter exists in alpha. (required)
* @param groupBy A comma-delimited list of strings that represents the dimensions to group the result by. The options are: `eventName`, `eventType` and `source`. This parameter exists in alpha. (optional)
* @param sourceId A list of strings which filters the results to the given SourceIds. This parameter exists in alpha. (optional)
* @param eventName A list of strings which filters the results to the given EventNames. This parameter exists in alpha. (optional)
* @param eventType A list of strings which filters the results to the given EventTypes. This parameter exists in alpha. (optional)
* @param appVersion A list of strings which filters the results to the given AppVersions. This parameter exists in alpha. (optional)
* @param pagination Pagination input for event volume by Workspace. This parameter exists in alpha. (optional)
* @return ApiResponse<GetEventsVolumeFromWorkspace200Response>
* @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 getEventsVolumeFromWorkspaceWithHttpInfo(String granularity, String startTime, String endTime, List groupBy, List sourceId, List eventName, List eventType, List appVersion, PaginationInput pagination) throws ApiException {
okhttp3.Call localVarCall = getEventsVolumeFromWorkspaceValidateBeforeCall(granularity, startTime, endTime, groupBy, sourceId, eventName, eventType, appVersion, pagination, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get Events Volume from Workspace (asynchronously)
* Enumerates the Workspace event volumes over time in minute increments. The rate limit for this endpoint is 20 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
* @param granularity The size of each bucket in the requested window. This parameter exists in alpha. (required)
* @param startTime The ISO8601 formatted timestamp that corresponds to the beginning of the requested time frame, inclusive. This parameter exists in alpha. (required)
* @param endTime The ISO8601 formatted timestamp that corresponds to the end of the requested time frame, noninclusive. Segment recommends that you lag queries 1 minute behind clock time to reduce the risk for latency to impact the counts. This parameter exists in alpha. (required)
* @param groupBy A comma-delimited list of strings that represents the dimensions to group the result by. The options are: `eventName`, `eventType` and `source`. This parameter exists in alpha. (optional)
* @param sourceId A list of strings which filters the results to the given SourceIds. This parameter exists in alpha. (optional)
* @param eventName A list of strings which filters the results to the given EventNames. This parameter exists in alpha. (optional)
* @param eventType A list of strings which filters the results to the given EventTypes. This parameter exists in alpha. (optional)
* @param appVersion A list of strings which filters the results to the given AppVersions. This parameter exists in alpha. (optional)
* @param pagination Pagination input for event volume by Workspace. This parameter exists in alpha. (optional)
* @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 getEventsVolumeFromWorkspaceAsync(String granularity, String startTime, String endTime, List groupBy, List sourceId, List eventName, List eventType, List appVersion, PaginationInput pagination, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getEventsVolumeFromWorkspaceValidateBeforeCall(granularity, startTime, endTime, groupBy, sourceId, eventName, eventType, appVersion, pagination, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}