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.BatchQueryMessagingSubscriptionsForSpace200Response;
import com.segment.publicapi.models.BatchQueryMessagingSubscriptionsForSpaceAlphaInput;
import com.segment.publicapi.models.GetSpace200Response;
import com.segment.publicapi.models.ReplaceMessagingSubscriptionsInSpaces200Response;
import com.segment.publicapi.models.ReplaceMessagingSubscriptionsInSpacesAlphaInput;
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 SpacesApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public SpacesApi() {
this(Configuration.getDefaultApiClient());
}
public SpacesApi(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 batchQueryMessagingSubscriptionsForSpace
* @param spaceId (required)
* @param batchQueryMessagingSubscriptionsForSpaceAlphaInput (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 batchQueryMessagingSubscriptionsForSpaceCall(String spaceId, BatchQueryMessagingSubscriptionsForSpaceAlphaInput batchQueryMessagingSubscriptionsForSpaceAlphaInput, 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 = batchQueryMessagingSubscriptionsForSpaceAlphaInput;
// create path and map variables
String localVarPath = "/spaces/{spaceId}/messaging-subscriptions/batch"
.replaceAll("\\{" + "spaceId" + "\\}", localVarApiClient.escapeString(spaceId.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 batchQueryMessagingSubscriptionsForSpaceValidateBeforeCall(String spaceId, BatchQueryMessagingSubscriptionsForSpaceAlphaInput batchQueryMessagingSubscriptionsForSpaceAlphaInput, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'spaceId' is set
if (spaceId == null) {
throw new ApiException("Missing the required parameter 'spaceId' when calling batchQueryMessagingSubscriptionsForSpace(Async)");
}
// verify the required parameter 'batchQueryMessagingSubscriptionsForSpaceAlphaInput' is set
if (batchQueryMessagingSubscriptionsForSpaceAlphaInput == null) {
throw new ApiException("Missing the required parameter 'batchQueryMessagingSubscriptionsForSpaceAlphaInput' when calling batchQueryMessagingSubscriptionsForSpace(Async)");
}
okhttp3.Call localVarCall = batchQueryMessagingSubscriptionsForSpaceCall(spaceId, batchQueryMessagingSubscriptionsForSpaceAlphaInput, _callback);
return localVarCall;
}
/**
* Batch Query Messaging Subscriptions for Space
* Get Messaging Subscriptions for space.
* @param spaceId (required)
* @param batchQueryMessagingSubscriptionsForSpaceAlphaInput (required)
* @return BatchQueryMessagingSubscriptionsForSpace200Response
* @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 BatchQueryMessagingSubscriptionsForSpace200Response batchQueryMessagingSubscriptionsForSpace(String spaceId, BatchQueryMessagingSubscriptionsForSpaceAlphaInput batchQueryMessagingSubscriptionsForSpaceAlphaInput) throws ApiException {
ApiResponse localVarResp = batchQueryMessagingSubscriptionsForSpaceWithHttpInfo(spaceId, batchQueryMessagingSubscriptionsForSpaceAlphaInput);
return localVarResp.getData();
}
/**
* Batch Query Messaging Subscriptions for Space
* Get Messaging Subscriptions for space.
* @param spaceId (required)
* @param batchQueryMessagingSubscriptionsForSpaceAlphaInput (required)
* @return ApiResponse<BatchQueryMessagingSubscriptionsForSpace200Response>
* @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 batchQueryMessagingSubscriptionsForSpaceWithHttpInfo(String spaceId, BatchQueryMessagingSubscriptionsForSpaceAlphaInput batchQueryMessagingSubscriptionsForSpaceAlphaInput) throws ApiException {
okhttp3.Call localVarCall = batchQueryMessagingSubscriptionsForSpaceValidateBeforeCall(spaceId, batchQueryMessagingSubscriptionsForSpaceAlphaInput, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Batch Query Messaging Subscriptions for Space (asynchronously)
* Get Messaging Subscriptions for space.
* @param spaceId (required)
* @param batchQueryMessagingSubscriptionsForSpaceAlphaInput (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 batchQueryMessagingSubscriptionsForSpaceAsync(String spaceId, BatchQueryMessagingSubscriptionsForSpaceAlphaInput batchQueryMessagingSubscriptionsForSpaceAlphaInput, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = batchQueryMessagingSubscriptionsForSpaceValidateBeforeCall(spaceId, batchQueryMessagingSubscriptionsForSpaceAlphaInput, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getSpace
* @param spaceId (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 getSpaceCall(String spaceId, 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 = "/spaces/{spaceId}"
.replaceAll("\\{" + "spaceId" + "\\}", localVarApiClient.escapeString(spaceId.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 getSpaceValidateBeforeCall(String spaceId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'spaceId' is set
if (spaceId == null) {
throw new ApiException("Missing the required parameter 'spaceId' when calling getSpace(Async)");
}
okhttp3.Call localVarCall = getSpaceCall(spaceId, _callback);
return localVarCall;
}
/**
* Get Space
* Returns the Space by id.
* @param spaceId (required)
* @return GetSpace200Response
* @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 GetSpace200Response getSpace(String spaceId) throws ApiException {
ApiResponse localVarResp = getSpaceWithHttpInfo(spaceId);
return localVarResp.getData();
}
/**
* Get Space
* Returns the Space by id.
* @param spaceId (required)
* @return ApiResponse<GetSpace200Response>
* @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 getSpaceWithHttpInfo(String spaceId) throws ApiException {
okhttp3.Call localVarCall = getSpaceValidateBeforeCall(spaceId, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get Space (asynchronously)
* Returns the Space by id.
* @param spaceId (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 getSpaceAsync(String spaceId, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getSpaceValidateBeforeCall(spaceId, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for replaceMessagingSubscriptionsInSpaces
* @param spaceId (required)
* @param replaceMessagingSubscriptionsInSpacesAlphaInput (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 replaceMessagingSubscriptionsInSpacesCall(String spaceId, ReplaceMessagingSubscriptionsInSpacesAlphaInput replaceMessagingSubscriptionsInSpacesAlphaInput, 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 = replaceMessagingSubscriptionsInSpacesAlphaInput;
// create path and map variables
String localVarPath = "/spaces/{spaceId}/messaging-subscriptions"
.replaceAll("\\{" + "spaceId" + "\\}", localVarApiClient.escapeString(spaceId.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, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call replaceMessagingSubscriptionsInSpacesValidateBeforeCall(String spaceId, ReplaceMessagingSubscriptionsInSpacesAlphaInput replaceMessagingSubscriptionsInSpacesAlphaInput, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'spaceId' is set
if (spaceId == null) {
throw new ApiException("Missing the required parameter 'spaceId' when calling replaceMessagingSubscriptionsInSpaces(Async)");
}
// verify the required parameter 'replaceMessagingSubscriptionsInSpacesAlphaInput' is set
if (replaceMessagingSubscriptionsInSpacesAlphaInput == null) {
throw new ApiException("Missing the required parameter 'replaceMessagingSubscriptionsInSpacesAlphaInput' when calling replaceMessagingSubscriptionsInSpaces(Async)");
}
okhttp3.Call localVarCall = replaceMessagingSubscriptionsInSpacesCall(spaceId, replaceMessagingSubscriptionsInSpacesAlphaInput, _callback);
return localVarCall;
}
/**
* Replace Messaging Subscriptions in Spaces
* Replace Messaging Subscriptions in Spaces. The rate limit for this endpoint is 60 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 spaceId (required)
* @param replaceMessagingSubscriptionsInSpacesAlphaInput (required)
* @return ReplaceMessagingSubscriptionsInSpaces200Response
* @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 ReplaceMessagingSubscriptionsInSpaces200Response replaceMessagingSubscriptionsInSpaces(String spaceId, ReplaceMessagingSubscriptionsInSpacesAlphaInput replaceMessagingSubscriptionsInSpacesAlphaInput) throws ApiException {
ApiResponse localVarResp = replaceMessagingSubscriptionsInSpacesWithHttpInfo(spaceId, replaceMessagingSubscriptionsInSpacesAlphaInput);
return localVarResp.getData();
}
/**
* Replace Messaging Subscriptions in Spaces
* Replace Messaging Subscriptions in Spaces. The rate limit for this endpoint is 60 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 spaceId (required)
* @param replaceMessagingSubscriptionsInSpacesAlphaInput (required)
* @return ApiResponse<ReplaceMessagingSubscriptionsInSpaces200Response>
* @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 replaceMessagingSubscriptionsInSpacesWithHttpInfo(String spaceId, ReplaceMessagingSubscriptionsInSpacesAlphaInput replaceMessagingSubscriptionsInSpacesAlphaInput) throws ApiException {
okhttp3.Call localVarCall = replaceMessagingSubscriptionsInSpacesValidateBeforeCall(spaceId, replaceMessagingSubscriptionsInSpacesAlphaInput, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Replace Messaging Subscriptions in Spaces (asynchronously)
* Replace Messaging Subscriptions in Spaces. The rate limit for this endpoint is 60 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 spaceId (required)
* @param replaceMessagingSubscriptionsInSpacesAlphaInput (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 replaceMessagingSubscriptionsInSpacesAsync(String spaceId, ReplaceMessagingSubscriptionsInSpacesAlphaInput replaceMessagingSubscriptionsInSpacesAlphaInput, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = replaceMessagingSubscriptionsInSpacesValidateBeforeCall(spaceId, replaceMessagingSubscriptionsInSpacesAlphaInput, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}