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.
/*
* Messente API
* [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.
*
* The version of the OpenAPI document: 2.0.0
* 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.messente.api;
import com.messente.ApiCallback;
import com.messente.ApiClient;
import com.messente.ApiException;
import com.messente.ApiResponse;
import com.messente.Configuration;
import com.messente.Pair;
import com.messente.ProgressRequestBody;
import com.messente.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.messente.api.ErrorPhonebook;
import com.messente.api.GroupEnvelope;
import com.messente.api.GroupListEnvelope;
import com.messente.api.GroupName;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class GroupsApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public GroupsApi() {
this(Configuration.getDefaultApiClient());
}
public GroupsApi(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 createGroup
* @param groupName (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
201
An object containing a group object
-
400
Name is invalid string or shorter than length 1
-
401
Unauthorized
-
0
General error
-
*/
public okhttp3.Call createGroupCall(GroupName groupName, 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 = groupName;
// create path and map variables
String localVarPath = "/phonebook/groups";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "basicAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createGroupValidateBeforeCall(GroupName groupName, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'groupName' is set
if (groupName == null) {
throw new ApiException("Missing the required parameter 'groupName' when calling createGroup(Async)");
}
return createGroupCall(groupName, _callback);
}
/**
* Creates a new group with the provided name
*
* @param groupName (required)
* @return GroupEnvelope
* @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
201
An object containing a group object
-
400
Name is invalid string or shorter than length 1
-
401
Unauthorized
-
0
General error
-
*/
public GroupEnvelope createGroup(GroupName groupName) throws ApiException {
ApiResponse localVarResp = createGroupWithHttpInfo(groupName);
return localVarResp.getData();
}
/**
* Creates a new group with the provided name
*
* @param groupName (required)
* @return ApiResponse<GroupEnvelope>
* @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
201
An object containing a group object
-
400
Name is invalid string or shorter than length 1
-
401
Unauthorized
-
0
General error
-
*/
public ApiResponse createGroupWithHttpInfo(GroupName groupName) throws ApiException {
okhttp3.Call localVarCall = createGroupValidateBeforeCall(groupName, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Creates a new group with the provided name (asynchronously)
*
* @param groupName (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
201
An object containing a group object
-
400
Name is invalid string or shorter than length 1
-
401
Unauthorized
-
0
General error
-
*/
public okhttp3.Call createGroupAsync(GroupName groupName, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = createGroupValidateBeforeCall(groupName, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for deleteGroup
* @param groupId String in UUID format (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
204
Group deleted
-
401
Unauthorized
-
404
Group missing
-
0
General error
-
*/
public okhttp3.Call deleteGroupCall(String groupId, 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 = "/phonebook/groups/{groupId}"
.replace("{" + "groupId" + "}", localVarApiClient.escapeString(groupId.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/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[] { "basicAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteGroupValidateBeforeCall(String groupId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'groupId' is set
if (groupId == null) {
throw new ApiException("Missing the required parameter 'groupId' when calling deleteGroup(Async)");
}
return deleteGroupCall(groupId, _callback);
}
/**
* Deletes a group
*
* @param groupId String in UUID format (required)
* @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
204
Group deleted
-
401
Unauthorized
-
404
Group missing
-
0
General error
-
*/
public void deleteGroup(String groupId) throws ApiException {
deleteGroupWithHttpInfo(groupId);
}
/**
* Deletes a group
*
* @param groupId String in UUID format (required)
* @return ApiResponse<Void>
* @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
204
Group deleted
-
401
Unauthorized
-
404
Group missing
-
0
General error
-
*/
public ApiResponse deleteGroupWithHttpInfo(String groupId) throws ApiException {
okhttp3.Call localVarCall = deleteGroupValidateBeforeCall(groupId, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Deletes a group (asynchronously)
*
* @param groupId String in UUID format (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
204
Group deleted
-
401
Unauthorized
-
404
Group missing
-
0
General error
-
*/
public okhttp3.Call deleteGroupAsync(String groupId, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = deleteGroupValidateBeforeCall(groupId, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for fetchGroup
* @param groupId String in UUID format (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
An object containing a group object
-
401
Unauthorized
-
404
Missing group
-
*/
public okhttp3.Call fetchGroupCall(String groupId, 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 = "/phonebook/groups/{groupId}"
.replace("{" + "groupId" + "}", localVarApiClient.escapeString(groupId.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/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[] { "basicAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call fetchGroupValidateBeforeCall(String groupId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'groupId' is set
if (groupId == null) {
throw new ApiException("Missing the required parameter 'groupId' when calling fetchGroup(Async)");
}
return fetchGroupCall(groupId, _callback);
}
/**
* Lists a group
*
* @param groupId String in UUID format (required)
* @return GroupEnvelope
* @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
An object containing a group object
-
401
Unauthorized
-
404
Missing group
-
*/
public GroupEnvelope fetchGroup(String groupId) throws ApiException {
ApiResponse localVarResp = fetchGroupWithHttpInfo(groupId);
return localVarResp.getData();
}
/**
* Lists a group
*
* @param groupId String in UUID format (required)
* @return ApiResponse<GroupEnvelope>
* @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
An object containing a group object
-
401
Unauthorized
-
404
Missing group
-
*/
public ApiResponse fetchGroupWithHttpInfo(String groupId) throws ApiException {
okhttp3.Call localVarCall = fetchGroupValidateBeforeCall(groupId, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Lists a group (asynchronously)
*
* @param groupId String in UUID format (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
An object containing a group object
-
401
Unauthorized
-
404
Missing group
-
*/
public okhttp3.Call fetchGroupAsync(String groupId, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = fetchGroupValidateBeforeCall(groupId, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for fetchGroups
* @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
An object containing a list of group objects
-
401
Unauthorized
-
0
General error
-
*/
public okhttp3.Call fetchGroupsCall(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 = "/phonebook/groups";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"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[] { "basicAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call fetchGroupsValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return fetchGroupsCall(_callback);
}
/**
* Returns all groups
*
* @return GroupListEnvelope
* @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
An object containing a list of group objects
-
401
Unauthorized
-
0
General error
-
*/
public GroupListEnvelope fetchGroups() throws ApiException {
ApiResponse localVarResp = fetchGroupsWithHttpInfo();
return localVarResp.getData();
}
/**
* Returns all groups
*
* @return ApiResponse<GroupListEnvelope>
* @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
An object containing a list of group objects
-
401
Unauthorized
-
0
General error
-
*/
public ApiResponse fetchGroupsWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = fetchGroupsValidateBeforeCall(null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Returns all groups (asynchronously)
*
* @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
An object containing a list of group objects
-
401
Unauthorized
-
0
General error
-
*/
public okhttp3.Call fetchGroupsAsync(final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = fetchGroupsValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for updateGroup
* @param groupId String in UUID format (required)
* @param groupName (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
An object containing a group object
-
400
Name is invalid string or shorter than length 1
-
401
Unauthorized
-
404
Group missing
-
0
General error
-
*/
public okhttp3.Call updateGroupCall(String groupId, GroupName groupName, 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 = groupName;
// create path and map variables
String localVarPath = "/phonebook/groups/{groupId}"
.replace("{" + "groupId" + "}", localVarApiClient.escapeString(groupId.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/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "basicAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call updateGroupValidateBeforeCall(String groupId, GroupName groupName, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'groupId' is set
if (groupId == null) {
throw new ApiException("Missing the required parameter 'groupId' when calling updateGroup(Async)");
}
// verify the required parameter 'groupName' is set
if (groupName == null) {
throw new ApiException("Missing the required parameter 'groupName' when calling updateGroup(Async)");
}
return updateGroupCall(groupId, groupName, _callback);
}
/**
* Updates a group with the provided name
*
* @param groupId String in UUID format (required)
* @param groupName (required)
* @return GroupEnvelope
* @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
An object containing a group object
-
400
Name is invalid string or shorter than length 1
-
401
Unauthorized
-
404
Group missing
-
0
General error
-
*/
public GroupEnvelope updateGroup(String groupId, GroupName groupName) throws ApiException {
ApiResponse localVarResp = updateGroupWithHttpInfo(groupId, groupName);
return localVarResp.getData();
}
/**
* Updates a group with the provided name
*
* @param groupId String in UUID format (required)
* @param groupName (required)
* @return ApiResponse<GroupEnvelope>
* @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
An object containing a group object
-
400
Name is invalid string or shorter than length 1
-
401
Unauthorized
-
404
Group missing
-
0
General error
-
*/
public ApiResponse updateGroupWithHttpInfo(String groupId, GroupName groupName) throws ApiException {
okhttp3.Call localVarCall = updateGroupValidateBeforeCall(groupId, groupName, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Updates a group with the provided name (asynchronously)
*
* @param groupId String in UUID format (required)
* @param groupName (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
An object containing a group object
-
400
Name is invalid string or shorter than length 1
-
401
Unauthorized
-
404
Group missing
-
0
General error
-
*/
public okhttp3.Call updateGroupAsync(String groupId, GroupName groupName, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = updateGroupValidateBeforeCall(groupId, groupName, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}