org.symphonyoss.symphony.agent.api.ShareApi 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.Error;
import org.symphonyoss.symphony.agent.model.ShareContent;
import org.symphonyoss.symphony.agent.model.V2Message;
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 ShareApi {
private ApiClient apiClient;
public ShareApi() {
this(Configuration.getDefaultApiClient());
}
public ShareApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Share a piece of content into Symphony
* Given a 3rd party content (eg. news article), it can share to the given stream. The stream can be a chatroom, an IM or a multiparty IM.
* @param sid Stream ID (required)
* @param sessionToken Session authentication token. (required)
* @param keyManagerToken Key Manager authentication token. (required)
* @param shareContent (required)
* @return V2Message
* @throws ApiException if fails to make API call
*/
public V2Message v1StreamSidSharePost(String sid, String sessionToken, String keyManagerToken, ShareContent shareContent) throws ApiException {
Object localVarPostBody = shareContent;
// verify the required parameter 'sid' is set
if (sid == null) {
throw new ApiException(400, "Missing the required parameter 'sid' when calling v1StreamSidSharePost");
}
// verify the required parameter 'sessionToken' is set
if (sessionToken == null) {
throw new ApiException(400, "Missing the required parameter 'sessionToken' when calling v1StreamSidSharePost");
}
// verify the required parameter 'keyManagerToken' is set
if (keyManagerToken == null) {
throw new ApiException(400, "Missing the required parameter 'keyManagerToken' when calling v1StreamSidSharePost");
}
// verify the required parameter 'shareContent' is set
if (shareContent == null) {
throw new ApiException(400, "Missing the required parameter 'shareContent' when calling v1StreamSidSharePost");
}
// create path and map variables
String localVarPath = "/v1/stream/{sid}/share"
.replaceAll("\\{" + "sid" + "\\}", apiClient.escapeString(sid.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);
}
/**
* PROVISIONAL - Share a piece of content into Symphony
* Given a 3rd party content (eg. news article), it can share to the given stream. The stream can be a chatroom, an IM or a multiparty IM.
* @param sid Stream ID (required)
* @param sessionToken Session authentication token. (required)
* @param shareContent (required)
* @param keyManagerToken Key Manager authentication token. (optional)
* @return V2Message
* @throws ApiException if fails to make API call
*/
public V2Message v3StreamSidSharePost(String sid, String sessionToken, ShareContent shareContent, String keyManagerToken) throws ApiException {
Object localVarPostBody = shareContent;
// verify the required parameter 'sid' is set
if (sid == null) {
throw new ApiException(400, "Missing the required parameter 'sid' when calling v3StreamSidSharePost");
}
// verify the required parameter 'sessionToken' is set
if (sessionToken == null) {
throw new ApiException(400, "Missing the required parameter 'sessionToken' when calling v3StreamSidSharePost");
}
// verify the required parameter 'shareContent' is set
if (shareContent == null) {
throw new ApiException(400, "Missing the required parameter 'shareContent' when calling v3StreamSidSharePost");
}
// create path and map variables
String localVarPath = "/v3/stream/{sid}/share"
.replaceAll("\\{" + "sid" + "\\}", apiClient.escapeString(sid.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);
}
}