Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package com.zendesk.sunshine_conversations_client.api;
import com.zendesk.sunshine_conversations_client.ApiException;
import com.zendesk.sunshine_conversations_client.ApiClient;
import com.zendesk.sunshine_conversations_client.Configuration;
import com.zendesk.sunshine_conversations_client.Pair;
import jakarta.ws.rs.core.GenericType;
import com.zendesk.sunshine_conversations_client.model.Page;
import com.zendesk.sunshine_conversations_client.model.ParticipantJoinBody;
import com.zendesk.sunshine_conversations_client.model.ParticipantLeaveBody;
import com.zendesk.sunshine_conversations_client.model.ParticipantListResponse;
import com.zendesk.sunshine_conversations_client.model.ParticipantResponse;
import com.zendesk.sunshine_conversations_client.model.ParticipantSubSchema;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ParticipantsApi {
private ApiClient apiClient;
public ParticipantsApi() {
this(Configuration.getDefaultApiClient());
}
public ParticipantsApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Join Conversation
* Adds a user to a conversation using either their userId or userExternalId. The endpoint only supports adding a participant to a sdkGroup conversation.
* @param participantJoinBody (required)
* @param appId Identifies the app. (required)
* @param conversationId Identifies the conversation. (required)
* @return a {@code ParticipantResponse}
* @throws ApiException if fails to make API call
*/
public ParticipantResponse joinConversation(ParticipantJoinBody participantJoinBody, String appId, String conversationId) throws ApiException {
Object localVarPostBody = participantJoinBody;
// verify the required parameter 'participantJoinBody' is set
if (participantJoinBody == null) {
throw new ApiException(400, "Missing the required parameter 'participantJoinBody' when calling joinConversation");
}
// verify the required parameter 'appId' is set
if (appId == null) {
throw new ApiException(400, "Missing the required parameter 'appId' when calling joinConversation");
}
// verify the required parameter 'conversationId' is set
if (conversationId == null) {
throw new ApiException(400, "Missing the required parameter 'conversationId' when calling joinConversation");
}
// create path and map variables
String localVarPath = "/v2/apps/{appId}/conversations/{conversationId}/join".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "appId" + "\\}", apiClient.escapeString(appId.toString()))
.replaceAll("\\{" + "conversationId" + "\\}", apiClient.escapeString(conversationId.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
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[] { "basicAuth", "bearerAuth" };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Leave Conversation
* Removes a user from a conversation using either their userId, userExternalId, or participantId.
* @param participantLeaveBody (required)
* @param appId Identifies the app. (required)
* @param conversationId Identifies the conversation. (required)
* @return a {@code Object}
* @throws ApiException if fails to make API call
*/
public Object leaveConversation(ParticipantLeaveBody participantLeaveBody, String appId, String conversationId) throws ApiException {
Object localVarPostBody = participantLeaveBody;
// verify the required parameter 'participantLeaveBody' is set
if (participantLeaveBody == null) {
throw new ApiException(400, "Missing the required parameter 'participantLeaveBody' when calling leaveConversation");
}
// verify the required parameter 'appId' is set
if (appId == null) {
throw new ApiException(400, "Missing the required parameter 'appId' when calling leaveConversation");
}
// verify the required parameter 'conversationId' is set
if (conversationId == null) {
throw new ApiException(400, "Missing the required parameter 'conversationId' when calling leaveConversation");
}
// create path and map variables
String localVarPath = "/v2/apps/{appId}/conversations/{conversationId}/leave".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "appId" + "\\}", apiClient.escapeString(appId.toString()))
.replaceAll("\\{" + "conversationId" + "\\}", apiClient.escapeString(conversationId.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
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[] { "basicAuth", "bearerAuth" };
GenericType