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

org.symphonyoss.symphony.agent.api.SignalsApi Maven / Gradle / Ivy

The newest version!
package org.symphonyoss.symphony.agent.api;

import org.symphonyoss.symphony.agent.invoker.ApiException;
import org.symphonyoss.symphony.agent.invoker.ApiClient;
import org.symphonyoss.symphony.agent.invoker.Configuration;
import org.symphonyoss.symphony.agent.invoker.Pair;

import javax.ws.rs.core.GenericType;

import org.symphonyoss.symphony.agent.model.BaseSignal;
import java.math.BigDecimal;
import org.symphonyoss.symphony.agent.model.ChannelSubscriberResponse;
import org.symphonyoss.symphony.agent.model.ChannelSubscriptionResponse;
import org.symphonyoss.symphony.agent.model.Signal;
import org.symphonyoss.symphony.agent.model.SignalList;
import org.symphonyoss.symphony.agent.model.SuccessResponse;
import org.symphonyoss.symphony.agent.model.V2Error;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-13T13:44:51.568-04:00")
public class SignalsApi {
  private ApiClient apiClient;

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

  public SignalsApi(ApiClient apiClient) {
    this.apiClient = apiClient;
  }

  public ApiClient getApiClient() {
    return apiClient;
  }

  public void setApiClient(ApiClient apiClient) {
    this.apiClient = apiClient;
  }

  /**
   * Create a signal.
   * 
   * @param sessionToken Session authentication token. (required)
   * @param signal Signal definition. (required)
   * @param keyManagerToken Key Manager authentication token. (optional)
   * @return Signal
   * @throws ApiException if fails to make API call
   */
  public Signal v1SignalsCreatePost(String sessionToken, BaseSignal signal, String keyManagerToken) throws ApiException {
    Object localVarPostBody = signal;
    
    // verify the required parameter 'sessionToken' is set
    if (sessionToken == null) {
      throw new ApiException(400, "Missing the required parameter 'sessionToken' when calling v1SignalsCreatePost");
    }
    
    // verify the required parameter 'signal' is set
    if (signal == null) {
      throw new ApiException(400, "Missing the required parameter 'signal' when calling v1SignalsCreatePost");
    }
    
    // create path and map variables
    String localVarPath = "/v1/signals/create";

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    Map localVarFormParams = new HashMap();


    if (sessionToken != null)
      localVarHeaderParams.put("sessionToken", apiClient.parameterToString(sessionToken));
if (keyManagerToken != null)
      localVarHeaderParams.put("keyManagerToken", apiClient.parameterToString(keyManagerToken));

    
    final String[] localVarAccepts = {
      "application/json"
    };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

    final String[] localVarContentTypes = {
      "application/json"
    };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

    String[] localVarAuthNames = new String[] {  };

    GenericType localVarReturnType = new GenericType() {};
    return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
      }
  /**
   * Delete a signal.
   * 
   * @param sessionToken Session authentication token. (required)
   * @param id The id of the signal. (required)
   * @param keyManagerToken Key Manager authentication token. (optional)
   * @return SuccessResponse
   * @throws ApiException if fails to make API call
   */
  public SuccessResponse v1SignalsIdDeletePost(String sessionToken, String id, String keyManagerToken) throws ApiException {
    Object localVarPostBody = null;
    
    // verify the required parameter 'sessionToken' is set
    if (sessionToken == null) {
      throw new ApiException(400, "Missing the required parameter 'sessionToken' when calling v1SignalsIdDeletePost");
    }
    
    // verify the required parameter 'id' is set
    if (id == null) {
      throw new ApiException(400, "Missing the required parameter 'id' when calling v1SignalsIdDeletePost");
    }
    
    // create path and map variables
    String localVarPath = "/v1/signals/{id}/delete"
      .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    Map localVarFormParams = new HashMap();


    if (sessionToken != null)
      localVarHeaderParams.put("sessionToken", apiClient.parameterToString(sessionToken));
if (keyManagerToken != null)
      localVarHeaderParams.put("keyManagerToken", apiClient.parameterToString(keyManagerToken));

    
    final String[] localVarAccepts = {
      "application/json"
    };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

    final String[] localVarContentTypes = {
      "application/json"
    };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

    String[] localVarAuthNames = new String[] {  };

    GenericType localVarReturnType = new GenericType() {};
    return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
      }
  /**
   * Get details of the requested signal.
   * 
   * @param sessionToken Session authentication token. (required)
   * @param id The ID of the signal to display.  (required)
   * @param keyManagerToken Key Manager authentication token. (optional)
   * @return Signal
   * @throws ApiException if fails to make API call
   */
  public Signal v1SignalsIdGetGet(String sessionToken, String id, String keyManagerToken) throws ApiException {
    Object localVarPostBody = null;
    
    // verify the required parameter 'sessionToken' is set
    if (sessionToken == null) {
      throw new ApiException(400, "Missing the required parameter 'sessionToken' when calling v1SignalsIdGetGet");
    }
    
    // verify the required parameter 'id' is set
    if (id == null) {
      throw new ApiException(400, "Missing the required parameter 'id' when calling v1SignalsIdGetGet");
    }
    
    // create path and map variables
    String localVarPath = "/v1/signals/{id}/get"
      .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    Map localVarFormParams = new HashMap();


    if (sessionToken != null)
      localVarHeaderParams.put("sessionToken", apiClient.parameterToString(sessionToken));
if (keyManagerToken != null)
      localVarHeaderParams.put("keyManagerToken", apiClient.parameterToString(keyManagerToken));

    
    final String[] localVarAccepts = {
      "application/json"
    };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

    final String[] localVarContentTypes = {
      "application/json"
    };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

    String[] localVarAuthNames = new String[] {  };

    GenericType localVarReturnType = new GenericType() {};
    return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
      }
  /**
   * Subscribe to a Signal.
   * 
   * @param sessionToken Session authentication token. (required)
   * @param id The id of the signal. (required)
   * @param keyManagerToken Key Manager authentication token. (optional)
   * @param pushed Prevent the user to unsubscribe (only for bulk subscription) (optional)
   * @param users UserIds to subscribe (only for bulk subscription) (optional)
   * @return ChannelSubscriptionResponse
   * @throws ApiException if fails to make API call
   */
  public ChannelSubscriptionResponse v1SignalsIdSubscribePost(String sessionToken, String id, String keyManagerToken, Boolean pushed, List users) throws ApiException {
    Object localVarPostBody = users;
    
    // verify the required parameter 'sessionToken' is set
    if (sessionToken == null) {
      throw new ApiException(400, "Missing the required parameter 'sessionToken' when calling v1SignalsIdSubscribePost");
    }
    
    // verify the required parameter 'id' is set
    if (id == null) {
      throw new ApiException(400, "Missing the required parameter 'id' when calling v1SignalsIdSubscribePost");
    }
    
    // create path and map variables
    String localVarPath = "/v1/signals/{id}/subscribe"
      .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    Map localVarFormParams = new HashMap();

    localVarQueryParams.addAll(apiClient.parameterToPairs("", "pushed", pushed));

    if (sessionToken != null)
      localVarHeaderParams.put("sessionToken", apiClient.parameterToString(sessionToken));
if (keyManagerToken != null)
      localVarHeaderParams.put("keyManagerToken", apiClient.parameterToString(keyManagerToken));

    
    final String[] localVarAccepts = {
      "application/json"
    };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

    final String[] localVarContentTypes = {
      "application/json"
    };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

    String[] localVarAuthNames = new String[] {  };

    GenericType localVarReturnType = new GenericType() {};
    return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
      }
  /**
   * Get the subscribers of a signal
   * 
   * @param sessionToken Session authentication token. (required)
   * @param id The id of the signal. (required)
   * @param keyManagerToken Key Manager authentication token. (optional)
   * @param skip No. of results to skip. (optional, default to 0)
   * @param limit Max No. of subscribers to return. If no value is provided, 100 is the default. (optional, default to 100)
   * @return ChannelSubscriberResponse
   * @throws ApiException if fails to make API call
   */
  public ChannelSubscriberResponse v1SignalsIdSubscribersGet(String sessionToken, String id, String keyManagerToken, BigDecimal skip, BigDecimal limit) throws ApiException {
    Object localVarPostBody = null;
    
    // verify the required parameter 'sessionToken' is set
    if (sessionToken == null) {
      throw new ApiException(400, "Missing the required parameter 'sessionToken' when calling v1SignalsIdSubscribersGet");
    }
    
    // verify the required parameter 'id' is set
    if (id == null) {
      throw new ApiException(400, "Missing the required parameter 'id' when calling v1SignalsIdSubscribersGet");
    }
    
    // create path and map variables
    String localVarPath = "/v1/signals/{id}/subscribers"
      .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    Map localVarFormParams = new HashMap();

    localVarQueryParams.addAll(apiClient.parameterToPairs("", "skip", skip));
    localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit));

    if (sessionToken != null)
      localVarHeaderParams.put("sessionToken", apiClient.parameterToString(sessionToken));
if (keyManagerToken != null)
      localVarHeaderParams.put("keyManagerToken", apiClient.parameterToString(keyManagerToken));

    
    final String[] localVarAccepts = {
      "application/json"
    };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

    final String[] localVarContentTypes = {
      "application/json"
    };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

    String[] localVarAuthNames = new String[] {  };

    GenericType localVarReturnType = new GenericType() {};
    return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
      }
  /**
   * Unsubscribe to a Signal.
   * 
   * @param sessionToken Session authentication token. (required)
   * @param id The id of the signal. (required)
   * @param keyManagerToken Key Manager authentication token. (optional)
   * @param users UserIds to unsubscribe (only for bulk unsubscription) (optional)
   * @return ChannelSubscriptionResponse
   * @throws ApiException if fails to make API call
   */
  public ChannelSubscriptionResponse v1SignalsIdUnsubscribePost(String sessionToken, String id, String keyManagerToken, List users) throws ApiException {
    Object localVarPostBody = users;
    
    // verify the required parameter 'sessionToken' is set
    if (sessionToken == null) {
      throw new ApiException(400, "Missing the required parameter 'sessionToken' when calling v1SignalsIdUnsubscribePost");
    }
    
    // verify the required parameter 'id' is set
    if (id == null) {
      throw new ApiException(400, "Missing the required parameter 'id' when calling v1SignalsIdUnsubscribePost");
    }
    
    // create path and map variables
    String localVarPath = "/v1/signals/{id}/unsubscribe"
      .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    Map localVarFormParams = new HashMap();


    if (sessionToken != null)
      localVarHeaderParams.put("sessionToken", apiClient.parameterToString(sessionToken));
if (keyManagerToken != null)
      localVarHeaderParams.put("keyManagerToken", apiClient.parameterToString(keyManagerToken));

    
    final String[] localVarAccepts = {
      "application/json"
    };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

    final String[] localVarContentTypes = {
      "application/json"
    };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

    String[] localVarAuthNames = new String[] {  };

    GenericType localVarReturnType = new GenericType() {};
    return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
      }
  /**
   * Update a signal.
   * 
   * @param sessionToken Session authentication token. (required)
   * @param id The id of the signal. (required)
   * @param signal Signal definition. (required)
   * @param keyManagerToken Key Manager authentication token. (optional)
   * @return Signal
   * @throws ApiException if fails to make API call
   */
  public Signal v1SignalsIdUpdatePost(String sessionToken, String id, BaseSignal signal, String keyManagerToken) throws ApiException {
    Object localVarPostBody = signal;
    
    // verify the required parameter 'sessionToken' is set
    if (sessionToken == null) {
      throw new ApiException(400, "Missing the required parameter 'sessionToken' when calling v1SignalsIdUpdatePost");
    }
    
    // verify the required parameter 'id' is set
    if (id == null) {
      throw new ApiException(400, "Missing the required parameter 'id' when calling v1SignalsIdUpdatePost");
    }
    
    // verify the required parameter 'signal' is set
    if (signal == null) {
      throw new ApiException(400, "Missing the required parameter 'signal' when calling v1SignalsIdUpdatePost");
    }
    
    // create path and map variables
    String localVarPath = "/v1/signals/{id}/update"
      .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    Map localVarFormParams = new HashMap();


    if (sessionToken != null)
      localVarHeaderParams.put("sessionToken", apiClient.parameterToString(sessionToken));
if (keyManagerToken != null)
      localVarHeaderParams.put("keyManagerToken", apiClient.parameterToString(keyManagerToken));

    
    final String[] localVarAccepts = {
      "application/json"
    };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

    final String[] localVarContentTypes = {
      "application/json"
    };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

    String[] localVarAuthNames = new String[] {  };

    GenericType localVarReturnType = new GenericType() {};
    return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
      }
  /**
   * List signals for the requesting user. This includes signals that the user has created and public signals to which they subscribed. 
   * 
   * @param sessionToken Session authentication token. (required)
   * @param keyManagerToken Key Manager authentication token. (optional)
   * @param skip No. of signals to skip.  (optional)
   * @param limit Max no. of signals to return. If no value is provided, 50 is the default. The maximum supported value is 500.  (optional)
   * @return SignalList
   * @throws ApiException if fails to make API call
   */
  public SignalList v1SignalsListGet(String sessionToken, String keyManagerToken, Integer skip, Integer limit) throws ApiException {
    Object localVarPostBody = null;
    
    // verify the required parameter 'sessionToken' is set
    if (sessionToken == null) {
      throw new ApiException(400, "Missing the required parameter 'sessionToken' when calling v1SignalsListGet");
    }
    
    // create path and map variables
    String localVarPath = "/v1/signals/list";

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    Map localVarFormParams = new HashMap();

    localVarQueryParams.addAll(apiClient.parameterToPairs("", "skip", skip));
    localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit));

    if (sessionToken != null)
      localVarHeaderParams.put("sessionToken", apiClient.parameterToString(sessionToken));
if (keyManagerToken != null)
      localVarHeaderParams.put("keyManagerToken", apiClient.parameterToString(keyManagerToken));

    
    final String[] localVarAccepts = {
      "application/json"
    };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

    final String[] localVarContentTypes = {
      "application/json"
    };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

    String[] localVarAuthNames = new String[] {  };

    GenericType localVarReturnType = new GenericType() {};
    return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
      }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy