com.unblu.webapi.jersey.v4.api.ExternalMessengerContactsApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jersey3-client-v4 Show documentation
Show all versions of jersey3-client-v4 Show documentation
Client implemented using Jersey
package com.unblu.webapi.jersey.v4.api;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.unblu.webapi.jersey.v4.invoker.ApiClient;
import com.unblu.webapi.jersey.v4.invoker.ApiException;
import com.unblu.webapi.jersey.v4.invoker.ApiResponse;
import com.unblu.webapi.jersey.v4.invoker.Configuration;
import com.unblu.webapi.jersey.v4.invoker.Pair;
import com.unblu.webapi.model.v4.ExternalMessengerContact;
import com.unblu.webapi.model.v4.ExternalMessengerContactList;
import com.unblu.webapi.model.v4.ExternalMessengerContactQuery;
import com.unblu.webapi.model.v4.ExternalMessengerContactResult;
import com.unblu.webapi.model.v4.ExternalMessengerContactsMigrateContactPersonWithAllConnectedConversationsBody;
import jakarta.ws.rs.core.GenericType;
public class ExternalMessengerContactsApi {
private ApiClient apiClient;
public ExternalMessengerContactsApi() {
this(Configuration.getDefaultApiClient());
}
public ExternalMessengerContactsApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* create <p>This endpoint is in preview mode.</p>Creates an external messenger contact. <p> The configuration property
* `com.unblu.permission.roleAllowed.manageExternalMessengerContacts` defines which user roles the endpoint is available to.<br>
*
* @param externalMessengerContact to create (required)
* @return ExternalMessengerContact
* @throws ApiException if fails to make API call
*/
public ExternalMessengerContact externalMessengerContactsCreate(ExternalMessengerContact externalMessengerContact) throws ApiException {
return externalMessengerContactsCreateWithHttpInfo(externalMessengerContact).getData();
}
/**
* create <p>This endpoint is in preview mode.</p>Creates an external messenger contact. <p> The configuration property
* `com.unblu.permission.roleAllowed.manageExternalMessengerContacts` defines which user roles the endpoint is available to.<br>
*
* @param externalMessengerContact to create (required)
* @return ApiResponse<ExternalMessengerContact>
* @throws ApiException if fails to make API call
*/
public ApiResponse externalMessengerContactsCreateWithHttpInfo(ExternalMessengerContact externalMessengerContact) throws ApiException {
Object localVarPostBody = externalMessengerContact;
// verify the required parameter 'externalMessengerContact' is set
if (externalMessengerContact == null) {
throw new ApiException(400, "Missing the required parameter 'externalMessengerContact' when calling externalMessengerContactsCreate");
}
// create path and map variables
String localVarPath = "/externalmessengercontacts/create";
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = 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" };
GenericType localVarReturnType = new GenericType() {
};
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* delete <p>This endpoint is in preview mode.</p>Deletes an external messenger contact. This ends all the contact's participations in
* conversations. <p> The configuration property `com.unblu.permission.roleAllowed.manageExternalMessengerContacts` defines which user roles
* this endpoint is available to.<br>
*
* @param externalMessengerContactId The ID of the external messenger contact to delete (required)
* @throws ApiException if fails to make API call
*/
public void externalMessengerContactsDelete(String externalMessengerContactId) throws ApiException {
externalMessengerContactsDeleteWithHttpInfo(externalMessengerContactId);
}
/**
* delete <p>This endpoint is in preview mode.</p>Deletes an external messenger contact. This ends all the contact's participations in
* conversations. <p> The configuration property `com.unblu.permission.roleAllowed.manageExternalMessengerContacts` defines which user roles
* this endpoint is available to.<br>
*
* @param externalMessengerContactId The ID of the external messenger contact to delete (required)
* @throws ApiException if fails to make API call
*/
public ApiResponse externalMessengerContactsDeleteWithHttpInfo(String externalMessengerContactId) throws ApiException {
Object localVarPostBody = new HashMap<>();
// verify the required parameter 'externalMessengerContactId' is set
if (externalMessengerContactId == null) {
throw new ApiException(400, "Missing the required parameter 'externalMessengerContactId' when calling externalMessengerContactsDelete");
}
// create path and map variables
String localVarPath = "/externalmessengercontacts/{externalMessengerContactId}/delete"
.replaceAll("\\{" + "externalMessengerContactId" + "\\}", apiClient.escapeString(externalMessengerContactId.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "basicAuth" };
return apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
}
/**
* migrateContactPersonWithAllConnectedConversations <p>This endpoint is in preview mode.</p>Changes the linked person of the external messenger
* contact. All conversations the external messenger contact participated in are migrated to the new person, provided the conversation allows a user change.
* Allowing it means the configuration property `com.unblu.conversation.lifecycle.allowMigrationOnExternalMessengerContactMigration` isn't set to
* `EConversationReplaceUserOnLoginMode.NEVER` on the conversation. Other conversations not linked to the external messenger contact and just having
* the same person used, e.g. direct conversations without an external messenger, will not be migrated. <p> If the new person ID matches the current
* person ID, calling this endpoint doesn't do anything. <p> The configuration property
* `com.unblu.permission.roleAllowed.manageExternalMessengerContacts` defines which user roles the endpoint is available to.<br>
*
* @param externalMessengerContactId The ID of the external messenger contact to update (required)
* @param externalMessengerContactsMigrateContactPersonWithAllConnectedConversationsBody (required)
* @return ExternalMessengerContact
* @throws ApiException if fails to make API call
*/
public ExternalMessengerContact externalMessengerContactsMigrateContactPersonWithAllConnectedConversations(String externalMessengerContactId, ExternalMessengerContactsMigrateContactPersonWithAllConnectedConversationsBody externalMessengerContactsMigrateContactPersonWithAllConnectedConversationsBody) throws ApiException {
return externalMessengerContactsMigrateContactPersonWithAllConnectedConversationsWithHttpInfo(externalMessengerContactId, externalMessengerContactsMigrateContactPersonWithAllConnectedConversationsBody).getData();
}
/**
* migrateContactPersonWithAllConnectedConversations <p>This endpoint is in preview mode.</p>Changes the linked person of the external messenger
* contact. All conversations the external messenger contact participated in are migrated to the new person, provided the conversation allows a user change.
* Allowing it means the configuration property `com.unblu.conversation.lifecycle.allowMigrationOnExternalMessengerContactMigration` isn't set to
* `EConversationReplaceUserOnLoginMode.NEVER` on the conversation. Other conversations not linked to the external messenger contact and just having
* the same person used, e.g. direct conversations without an external messenger, will not be migrated. <p> If the new person ID matches the current
* person ID, calling this endpoint doesn't do anything. <p> The configuration property
* `com.unblu.permission.roleAllowed.manageExternalMessengerContacts` defines which user roles the endpoint is available to.<br>
*
* @param externalMessengerContactId The ID of the external messenger contact to update (required)
* @param externalMessengerContactsMigrateContactPersonWithAllConnectedConversationsBody (required)
* @return ApiResponse<ExternalMessengerContact>
* @throws ApiException if fails to make API call
*/
public ApiResponse externalMessengerContactsMigrateContactPersonWithAllConnectedConversationsWithHttpInfo(String externalMessengerContactId, ExternalMessengerContactsMigrateContactPersonWithAllConnectedConversationsBody externalMessengerContactsMigrateContactPersonWithAllConnectedConversationsBody) throws ApiException {
Object localVarPostBody = externalMessengerContactsMigrateContactPersonWithAllConnectedConversationsBody;
// verify the required parameter 'externalMessengerContactId' is set
if (externalMessengerContactId == null) {
throw new ApiException(400, "Missing the required parameter 'externalMessengerContactId' when calling externalMessengerContactsMigrateContactPersonWithAllConnectedConversations");
}
// verify the required parameter 'externalMessengerContactsMigrateContactPersonWithAllConnectedConversationsBody' is set
if (externalMessengerContactsMigrateContactPersonWithAllConnectedConversationsBody == null) {
throw new ApiException(400, "Missing the required parameter 'externalMessengerContactsMigrateContactPersonWithAllConnectedConversationsBody' when calling externalMessengerContactsMigrateContactPersonWithAllConnectedConversations");
}
// create path and map variables
String localVarPath = "/externalmessengercontacts/{externalMessengerContactId}/migrateContactPersonWithAllConnectedConversations"
.replaceAll("\\{" + "externalMessengerContactId" + "\\}", apiClient.escapeString(externalMessengerContactId.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = 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" };
GenericType localVarReturnType = new GenericType() {
};
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* migrateContactPersonWithGivenConversations <p>This endpoint is in preview mode.</p>Changes the linked person of the external messenger contact
* and migrates the list of conversations passed in to the new person, provided the conversation allows a user change. Allowing it means the configuration
* property `com.unblu.conversation.lifecycle.allowMigrationOnExternalMessengerContactMigration` isn't set to
* `EConversationReplaceUserOnLoginMode.NEVER`. <p> For all other conversations the contact is part of, their participation is removed.
* <p> If the new person ID matches the current person ID, calling this endpoint doesn't do anything. <p> The given conversation Ids have to be
* in the list of none ended conversation where the external messenger contact is a participant. If not, an error will be returned before doing any migration.
* <p> The configuration property `com.unblu.permission.roleAllowed.migrateExternalMessengerContacts` defines which user roles the endpoint is
* available to.<br>
*
* @param externalMessengerContactId The ID of the external messenger contact to update (required)
* @param requestBody The conversations that should be migrated. The conversations must not be ended and the passed in external messenger contact must be a
* participant. (required)
* @param newPersonId The new person ID to set on the external messenger contact (optional)
* @return ExternalMessengerContact
* @throws ApiException if fails to make API call
*/
public ExternalMessengerContact externalMessengerContactsMigrateContactPersonWithGivenConversations(String externalMessengerContactId, List requestBody, String newPersonId) throws ApiException {
return externalMessengerContactsMigrateContactPersonWithGivenConversationsWithHttpInfo(externalMessengerContactId, requestBody, newPersonId).getData();
}
/**
* migrateContactPersonWithGivenConversations <p>This endpoint is in preview mode.</p>Changes the linked person of the external messenger contact
* and migrates the list of conversations passed in to the new person, provided the conversation allows a user change. Allowing it means the configuration
* property `com.unblu.conversation.lifecycle.allowMigrationOnExternalMessengerContactMigration` isn't set to
* `EConversationReplaceUserOnLoginMode.NEVER`. <p> For all other conversations the contact is part of, their participation is removed.
* <p> If the new person ID matches the current person ID, calling this endpoint doesn't do anything. <p> The given conversation Ids have to be
* in the list of none ended conversation where the external messenger contact is a participant. If not, an error will be returned before doing any migration.
* <p> The configuration property `com.unblu.permission.roleAllowed.migrateExternalMessengerContacts` defines which user roles the endpoint is
* available to.<br>
*
* @param externalMessengerContactId The ID of the external messenger contact to update (required)
* @param requestBody The conversations that should be migrated. The conversations must not be ended and the passed in external messenger contact must be a
* participant. (required)
* @param newPersonId The new person ID to set on the external messenger contact (optional)
* @return ApiResponse<ExternalMessengerContact>
* @throws ApiException if fails to make API call
*/
public ApiResponse externalMessengerContactsMigrateContactPersonWithGivenConversationsWithHttpInfo(String externalMessengerContactId, List requestBody, String newPersonId) throws ApiException {
Object localVarPostBody = requestBody;
// verify the required parameter 'externalMessengerContactId' is set
if (externalMessengerContactId == null) {
throw new ApiException(400, "Missing the required parameter 'externalMessengerContactId' when calling externalMessengerContactsMigrateContactPersonWithGivenConversations");
}
// verify the required parameter 'requestBody' is set
if (requestBody == null) {
throw new ApiException(400, "Missing the required parameter 'requestBody' when calling externalMessengerContactsMigrateContactPersonWithGivenConversations");
}
// create path and map variables
String localVarPath = "/externalmessengercontacts/{externalMessengerContactId}/migrateContactPersonWithGivenConversations"
.replaceAll("\\{" + "externalMessengerContactId" + "\\}", apiClient.escapeString(externalMessengerContactId.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "newPersonId", newPersonId));
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" };
GenericType localVarReturnType = new GenericType() {
};
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* read <p>This endpoint is in preview mode.</p>Returns the external messenger contact with the given ID. <p> The configuration property
* `com.unblu.permission.roleAllowed.manageExternalMessengerContacts` defines which user roles the endpoint is available to.<br>
*
* @param externalMessengerContactId The ID of the external messenger contact to retrieve (required)
* @return ExternalMessengerContact
* @throws ApiException if fails to make API call
*/
public ExternalMessengerContact externalMessengerContactsRead(String externalMessengerContactId) throws ApiException {
return externalMessengerContactsReadWithHttpInfo(externalMessengerContactId).getData();
}
/**
* read <p>This endpoint is in preview mode.</p>Returns the external messenger contact with the given ID. <p> The configuration property
* `com.unblu.permission.roleAllowed.manageExternalMessengerContacts` defines which user roles the endpoint is available to.<br>
*
* @param externalMessengerContactId The ID of the external messenger contact to retrieve (required)
* @return ApiResponse<ExternalMessengerContact>
* @throws ApiException if fails to make API call
*/
public ApiResponse externalMessengerContactsReadWithHttpInfo(String externalMessengerContactId) throws ApiException {
Object localVarPostBody = new HashMap<>();
// verify the required parameter 'externalMessengerContactId' is set
if (externalMessengerContactId == null) {
throw new ApiException(400, "Missing the required parameter 'externalMessengerContactId' when calling externalMessengerContactsRead");
}
// create path and map variables
String localVarPath = "/externalmessengercontacts/{externalMessengerContactId}/read"
.replaceAll("\\{" + "externalMessengerContactId" + "\\}", apiClient.escapeString(externalMessengerContactId.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "basicAuth" };
GenericType localVarReturnType = new GenericType() {
};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* readMultiple <p>This endpoint is in preview mode.</p>readMultiple operation
*
* @param requestBody (required)
* @return ExternalMessengerContactList
* @throws ApiException if fails to make API call
*/
public ExternalMessengerContactList externalMessengerContactsReadMultiple(List requestBody) throws ApiException {
return externalMessengerContactsReadMultipleWithHttpInfo(requestBody).getData();
}
/**
* readMultiple <p>This endpoint is in preview mode.</p>readMultiple operation
*
* @param requestBody (required)
* @return ApiResponse<ExternalMessengerContactList>
* @throws ApiException if fails to make API call
*/
public ApiResponse externalMessengerContactsReadMultipleWithHttpInfo(List requestBody) throws ApiException {
Object localVarPostBody = requestBody;
// verify the required parameter 'requestBody' is set
if (requestBody == null) {
throw new ApiException(400, "Missing the required parameter 'requestBody' when calling externalMessengerContactsReadMultiple");
}
// create path and map variables
String localVarPath = "/externalmessengercontacts/readMultiple";
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = 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" };
GenericType localVarReturnType = new GenericType() {
};
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* search <p>This endpoint is in preview mode.</p>Search for `ExternalMessengerContact`s in the current account<br>
*
* @param externalMessengerContactQuery (required)
* @return ExternalMessengerContactResult
* @throws ApiException if fails to make API call
*/
public ExternalMessengerContactResult externalMessengerContactsSearch(ExternalMessengerContactQuery externalMessengerContactQuery) throws ApiException {
return externalMessengerContactsSearchWithHttpInfo(externalMessengerContactQuery).getData();
}
/**
* search <p>This endpoint is in preview mode.</p>Search for `ExternalMessengerContact`s in the current account<br>
*
* @param externalMessengerContactQuery (required)
* @return ApiResponse<ExternalMessengerContactResult>
* @throws ApiException if fails to make API call
*/
public ApiResponse externalMessengerContactsSearchWithHttpInfo(ExternalMessengerContactQuery externalMessengerContactQuery) throws ApiException {
Object localVarPostBody = externalMessengerContactQuery;
// verify the required parameter 'externalMessengerContactQuery' is set
if (externalMessengerContactQuery == null) {
throw new ApiException(400, "Missing the required parameter 'externalMessengerContactQuery' when calling externalMessengerContactsSearch");
}
// create path and map variables
String localVarPath = "/externalmessengercontacts/search";
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = 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" };
GenericType localVarReturnType = new GenericType() {
};
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* update <p>This endpoint is in preview mode.</p>Updates an external messenger contact. <p> The configuration property
* `com.unblu.permission.roleAllowed.manageExternalMessengerContacts` defines which user roles the endpoint is available to. <p>
* <b>Note:</b> This can't be used to update the personId. To update the link to a person, use the
* endpoint`migrateContactPersonWithAllConnectedConversations` or `migrateContactPersonWithGivenConversations`.<br>
*
* @param externalMessengerContact to update (required)
* @return ExternalMessengerContact
* @throws ApiException if fails to make API call
*/
public ExternalMessengerContact externalMessengerContactsUpdate(ExternalMessengerContact externalMessengerContact) throws ApiException {
return externalMessengerContactsUpdateWithHttpInfo(externalMessengerContact).getData();
}
/**
* update <p>This endpoint is in preview mode.</p>Updates an external messenger contact. <p> The configuration property
* `com.unblu.permission.roleAllowed.manageExternalMessengerContacts` defines which user roles the endpoint is available to. <p>
* <b>Note:</b> This can't be used to update the personId. To update the link to a person, use the
* endpoint`migrateContactPersonWithAllConnectedConversations` or `migrateContactPersonWithGivenConversations`.<br>
*
* @param externalMessengerContact to update (required)
* @return ApiResponse<ExternalMessengerContact>
* @throws ApiException if fails to make API call
*/
public ApiResponse externalMessengerContactsUpdateWithHttpInfo(ExternalMessengerContact externalMessengerContact) throws ApiException {
Object localVarPostBody = externalMessengerContact;
// verify the required parameter 'externalMessengerContact' is set
if (externalMessengerContact == null) {
throw new ApiException(400, "Missing the required parameter 'externalMessengerContact' when calling externalMessengerContactsUpdate");
}
// create path and map variables
String localVarPath = "/externalmessengercontacts/update";
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = 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" };
GenericType localVarReturnType = new GenericType() {
};
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
}