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.CreateEdgeFunctions200Response;
import com.segment.publicapi.models.CreateEdgeFunctionsAlphaInput;
import com.segment.publicapi.models.DisableEdgeFunctions200Response;
import com.segment.publicapi.models.GenerateUploadURLForEdgeFunctions200Response;
import com.segment.publicapi.models.GetLatestFromEdgeFunctions200Response;
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 EdgeFunctionsApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public EdgeFunctionsApi() {
this(Configuration.getDefaultApiClient());
}
public EdgeFunctionsApi(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 createEdgeFunctions
* @param sourceId (required)
* @param createEdgeFunctionsAlphaInput (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 createEdgeFunctionsCall(String sourceId, CreateEdgeFunctionsAlphaInput createEdgeFunctionsAlphaInput, 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 = createEdgeFunctionsAlphaInput;
// create path and map variables
String localVarPath = "/sources/{sourceId}/edge-functions"
.replaceAll("\\{" + "sourceId" + "\\}", localVarApiClient.escapeString(sourceId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/vnd.segment.v1alpha+json", "application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/vnd.segment.v1alpha+json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "token" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createEdgeFunctionsValidateBeforeCall(String sourceId, CreateEdgeFunctionsAlphaInput createEdgeFunctionsAlphaInput, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'sourceId' is set
if (sourceId == null) {
throw new ApiException("Missing the required parameter 'sourceId' when calling createEdgeFunctions(Async)");
}
// verify the required parameter 'createEdgeFunctionsAlphaInput' is set
if (createEdgeFunctionsAlphaInput == null) {
throw new ApiException("Missing the required parameter 'createEdgeFunctionsAlphaInput' when calling createEdgeFunctions(Async)");
}
okhttp3.Call localVarCall = createEdgeFunctionsCall(sourceId, createEdgeFunctionsAlphaInput, _callback);
return localVarCall;
}
/**
* Create Edge Functions
* Create EdgeFunctions for your Source, given a valid upload URL for an Edge Functions bundle. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Edge Functions feature enabled. Please reach out to your customer success manager for more information.
* @param sourceId (required)
* @param createEdgeFunctionsAlphaInput (required)
* @return CreateEdgeFunctions200Response
* @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 CreateEdgeFunctions200Response createEdgeFunctions(String sourceId, CreateEdgeFunctionsAlphaInput createEdgeFunctionsAlphaInput) throws ApiException {
ApiResponse localVarResp = createEdgeFunctionsWithHttpInfo(sourceId, createEdgeFunctionsAlphaInput);
return localVarResp.getData();
}
/**
* Create Edge Functions
* Create EdgeFunctions for your Source, given a valid upload URL for an Edge Functions bundle. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Edge Functions feature enabled. Please reach out to your customer success manager for more information.
* @param sourceId (required)
* @param createEdgeFunctionsAlphaInput (required)
* @return ApiResponse<CreateEdgeFunctions200Response>
* @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 createEdgeFunctionsWithHttpInfo(String sourceId, CreateEdgeFunctionsAlphaInput createEdgeFunctionsAlphaInput) throws ApiException {
okhttp3.Call localVarCall = createEdgeFunctionsValidateBeforeCall(sourceId, createEdgeFunctionsAlphaInput, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Create Edge Functions (asynchronously)
* Create EdgeFunctions for your Source, given a valid upload URL for an Edge Functions bundle. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Edge Functions feature enabled. Please reach out to your customer success manager for more information.
* @param sourceId (required)
* @param createEdgeFunctionsAlphaInput (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 createEdgeFunctionsAsync(String sourceId, CreateEdgeFunctionsAlphaInput createEdgeFunctionsAlphaInput, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = createEdgeFunctionsValidateBeforeCall(sourceId, createEdgeFunctionsAlphaInput, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for disableEdgeFunctions
* @param sourceId (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 disableEdgeFunctionsCall(String sourceId, 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 = "/sources/{sourceId}/edge-functions/disable"
.replaceAll("\\{" + "sourceId" + "\\}", localVarApiClient.escapeString(sourceId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/vnd.segment.v1alpha+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, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call disableEdgeFunctionsValidateBeforeCall(String sourceId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'sourceId' is set
if (sourceId == null) {
throw new ApiException("Missing the required parameter 'sourceId' when calling disableEdgeFunctions(Async)");
}
okhttp3.Call localVarCall = disableEdgeFunctionsCall(sourceId, _callback);
return localVarCall;
}
/**
* Disable Edge Functions
* Disable Edge Functions for your Source. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Edge Functions feature enabled. Please reach out to your customer success manager for more information.
* @param sourceId (required)
* @return DisableEdgeFunctions200Response
* @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 DisableEdgeFunctions200Response disableEdgeFunctions(String sourceId) throws ApiException {
ApiResponse localVarResp = disableEdgeFunctionsWithHttpInfo(sourceId);
return localVarResp.getData();
}
/**
* Disable Edge Functions
* Disable Edge Functions for your Source. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Edge Functions feature enabled. Please reach out to your customer success manager for more information.
* @param sourceId (required)
* @return ApiResponse<DisableEdgeFunctions200Response>
* @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 disableEdgeFunctionsWithHttpInfo(String sourceId) throws ApiException {
okhttp3.Call localVarCall = disableEdgeFunctionsValidateBeforeCall(sourceId, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Disable Edge Functions (asynchronously)
* Disable Edge Functions for your Source. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Edge Functions feature enabled. Please reach out to your customer success manager for more information.
* @param sourceId (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 disableEdgeFunctionsAsync(String sourceId, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = disableEdgeFunctionsValidateBeforeCall(sourceId, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for generateUploadURLForEdgeFunctions
* @param sourceId (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 generateUploadURLForEdgeFunctionsCall(String sourceId, 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 = "/sources/{sourceId}/edge-functions/upload-url"
.replaceAll("\\{" + "sourceId" + "\\}", localVarApiClient.escapeString(sourceId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/vnd.segment.v1alpha+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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call generateUploadURLForEdgeFunctionsValidateBeforeCall(String sourceId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'sourceId' is set
if (sourceId == null) {
throw new ApiException("Missing the required parameter 'sourceId' when calling generateUploadURLForEdgeFunctions(Async)");
}
okhttp3.Call localVarCall = generateUploadURLForEdgeFunctionsCall(sourceId, _callback);
return localVarCall;
}
/**
* Generate Upload URL for Edge Functions
* Generate a temporary upload URL, that can be used to upload an Edge Functions bundle. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Edge Functions feature enabled. Please reach out to your customer success manager for more information.
* @param sourceId (required)
* @return GenerateUploadURLForEdgeFunctions200Response
* @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 GenerateUploadURLForEdgeFunctions200Response generateUploadURLForEdgeFunctions(String sourceId) throws ApiException {
ApiResponse localVarResp = generateUploadURLForEdgeFunctionsWithHttpInfo(sourceId);
return localVarResp.getData();
}
/**
* Generate Upload URL for Edge Functions
* Generate a temporary upload URL, that can be used to upload an Edge Functions bundle. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Edge Functions feature enabled. Please reach out to your customer success manager for more information.
* @param sourceId (required)
* @return ApiResponse<GenerateUploadURLForEdgeFunctions200Response>
* @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 generateUploadURLForEdgeFunctionsWithHttpInfo(String sourceId) throws ApiException {
okhttp3.Call localVarCall = generateUploadURLForEdgeFunctionsValidateBeforeCall(sourceId, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Generate Upload URL for Edge Functions (asynchronously)
* Generate a temporary upload URL, that can be used to upload an Edge Functions bundle. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Edge Functions feature enabled. Please reach out to your customer success manager for more information.
* @param sourceId (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 generateUploadURLForEdgeFunctionsAsync(String sourceId, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = generateUploadURLForEdgeFunctionsValidateBeforeCall(sourceId, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getLatestFromEdgeFunctions
* @param sourceId (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 getLatestFromEdgeFunctionsCall(String sourceId, 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 = "/sources/{sourceId}/edge-functions/latest"
.replaceAll("\\{" + "sourceId" + "\\}", localVarApiClient.escapeString(sourceId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/vnd.segment.v1alpha+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 getLatestFromEdgeFunctionsValidateBeforeCall(String sourceId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'sourceId' is set
if (sourceId == null) {
throw new ApiException("Missing the required parameter 'sourceId' when calling getLatestFromEdgeFunctions(Async)");
}
okhttp3.Call localVarCall = getLatestFromEdgeFunctionsCall(sourceId, _callback);
return localVarCall;
}
/**
* Get Latest from Edge Functions
* Get the latest Edge Functions for your Source. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Edge Functions feature enabled. Please reach out to your customer success manager for more information.
* @param sourceId (required)
* @return GetLatestFromEdgeFunctions200Response
* @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 GetLatestFromEdgeFunctions200Response getLatestFromEdgeFunctions(String sourceId) throws ApiException {
ApiResponse localVarResp = getLatestFromEdgeFunctionsWithHttpInfo(sourceId);
return localVarResp.getData();
}
/**
* Get Latest from Edge Functions
* Get the latest Edge Functions for your Source. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Edge Functions feature enabled. Please reach out to your customer success manager for more information.
* @param sourceId (required)
* @return ApiResponse<GetLatestFromEdgeFunctions200Response>
* @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 getLatestFromEdgeFunctionsWithHttpInfo(String sourceId) throws ApiException {
okhttp3.Call localVarCall = getLatestFromEdgeFunctionsValidateBeforeCall(sourceId, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get Latest from Edge Functions (asynchronously)
* Get the latest Edge Functions for your Source. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Edge Functions feature enabled. Please reach out to your customer success manager for more information.
* @param sourceId (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 getLatestFromEdgeFunctionsAsync(String sourceId, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getLatestFromEdgeFunctionsValidateBeforeCall(sourceId, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}