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.AppKeyCreateBody;
import com.zendesk.sunshine_conversations_client.model.AppKeyListResponse;
import com.zendesk.sunshine_conversations_client.model.AppKeyResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AppKeysApi {
private ApiClient apiClient;
public AppKeysApi() {
this(Configuration.getDefaultApiClient());
}
public AppKeysApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Create App Key
* Creates an API key for the specified app. The response body will include a secret as well as its corresponding id, which you can use to generate JSON Web Tokens to securely make API calls on behalf of the app.
* @param appKeyCreateBody (required)
* @param appId Identifies the app. (required)
* @return a {@code AppKeyResponse}
* @throws ApiException if fails to make API call
*/
public AppKeyResponse createAppKey(AppKeyCreateBody appKeyCreateBody, String appId) throws ApiException {
Object localVarPostBody = appKeyCreateBody;
// verify the required parameter 'appKeyCreateBody' is set
if (appKeyCreateBody == null) {
throw new ApiException(400, "Missing the required parameter 'appKeyCreateBody' when calling createAppKey");
}
// verify the required parameter 'appId' is set
if (appId == null) {
throw new ApiException(400, "Missing the required parameter 'appId' when calling createAppKey");
}
// create path and map variables
String localVarPath = "/v2/apps/{appId}/keys".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "appId" + "\\}", apiClient.escapeString(appId.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);
}
/**
* Delete App Key
* Removes an API key.
* @param appId Identifies the app. (required)
* @param keyId The id of the key. (required)
* @return a {@code Object}
* @throws ApiException if fails to make API call
*/
public Object deleteAppKey(String appId, String keyId) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'appId' is set
if (appId == null) {
throw new ApiException(400, "Missing the required parameter 'appId' when calling deleteAppKey");
}
// verify the required parameter 'keyId' is set
if (keyId == null) {
throw new ApiException(400, "Missing the required parameter 'keyId' when calling deleteAppKey");
}
// create path and map variables
String localVarPath = "/v2/apps/{appId}/keys/{keyId}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "appId" + "\\}", apiClient.escapeString(appId.toString()))
.replaceAll("\\{" + "keyId" + "\\}", apiClient.escapeString(keyId.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 = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "basicAuth", "bearerAuth" };
GenericType