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.
/*
* Tiledb Storage Platform API
* TileDB Storage Platform REST API
*
* The version of the OpenAPI document: 1.4.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package io.tiledb.cloud.rest_api.v2.api;
import io.tiledb.cloud.rest_api.v2.ApiClient;
import io.tiledb.cloud.rest_api.v2.ApiException;
import io.tiledb.cloud.rest_api.v2.model.AccessCredentialsData;
import io.tiledb.cloud.rest_api.v2.ApiCallback;
import io.tiledb.cloud.rest_api.v2.ApiResponse;
import io.tiledb.cloud.rest_api.v2.Configuration;
import io.tiledb.cloud.rest_api.v2.Pair;
import com.google.gson.reflect.TypeToken;
import io.tiledb.cloud.rest_api.v2.model.AccessCredential;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class OrganizationApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public OrganizationApi() {
this(Configuration.getDefaultApiClient());
}
public OrganizationApi(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 addCredential
* @param namespace namespace (required)
* @param accessCredential The new credentials to be created. (required)
* @param provider Show only the credentials from this provider. This should be one of the CloudProvider enum values. (optional)
* @param type Show only the credentials of this type. This should be one of the AccessCredentialType enum values. (optional)
* @param page pagination offset (optional)
* @param perPage pagination limit (optional)
* @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
The new credential was successfully added.
-
502
Bad Gateway
-
0
error response
-
*/
public okhttp3.Call addCredentialCall(String namespace, AccessCredential accessCredential, String provider, String type, Integer page, Integer perPage, 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 = accessCredential;
// create path and map variables
String localVarPath = "/credentials/{namespace}"
.replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (provider != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("provider", provider));
}
if (type != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type));
}
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (perPage != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("per_page", perPage));
}
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[] { "ApiKeyAuth", "BasicAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call addCredentialValidateBeforeCall(String namespace, AccessCredential accessCredential, String provider, String type, Integer page, Integer perPage, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'namespace' is set
if (namespace == null) {
throw new ApiException("Missing the required parameter 'namespace' when calling addCredential(Async)");
}
// verify the required parameter 'accessCredential' is set
if (accessCredential == null) {
throw new ApiException("Missing the required parameter 'accessCredential' when calling addCredential(Async)");
}
okhttp3.Call localVarCall = addCredentialCall(namespace, accessCredential, provider, type, page, perPage, _callback);
return localVarCall;
}
/**
*
* Create a new credential for the namespace
* @param namespace namespace (required)
* @param accessCredential The new credentials to be created. (required)
* @param provider Show only the credentials from this provider. This should be one of the CloudProvider enum values. (optional)
* @param type Show only the credentials of this type. This should be one of the AccessCredentialType enum values. (optional)
* @param page pagination offset (optional)
* @param perPage pagination limit (optional)
* @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
The new credential was successfully added.
-
502
Bad Gateway
-
0
error response
-
*/
public void addCredential(String namespace, AccessCredential accessCredential, String provider, String type, Integer page, Integer perPage) throws ApiException {
addCredentialWithHttpInfo(namespace, accessCredential, provider, type, page, perPage);
}
/**
*
* Create a new credential for the namespace
* @param namespace namespace (required)
* @param accessCredential The new credentials to be created. (required)
* @param provider Show only the credentials from this provider. This should be one of the CloudProvider enum values. (optional)
* @param type Show only the credentials of this type. This should be one of the AccessCredentialType enum values. (optional)
* @param page pagination offset (optional)
* @param perPage pagination limit (optional)
* @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
The new credential was successfully added.
-
502
Bad Gateway
-
0
error response
-
*/
public ApiResponse addCredentialWithHttpInfo(String namespace, AccessCredential accessCredential, String provider, String type, Integer page, Integer perPage) throws ApiException {
okhttp3.Call localVarCall = addCredentialValidateBeforeCall(namespace, accessCredential, provider, type, page, perPage, null);
return localVarApiClient.execute(localVarCall);
}
/**
* (asynchronously)
* Create a new credential for the namespace
* @param namespace namespace (required)
* @param accessCredential The new credentials to be created. (required)
* @param provider Show only the credentials from this provider. This should be one of the CloudProvider enum values. (optional)
* @param type Show only the credentials of this type. This should be one of the AccessCredentialType enum values. (optional)
* @param page pagination offset (optional)
* @param perPage pagination limit (optional)
* @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
The new credential was successfully added.
-
502
Bad Gateway
-
0
error response
-
*/
public okhttp3.Call addCredentialAsync(String namespace, AccessCredential accessCredential, String provider, String type, Integer page, Integer perPage, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = addCredentialValidateBeforeCall(namespace, accessCredential, provider, type, page, perPage, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for deleteCredential
* @param namespace namespace (required)
* @param name A URL-safe version of the credential's user-provided name (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
The credential was deleted successfully
-
502
Bad Gateway
-
0
Error response
-
*/
public okhttp3.Call deleteCredentialCall(String namespace, String name, 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 = "/credentials/{namespace}/{name}"
.replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString()))
.replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.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[] { "ApiKeyAuth", "BasicAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteCredentialValidateBeforeCall(String namespace, String name, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'namespace' is set
if (namespace == null) {
throw new ApiException("Missing the required parameter 'namespace' when calling deleteCredential(Async)");
}
// verify the required parameter 'name' is set
if (name == null) {
throw new ApiException("Missing the required parameter 'name' when calling deleteCredential(Async)");
}
okhttp3.Call localVarCall = deleteCredentialCall(namespace, name, _callback);
return localVarCall;
}
/**
*
* Delete the named access credential. Any arrays still set to use this credential will use the namespace's default and may become unreachable.
* @param namespace namespace (required)
* @param name A URL-safe version of the credential's user-provided name (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
The credential was deleted successfully
-
502
Bad Gateway
-
0
Error response
-
*/
public void deleteCredential(String namespace, String name) throws ApiException {
deleteCredentialWithHttpInfo(namespace, name);
}
/**
*
* Delete the named access credential. Any arrays still set to use this credential will use the namespace's default and may become unreachable.
* @param namespace namespace (required)
* @param name A URL-safe version of the credential's user-provided name (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
The credential was deleted successfully
-
502
Bad Gateway
-
0
Error response
-
*/
public ApiResponse deleteCredentialWithHttpInfo(String namespace, String name) throws ApiException {
okhttp3.Call localVarCall = deleteCredentialValidateBeforeCall(namespace, name, null);
return localVarApiClient.execute(localVarCall);
}
/**
* (asynchronously)
* Delete the named access credential. Any arrays still set to use this credential will use the namespace's default and may become unreachable.
* @param namespace namespace (required)
* @param name A URL-safe version of the credential's user-provided name (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
The credential was deleted successfully
-
502
Bad Gateway
-
0
Error response
-
*/
public okhttp3.Call deleteCredentialAsync(String namespace, String name, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = deleteCredentialValidateBeforeCall(namespace, name, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for getCredential
* @param namespace namespace (required)
* @param name A URL-safe version of the credential's user-provided name (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
Credential exists and can be returned
-
502
Bad Gateway
-
0
error response
-
*/
public okhttp3.Call getCredentialCall(String namespace, String name, 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 = "/credentials/{namespace}/{name}"
.replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString()))
.replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.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[] { "ApiKeyAuth", "BasicAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getCredentialValidateBeforeCall(String namespace, String name, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'namespace' is set
if (namespace == null) {
throw new ApiException("Missing the required parameter 'namespace' when calling getCredential(Async)");
}
// verify the required parameter 'name' is set
if (name == null) {
throw new ApiException("Missing the required parameter 'name' when calling getCredential(Async)");
}
okhttp3.Call localVarCall = getCredentialCall(namespace, name, _callback);
return localVarCall;
}
/**
*
* Retrieve an access credential by name
* @param namespace namespace (required)
* @param name A URL-safe version of the credential's user-provided name (required)
* @return AccessCredential
* @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
Credential exists and can be returned
-
502
Bad Gateway
-
0
error response
-
*/
public AccessCredential getCredential(String namespace, String name) throws ApiException {
ApiResponse localVarResp = getCredentialWithHttpInfo(namespace, name);
return localVarResp.getData();
}
/**
*
* Retrieve an access credential by name
* @param namespace namespace (required)
* @param name A URL-safe version of the credential's user-provided name (required)
* @return ApiResponse<AccessCredential>
* @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
Credential exists and can be returned
-
502
Bad Gateway
-
0
error response
-
*/
public ApiResponse getCredentialWithHttpInfo(String namespace, String name) throws ApiException {
okhttp3.Call localVarCall = getCredentialValidateBeforeCall(namespace, name, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
* Retrieve an access credential by name
* @param namespace namespace (required)
* @param name A URL-safe version of the credential's user-provided name (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
Credential exists and can be returned
-
502
Bad Gateway
-
0
error response
-
*/
public okhttp3.Call getCredentialAsync(String namespace, String name, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getCredentialValidateBeforeCall(namespace, name, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for listCredentials
* @param namespace namespace (required)
* @param provider Show only the credentials from this provider. This should be one of the CloudProvider enum values. (optional)
* @param type Show only the credentials of this type. This should be one of the AccessCredentialType enum values. (optional)
* @param page pagination offset (optional)
* @param perPage pagination limit (optional)
* @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
Available credentials are returned
-
502
Bad Gateway
-
0
error response
-
*/
public okhttp3.Call listCredentialsCall(String namespace, String provider, String type, Integer page, Integer perPage, 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 = "/credentials/{namespace}"
.replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (provider != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("provider", provider));
}
if (type != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type));
}
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (perPage != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("per_page", perPage));
}
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[] { "ApiKeyAuth", "BasicAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call listCredentialsValidateBeforeCall(String namespace, String provider, String type, Integer page, Integer perPage, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'namespace' is set
if (namespace == null) {
throw new ApiException("Missing the required parameter 'namespace' when calling listCredentials(Async)");
}
okhttp3.Call localVarCall = listCredentialsCall(namespace, provider, type, page, perPage, _callback);
return localVarCall;
}
/**
*
* List the credentials available in the namespace
* @param namespace namespace (required)
* @param provider Show only the credentials from this provider. This should be one of the CloudProvider enum values. (optional)
* @param type Show only the credentials of this type. This should be one of the AccessCredentialType enum values. (optional)
* @param page pagination offset (optional)
* @param perPage pagination limit (optional)
* @return AccessCredentialsData
* @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
Available credentials are returned
-
502
Bad Gateway
-
0
error response
-
*/
public AccessCredentialsData listCredentials(String namespace, String provider, String type, Integer page, Integer perPage) throws ApiException {
ApiResponse localVarResp = listCredentialsWithHttpInfo(namespace, provider, type, page, perPage);
return localVarResp.getData();
}
/**
*
* List the credentials available in the namespace
* @param namespace namespace (required)
* @param provider Show only the credentials from this provider. This should be one of the CloudProvider enum values. (optional)
* @param type Show only the credentials of this type. This should be one of the AccessCredentialType enum values. (optional)
* @param page pagination offset (optional)
* @param perPage pagination limit (optional)
* @return ApiResponse<AccessCredentialsData>
* @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
Available credentials are returned
-
502
Bad Gateway
-
0
error response
-
*/
public ApiResponse listCredentialsWithHttpInfo(String namespace, String provider, String type, Integer page, Integer perPage) throws ApiException {
okhttp3.Call localVarCall = listCredentialsValidateBeforeCall(namespace, provider, type, page, perPage, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
* List the credentials available in the namespace
* @param namespace namespace (required)
* @param provider Show only the credentials from this provider. This should be one of the CloudProvider enum values. (optional)
* @param type Show only the credentials of this type. This should be one of the AccessCredentialType enum values. (optional)
* @param page pagination offset (optional)
* @param perPage pagination limit (optional)
* @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
Available credentials are returned
-
502
Bad Gateway
-
0
error response
-
*/
public okhttp3.Call listCredentialsAsync(String namespace, String provider, String type, Integer page, Integer perPage, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = listCredentialsValidateBeforeCall(namespace, provider, type, page, perPage, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for updateCredential
* @param namespace namespace (required)
* @param name A URL-safe version of the credential's user-provided name (required)
* @param accessCredential Changes to make to this credential (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
The credential was updated successfully
-
502
Bad Gateway
-
0
Error response
-
*/
public okhttp3.Call updateCredentialCall(String namespace, String name, AccessCredential accessCredential, 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 = accessCredential;
// create path and map variables
String localVarPath = "/credentials/{namespace}/{name}"
.replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString()))
.replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.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[] { "ApiKeyAuth", "BasicAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call updateCredentialValidateBeforeCall(String namespace, String name, AccessCredential accessCredential, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'namespace' is set
if (namespace == null) {
throw new ApiException("Missing the required parameter 'namespace' when calling updateCredential(Async)");
}
// verify the required parameter 'name' is set
if (name == null) {
throw new ApiException("Missing the required parameter 'name' when calling updateCredential(Async)");
}
// verify the required parameter 'accessCredential' is set
if (accessCredential == null) {
throw new ApiException("Missing the required parameter 'accessCredential' when calling updateCredential(Async)");
}
okhttp3.Call localVarCall = updateCredentialCall(namespace, name, accessCredential, _callback);
return localVarCall;
}
/**
*
* Update the named access credential. This will also update the information used to access arrays set to use this credential.
* @param namespace namespace (required)
* @param name A URL-safe version of the credential's user-provided name (required)
* @param accessCredential Changes to make to this credential (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
The credential was updated successfully
-
502
Bad Gateway
-
0
Error response
-
*/
public void updateCredential(String namespace, String name, AccessCredential accessCredential) throws ApiException {
updateCredentialWithHttpInfo(namespace, name, accessCredential);
}
/**
*
* Update the named access credential. This will also update the information used to access arrays set to use this credential.
* @param namespace namespace (required)
* @param name A URL-safe version of the credential's user-provided name (required)
* @param accessCredential Changes to make to this credential (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
The credential was updated successfully
-
502
Bad Gateway
-
0
Error response
-
*/
public ApiResponse updateCredentialWithHttpInfo(String namespace, String name, AccessCredential accessCredential) throws ApiException {
okhttp3.Call localVarCall = updateCredentialValidateBeforeCall(namespace, name, accessCredential, null);
return localVarApiClient.execute(localVarCall);
}
/**
* (asynchronously)
* Update the named access credential. This will also update the information used to access arrays set to use this credential.
* @param namespace namespace (required)
* @param name A URL-safe version of the credential's user-provided name (required)
* @param accessCredential Changes to make to this credential (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