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

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

There is a newer version: 57.3.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.CreateDestination200Response;
import com.segment.publicapi.models.CreateDestinationSubscription200Response;
import com.segment.publicapi.models.CreateDestinationSubscriptionAlphaInput;
import com.segment.publicapi.models.CreateDestinationV1Input;
import com.segment.publicapi.models.DeleteDestination200Response;
import com.segment.publicapi.models.GetDestination200Response;
import com.segment.publicapi.models.GetSubscriptionFromDestination200Response;
import com.segment.publicapi.models.ListDeliveryMetricsSummaryFromDestination200Response;
import com.segment.publicapi.models.ListDestinations200Response;
import com.segment.publicapi.models.ListSubscriptionsFromDestination200Response;
import com.segment.publicapi.models.PaginationInput;
import com.segment.publicapi.models.RemoveSubscriptionFromDestination200Response;
import com.segment.publicapi.models.RequestErrorEnvelope;
import com.segment.publicapi.models.UpdateDestination200Response;
import com.segment.publicapi.models.UpdateDestinationV1Input;
import com.segment.publicapi.models.UpdateSubscriptionForDestination200Response;
import com.segment.publicapi.models.UpdateSubscriptionForDestinationAlphaInput;

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 DestinationsApi {
    private ApiClient localVarApiClient;
    private int localHostIndex;
    private String localCustomBaseUrl;

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

    public DestinationsApi(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 createDestination
     * @param createDestinationV1Input  (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 createDestinationCall(CreateDestinationV1Input createDestinationV1Input, 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 = createDestinationV1Input; // create path and map variables String localVarPath = "/destinations"; 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/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 = { "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+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 createDestinationValidateBeforeCall(CreateDestinationV1Input createDestinationV1Input, final ApiCallback _callback) throws ApiException { // verify the required parameter 'createDestinationV1Input' is set if (createDestinationV1Input == null) { throw new ApiException("Missing the required parameter 'createDestinationV1Input' when calling createDestination(Async)"); } okhttp3.Call localVarCall = createDestinationCall(createDestinationV1Input, _callback); return localVarCall; } /** * Create Destination * Creates a new Destination. When called, this endpoint may generate the `Integration Created` [Audit Trail](/tag/Audit-Trail) event. * @param createDestinationV1Input (required) * @return CreateDestination200Response * @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 CreateDestination200Response createDestination(CreateDestinationV1Input createDestinationV1Input) throws ApiException { ApiResponse localVarResp = createDestinationWithHttpInfo(createDestinationV1Input); return localVarResp.getData(); } /** * Create Destination * Creates a new Destination. When called, this endpoint may generate the `Integration Created` [Audit Trail](/tag/Audit-Trail) event. * @param createDestinationV1Input (required) * @return ApiResponse<CreateDestination200Response> * @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 createDestinationWithHttpInfo(CreateDestinationV1Input createDestinationV1Input) throws ApiException { okhttp3.Call localVarCall = createDestinationValidateBeforeCall(createDestinationV1Input, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Create Destination (asynchronously) * Creates a new Destination. When called, this endpoint may generate the `Integration Created` [Audit Trail](/tag/Audit-Trail) event. * @param createDestinationV1Input (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 createDestinationAsync(CreateDestinationV1Input createDestinationV1Input, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = createDestinationValidateBeforeCall(createDestinationV1Input, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for createDestinationSubscription * @param destinationId (required) * @param createDestinationSubscriptionAlphaInput (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 createDestinationSubscriptionCall(String destinationId, CreateDestinationSubscriptionAlphaInput createDestinationSubscriptionAlphaInput, 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 = createDestinationSubscriptionAlphaInput; // create path and map variables String localVarPath = "/destinations/{destinationId}/subscriptions" .replaceAll("\\{" + "destinationId" + "\\}", localVarApiClient.escapeString(destinationId.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 createDestinationSubscriptionValidateBeforeCall(String destinationId, CreateDestinationSubscriptionAlphaInput createDestinationSubscriptionAlphaInput, final ApiCallback _callback) throws ApiException { // verify the required parameter 'destinationId' is set if (destinationId == null) { throw new ApiException("Missing the required parameter 'destinationId' when calling createDestinationSubscription(Async)"); } // verify the required parameter 'createDestinationSubscriptionAlphaInput' is set if (createDestinationSubscriptionAlphaInput == null) { throw new ApiException("Missing the required parameter 'createDestinationSubscriptionAlphaInput' when calling createDestinationSubscription(Async)"); } okhttp3.Call localVarCall = createDestinationSubscriptionCall(destinationId, createDestinationSubscriptionAlphaInput, _callback); return localVarCall; } /** * Create Destination Subscription * Creates a new Destination subscription. * @param destinationId (required) * @param createDestinationSubscriptionAlphaInput (required) * @return CreateDestinationSubscription200Response * @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 CreateDestinationSubscription200Response createDestinationSubscription(String destinationId, CreateDestinationSubscriptionAlphaInput createDestinationSubscriptionAlphaInput) throws ApiException { ApiResponse localVarResp = createDestinationSubscriptionWithHttpInfo(destinationId, createDestinationSubscriptionAlphaInput); return localVarResp.getData(); } /** * Create Destination Subscription * Creates a new Destination subscription. * @param destinationId (required) * @param createDestinationSubscriptionAlphaInput (required) * @return ApiResponse<CreateDestinationSubscription200Response> * @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 createDestinationSubscriptionWithHttpInfo(String destinationId, CreateDestinationSubscriptionAlphaInput createDestinationSubscriptionAlphaInput) throws ApiException { okhttp3.Call localVarCall = createDestinationSubscriptionValidateBeforeCall(destinationId, createDestinationSubscriptionAlphaInput, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Create Destination Subscription (asynchronously) * Creates a new Destination subscription. * @param destinationId (required) * @param createDestinationSubscriptionAlphaInput (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 createDestinationSubscriptionAsync(String destinationId, CreateDestinationSubscriptionAlphaInput createDestinationSubscriptionAlphaInput, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = createDestinationSubscriptionValidateBeforeCall(destinationId, createDestinationSubscriptionAlphaInput, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for deleteDestination * @param destinationId (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 deleteDestinationCall(String destinationId, 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 = "/destinations/{destinationId}" .replaceAll("\\{" + "destinationId" + "\\}", localVarApiClient.escapeString(destinationId.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/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, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call deleteDestinationValidateBeforeCall(String destinationId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'destinationId' is set if (destinationId == null) { throw new ApiException("Missing the required parameter 'destinationId' when calling deleteDestination(Async)"); } okhttp3.Call localVarCall = deleteDestinationCall(destinationId, _callback); return localVarCall; } /** * Delete Destination * Deletes an existing Destination. When called, this endpoint may generate the `Integration Deleted` [Audit Trail](/tag/Audit-Trail) event. Config API omitted fields: - `catalogId` * @param destinationId (required) * @return DeleteDestination200Response * @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 DeleteDestination200Response deleteDestination(String destinationId) throws ApiException { ApiResponse localVarResp = deleteDestinationWithHttpInfo(destinationId); return localVarResp.getData(); } /** * Delete Destination * Deletes an existing Destination. When called, this endpoint may generate the `Integration Deleted` [Audit Trail](/tag/Audit-Trail) event. Config API omitted fields: - `catalogId` * @param destinationId (required) * @return ApiResponse<DeleteDestination200Response> * @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 deleteDestinationWithHttpInfo(String destinationId) throws ApiException { okhttp3.Call localVarCall = deleteDestinationValidateBeforeCall(destinationId, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Delete Destination (asynchronously) * Deletes an existing Destination. When called, this endpoint may generate the `Integration Deleted` [Audit Trail](/tag/Audit-Trail) event. Config API omitted fields: - `catalogId` * @param destinationId (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 deleteDestinationAsync(String destinationId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = deleteDestinationValidateBeforeCall(destinationId, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getDestination * @param destinationId (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 getDestinationCall(String destinationId, 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 = "/destinations/{destinationId}" .replaceAll("\\{" + "destinationId" + "\\}", localVarApiClient.escapeString(destinationId.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/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 getDestinationValidateBeforeCall(String destinationId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'destinationId' is set if (destinationId == null) { throw new ApiException("Missing the required parameter 'destinationId' when calling getDestination(Async)"); } okhttp3.Call localVarCall = getDestinationCall(destinationId, _callback); return localVarCall; } /** * Get Destination * Returns a Destination by its id. Config API omitted fields: - `catalogId` * @param destinationId (required) * @return GetDestination200Response * @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 GetDestination200Response getDestination(String destinationId) throws ApiException { ApiResponse localVarResp = getDestinationWithHttpInfo(destinationId); return localVarResp.getData(); } /** * Get Destination * Returns a Destination by its id. Config API omitted fields: - `catalogId` * @param destinationId (required) * @return ApiResponse<GetDestination200Response> * @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 getDestinationWithHttpInfo(String destinationId) throws ApiException { okhttp3.Call localVarCall = getDestinationValidateBeforeCall(destinationId, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get Destination (asynchronously) * Returns a Destination by its id. Config API omitted fields: - `catalogId` * @param destinationId (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 getDestinationAsync(String destinationId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getDestinationValidateBeforeCall(destinationId, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getSubscriptionFromDestination * @param destinationId (required) * @param id (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 getSubscriptionFromDestinationCall(String destinationId, String id, 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 = "/destinations/{destinationId}/subscriptions/{id}" .replaceAll("\\{" + "destinationId" + "\\}", localVarApiClient.escapeString(destinationId.toString())) .replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(id.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 getSubscriptionFromDestinationValidateBeforeCall(String destinationId, String id, final ApiCallback _callback) throws ApiException { // verify the required parameter 'destinationId' is set if (destinationId == null) { throw new ApiException("Missing the required parameter 'destinationId' when calling getSubscriptionFromDestination(Async)"); } // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling getSubscriptionFromDestination(Async)"); } okhttp3.Call localVarCall = getSubscriptionFromDestinationCall(destinationId, id, _callback); return localVarCall; } /** * Get Subscription from Destination * Gets a Destination subscription by id. * @param destinationId (required) * @param id (required) * @return GetSubscriptionFromDestination200Response * @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 GetSubscriptionFromDestination200Response getSubscriptionFromDestination(String destinationId, String id) throws ApiException { ApiResponse localVarResp = getSubscriptionFromDestinationWithHttpInfo(destinationId, id); return localVarResp.getData(); } /** * Get Subscription from Destination * Gets a Destination subscription by id. * @param destinationId (required) * @param id (required) * @return ApiResponse<GetSubscriptionFromDestination200Response> * @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 getSubscriptionFromDestinationWithHttpInfo(String destinationId, String id) throws ApiException { okhttp3.Call localVarCall = getSubscriptionFromDestinationValidateBeforeCall(destinationId, id, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get Subscription from Destination (asynchronously) * Gets a Destination subscription by id. * @param destinationId (required) * @param id (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 getSubscriptionFromDestinationAsync(String destinationId, String id, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getSubscriptionFromDestinationValidateBeforeCall(destinationId, id, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listDeliveryMetricsSummaryFromDestination * @param destinationId (required) * @param sourceId The id of the Source linked to the Destination. Config API note: analogous to `parent`. This parameter exists in alpha. (required) * @param startTime Filter events that happened after this time. Defaults to: - 1 hour ago if granularity is `MINUTE`. - 7 days ago if granularity is `HOUR`. - 30 days ago if granularity is `DAY`. This parameter exists in alpha. (optional) * @param endTime Filter events that happened before this time. Defaults to now if not set. This parameter exists in alpha. (optional) * @param granularity The granularity to filter metrics to. Either `MINUTE`, `HOUR` or `DAY`. Defaults to `MINUTE` if not set. 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 listDeliveryMetricsSummaryFromDestinationCall(String destinationId, String sourceId, String startTime, String endTime, String granularity, 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 = "/destinations/{destinationId}/delivery-metrics" .replaceAll("\\{" + "destinationId" + "\\}", localVarApiClient.escapeString(destinationId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (sourceId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("sourceId", sourceId)); } if (startTime != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); } if (endTime != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); } if (granularity != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("granularity", granularity)); } final String[] localVarAccepts = { "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+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 listDeliveryMetricsSummaryFromDestinationValidateBeforeCall(String destinationId, String sourceId, String startTime, String endTime, String granularity, final ApiCallback _callback) throws ApiException { // verify the required parameter 'destinationId' is set if (destinationId == null) { throw new ApiException("Missing the required parameter 'destinationId' when calling listDeliveryMetricsSummaryFromDestination(Async)"); } // verify the required parameter 'sourceId' is set if (sourceId == null) { throw new ApiException("Missing the required parameter 'sourceId' when calling listDeliveryMetricsSummaryFromDestination(Async)"); } okhttp3.Call localVarCall = listDeliveryMetricsSummaryFromDestinationCall(destinationId, sourceId, startTime, endTime, granularity, _callback); return localVarCall; } /** * List Delivery Metrics Summary from Destination * Get event delivery metrics summary from a Destination. Based on the granularity, there are restrictions on the time range you can query: **Minute Granularity**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour Granularity**: - Max Time range: 1 week - Oldest possible start time: 10 days in the past **Day Granularity**: - Max time range: 60 days - Oldest possible start time: 60 days in the past * @param destinationId (required) * @param sourceId The id of the Source linked to the Destination. Config API note: analogous to `parent`. This parameter exists in alpha. (required) * @param startTime Filter events that happened after this time. Defaults to: - 1 hour ago if granularity is `MINUTE`. - 7 days ago if granularity is `HOUR`. - 30 days ago if granularity is `DAY`. This parameter exists in alpha. (optional) * @param endTime Filter events that happened before this time. Defaults to now if not set. This parameter exists in alpha. (optional) * @param granularity The granularity to filter metrics to. Either `MINUTE`, `HOUR` or `DAY`. Defaults to `MINUTE` if not set. This parameter exists in alpha. (optional) * @return ListDeliveryMetricsSummaryFromDestination200Response * @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 ListDeliveryMetricsSummaryFromDestination200Response listDeliveryMetricsSummaryFromDestination(String destinationId, String sourceId, String startTime, String endTime, String granularity) throws ApiException { ApiResponse localVarResp = listDeliveryMetricsSummaryFromDestinationWithHttpInfo(destinationId, sourceId, startTime, endTime, granularity); return localVarResp.getData(); } /** * List Delivery Metrics Summary from Destination * Get event delivery metrics summary from a Destination. Based on the granularity, there are restrictions on the time range you can query: **Minute Granularity**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour Granularity**: - Max Time range: 1 week - Oldest possible start time: 10 days in the past **Day Granularity**: - Max time range: 60 days - Oldest possible start time: 60 days in the past * @param destinationId (required) * @param sourceId The id of the Source linked to the Destination. Config API note: analogous to `parent`. This parameter exists in alpha. (required) * @param startTime Filter events that happened after this time. Defaults to: - 1 hour ago if granularity is `MINUTE`. - 7 days ago if granularity is `HOUR`. - 30 days ago if granularity is `DAY`. This parameter exists in alpha. (optional) * @param endTime Filter events that happened before this time. Defaults to now if not set. This parameter exists in alpha. (optional) * @param granularity The granularity to filter metrics to. Either `MINUTE`, `HOUR` or `DAY`. Defaults to `MINUTE` if not set. This parameter exists in alpha. (optional) * @return ApiResponse<ListDeliveryMetricsSummaryFromDestination200Response> * @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 listDeliveryMetricsSummaryFromDestinationWithHttpInfo(String destinationId, String sourceId, String startTime, String endTime, String granularity) throws ApiException { okhttp3.Call localVarCall = listDeliveryMetricsSummaryFromDestinationValidateBeforeCall(destinationId, sourceId, startTime, endTime, granularity, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * List Delivery Metrics Summary from Destination (asynchronously) * Get event delivery metrics summary from a Destination. Based on the granularity, there are restrictions on the time range you can query: **Minute Granularity**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour Granularity**: - Max Time range: 1 week - Oldest possible start time: 10 days in the past **Day Granularity**: - Max time range: 60 days - Oldest possible start time: 60 days in the past * @param destinationId (required) * @param sourceId The id of the Source linked to the Destination. Config API note: analogous to `parent`. This parameter exists in alpha. (required) * @param startTime Filter events that happened after this time. Defaults to: - 1 hour ago if granularity is `MINUTE`. - 7 days ago if granularity is `HOUR`. - 30 days ago if granularity is `DAY`. This parameter exists in alpha. (optional) * @param endTime Filter events that happened before this time. Defaults to now if not set. This parameter exists in alpha. (optional) * @param granularity The granularity to filter metrics to. Either `MINUTE`, `HOUR` or `DAY`. Defaults to `MINUTE` if not set. 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 listDeliveryMetricsSummaryFromDestinationAsync(String destinationId, String sourceId, String startTime, String endTime, String granularity, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = listDeliveryMetricsSummaryFromDestinationValidateBeforeCall(destinationId, sourceId, startTime, endTime, granularity, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listDestinations * @param pagination Required pagination params for the request. 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 listDestinationsCall(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 = "/destinations"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); 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 listDestinationsValidateBeforeCall(PaginationInput pagination, final ApiCallback _callback) throws ApiException { // verify the required parameter 'pagination' is set if (pagination == null) { throw new ApiException("Missing the required parameter 'pagination' when calling listDestinations(Async)"); } okhttp3.Call localVarCall = listDestinationsCall(pagination, _callback); return localVarCall; } /** * List Destinations * Returns a list of Destinations. * @param pagination Required pagination params for the request. This parameter exists in alpha. (required) * @return ListDestinations200Response * @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 ListDestinations200Response listDestinations(PaginationInput pagination) throws ApiException { ApiResponse localVarResp = listDestinationsWithHttpInfo(pagination); return localVarResp.getData(); } /** * List Destinations * Returns a list of Destinations. * @param pagination Required pagination params for the request. This parameter exists in alpha. (required) * @return ApiResponse<ListDestinations200Response> * @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 listDestinationsWithHttpInfo(PaginationInput pagination) throws ApiException { okhttp3.Call localVarCall = listDestinationsValidateBeforeCall(pagination, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * List Destinations (asynchronously) * Returns a list of Destinations. * @param pagination Required pagination params for the request. 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 listDestinationsAsync(PaginationInput pagination, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = listDestinationsValidateBeforeCall(pagination, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listSubscriptionsFromDestination * @param destinationId (required) * @param pagination Pagination options. 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 listSubscriptionsFromDestinationCall(String destinationId, 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 = "/destinations/{destinationId}/subscriptions" .replaceAll("\\{" + "destinationId" + "\\}", localVarApiClient.escapeString(destinationId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (pagination != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); } 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 listSubscriptionsFromDestinationValidateBeforeCall(String destinationId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { // verify the required parameter 'destinationId' is set if (destinationId == null) { throw new ApiException("Missing the required parameter 'destinationId' when calling listSubscriptionsFromDestination(Async)"); } // verify the required parameter 'pagination' is set if (pagination == null) { throw new ApiException("Missing the required parameter 'pagination' when calling listSubscriptionsFromDestination(Async)"); } okhttp3.Call localVarCall = listSubscriptionsFromDestinationCall(destinationId, pagination, _callback); return localVarCall; } /** * List Subscriptions from Destination * Lists subscriptions for a Destination. * @param destinationId (required) * @param pagination Pagination options. This parameter exists in alpha. (required) * @return ListSubscriptionsFromDestination200Response * @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 ListSubscriptionsFromDestination200Response listSubscriptionsFromDestination(String destinationId, PaginationInput pagination) throws ApiException { ApiResponse localVarResp = listSubscriptionsFromDestinationWithHttpInfo(destinationId, pagination); return localVarResp.getData(); } /** * List Subscriptions from Destination * Lists subscriptions for a Destination. * @param destinationId (required) * @param pagination Pagination options. This parameter exists in alpha. (required) * @return ApiResponse<ListSubscriptionsFromDestination200Response> * @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 listSubscriptionsFromDestinationWithHttpInfo(String destinationId, PaginationInput pagination) throws ApiException { okhttp3.Call localVarCall = listSubscriptionsFromDestinationValidateBeforeCall(destinationId, pagination, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * List Subscriptions from Destination (asynchronously) * Lists subscriptions for a Destination. * @param destinationId (required) * @param pagination Pagination options. 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 listSubscriptionsFromDestinationAsync(String destinationId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = listSubscriptionsFromDestinationValidateBeforeCall(destinationId, pagination, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for removeSubscriptionFromDestination * @param destinationId (required) * @param id (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 removeSubscriptionFromDestinationCall(String destinationId, String id, 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 = "/destinations/{destinationId}/subscriptions/{id}" .replaceAll("\\{" + "destinationId" + "\\}", localVarApiClient.escapeString(destinationId.toString())) .replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(id.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, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call removeSubscriptionFromDestinationValidateBeforeCall(String destinationId, String id, final ApiCallback _callback) throws ApiException { // verify the required parameter 'destinationId' is set if (destinationId == null) { throw new ApiException("Missing the required parameter 'destinationId' when calling removeSubscriptionFromDestination(Async)"); } // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling removeSubscriptionFromDestination(Async)"); } okhttp3.Call localVarCall = removeSubscriptionFromDestinationCall(destinationId, id, _callback); return localVarCall; } /** * Remove Subscription from Destination * Deletes an existing Destination subscription. * @param destinationId (required) * @param id (required) * @return RemoveSubscriptionFromDestination200Response * @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 RemoveSubscriptionFromDestination200Response removeSubscriptionFromDestination(String destinationId, String id) throws ApiException { ApiResponse localVarResp = removeSubscriptionFromDestinationWithHttpInfo(destinationId, id); return localVarResp.getData(); } /** * Remove Subscription from Destination * Deletes an existing Destination subscription. * @param destinationId (required) * @param id (required) * @return ApiResponse<RemoveSubscriptionFromDestination200Response> * @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 removeSubscriptionFromDestinationWithHttpInfo(String destinationId, String id) throws ApiException { okhttp3.Call localVarCall = removeSubscriptionFromDestinationValidateBeforeCall(destinationId, id, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Remove Subscription from Destination (asynchronously) * Deletes an existing Destination subscription. * @param destinationId (required) * @param id (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 removeSubscriptionFromDestinationAsync(String destinationId, String id, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = removeSubscriptionFromDestinationValidateBeforeCall(destinationId, id, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for updateDestination * @param destinationId (required) * @param updateDestinationV1Input (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 updateDestinationCall(String destinationId, UpdateDestinationV1Input updateDestinationV1Input, 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 = updateDestinationV1Input; // create path and map variables String localVarPath = "/destinations/{destinationId}" .replaceAll("\\{" + "destinationId" + "\\}", localVarApiClient.escapeString(destinationId.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/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 = { "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+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, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call updateDestinationValidateBeforeCall(String destinationId, UpdateDestinationV1Input updateDestinationV1Input, final ApiCallback _callback) throws ApiException { // verify the required parameter 'destinationId' is set if (destinationId == null) { throw new ApiException("Missing the required parameter 'destinationId' when calling updateDestination(Async)"); } // verify the required parameter 'updateDestinationV1Input' is set if (updateDestinationV1Input == null) { throw new ApiException("Missing the required parameter 'updateDestinationV1Input' when calling updateDestination(Async)"); } okhttp3.Call localVarCall = updateDestinationCall(destinationId, updateDestinationV1Input, _callback); return localVarCall; } /** * Update Destination * Updates an existing Destination. **Note**: if you attempt to update read-only settings for your destination you'll encounter the following behavior: * If only read-only properties are being updated, the endpoint will return an HTTP 400 error. * If there's a mix of writable and read-only properties in the payload, the request will be accepted, the writable properties will be updated and the read-only properties ignored. When called, this endpoint may generate the `Integration Disabled` [Audit Trail](/tag/Audit-Trail) event. Config API omitted fields: - `updateMask` * @param destinationId (required) * @param updateDestinationV1Input (required) * @return UpdateDestination200Response * @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 UpdateDestination200Response updateDestination(String destinationId, UpdateDestinationV1Input updateDestinationV1Input) throws ApiException { ApiResponse localVarResp = updateDestinationWithHttpInfo(destinationId, updateDestinationV1Input); return localVarResp.getData(); } /** * Update Destination * Updates an existing Destination. **Note**: if you attempt to update read-only settings for your destination you'll encounter the following behavior: * If only read-only properties are being updated, the endpoint will return an HTTP 400 error. * If there's a mix of writable and read-only properties in the payload, the request will be accepted, the writable properties will be updated and the read-only properties ignored. When called, this endpoint may generate the `Integration Disabled` [Audit Trail](/tag/Audit-Trail) event. Config API omitted fields: - `updateMask` * @param destinationId (required) * @param updateDestinationV1Input (required) * @return ApiResponse<UpdateDestination200Response> * @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 updateDestinationWithHttpInfo(String destinationId, UpdateDestinationV1Input updateDestinationV1Input) throws ApiException { okhttp3.Call localVarCall = updateDestinationValidateBeforeCall(destinationId, updateDestinationV1Input, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Update Destination (asynchronously) * Updates an existing Destination. **Note**: if you attempt to update read-only settings for your destination you'll encounter the following behavior: * If only read-only properties are being updated, the endpoint will return an HTTP 400 error. * If there's a mix of writable and read-only properties in the payload, the request will be accepted, the writable properties will be updated and the read-only properties ignored. When called, this endpoint may generate the `Integration Disabled` [Audit Trail](/tag/Audit-Trail) event. Config API omitted fields: - `updateMask` * @param destinationId (required) * @param updateDestinationV1Input (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 updateDestinationAsync(String destinationId, UpdateDestinationV1Input updateDestinationV1Input, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = updateDestinationValidateBeforeCall(destinationId, updateDestinationV1Input, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for updateSubscriptionForDestination * @param destinationId (required) * @param id (required) * @param updateSubscriptionForDestinationAlphaInput (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 updateSubscriptionForDestinationCall(String destinationId, String id, UpdateSubscriptionForDestinationAlphaInput updateSubscriptionForDestinationAlphaInput, 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 = updateSubscriptionForDestinationAlphaInput; // create path and map variables String localVarPath = "/destinations/{destinationId}/subscriptions/{id}" .replaceAll("\\{" + "destinationId" + "\\}", localVarApiClient.escapeString(destinationId.toString())) .replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(id.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, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call updateSubscriptionForDestinationValidateBeforeCall(String destinationId, String id, UpdateSubscriptionForDestinationAlphaInput updateSubscriptionForDestinationAlphaInput, final ApiCallback _callback) throws ApiException { // verify the required parameter 'destinationId' is set if (destinationId == null) { throw new ApiException("Missing the required parameter 'destinationId' when calling updateSubscriptionForDestination(Async)"); } // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling updateSubscriptionForDestination(Async)"); } // verify the required parameter 'updateSubscriptionForDestinationAlphaInput' is set if (updateSubscriptionForDestinationAlphaInput == null) { throw new ApiException("Missing the required parameter 'updateSubscriptionForDestinationAlphaInput' when calling updateSubscriptionForDestination(Async)"); } okhttp3.Call localVarCall = updateSubscriptionForDestinationCall(destinationId, id, updateSubscriptionForDestinationAlphaInput, _callback); return localVarCall; } /** * Update Subscription for Destination * Updates an existing Destination subscription. * @param destinationId (required) * @param id (required) * @param updateSubscriptionForDestinationAlphaInput (required) * @return UpdateSubscriptionForDestination200Response * @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 UpdateSubscriptionForDestination200Response updateSubscriptionForDestination(String destinationId, String id, UpdateSubscriptionForDestinationAlphaInput updateSubscriptionForDestinationAlphaInput) throws ApiException { ApiResponse localVarResp = updateSubscriptionForDestinationWithHttpInfo(destinationId, id, updateSubscriptionForDestinationAlphaInput); return localVarResp.getData(); } /** * Update Subscription for Destination * Updates an existing Destination subscription. * @param destinationId (required) * @param id (required) * @param updateSubscriptionForDestinationAlphaInput (required) * @return ApiResponse<UpdateSubscriptionForDestination200Response> * @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 updateSubscriptionForDestinationWithHttpInfo(String destinationId, String id, UpdateSubscriptionForDestinationAlphaInput updateSubscriptionForDestinationAlphaInput) throws ApiException { okhttp3.Call localVarCall = updateSubscriptionForDestinationValidateBeforeCall(destinationId, id, updateSubscriptionForDestinationAlphaInput, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Update Subscription for Destination (asynchronously) * Updates an existing Destination subscription. * @param destinationId (required) * @param id (required) * @param updateSubscriptionForDestinationAlphaInput (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 updateSubscriptionForDestinationAsync(String destinationId, String id, UpdateSubscriptionForDestinationAlphaInput updateSubscriptionForDestinationAlphaInput, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = updateSubscriptionForDestinationValidateBeforeCall(destinationId, id, updateSubscriptionForDestinationAlphaInput, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy