2856 lines
135 KiB
Java
2856 lines
135 KiB
Java
/*
|
|
* Gitea API
|
|
* This documentation describes the Gitea API.
|
|
*
|
|
* OpenAPI spec version: 1.21.1
|
|
*
|
|
*
|
|
* NOTE: This class is auto generated by the swagger code generator program.
|
|
* https://github.com/swagger-api/swagger-codegen.git
|
|
* Do not edit the class manually.
|
|
*/
|
|
|
|
|
|
package io.gitea.api;
|
|
|
|
import io.gitea.ApiCallback;
|
|
import io.gitea.ApiClient;
|
|
import io.gitea.ApiException;
|
|
import io.gitea.ApiResponse;
|
|
import io.gitea.Configuration;
|
|
import io.gitea.Pair;
|
|
import io.gitea.ProgressRequestBody;
|
|
import io.gitea.ProgressResponseBody;
|
|
|
|
import com.google.gson.reflect.TypeToken;
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
import io.gitea.model.CreateHookOption;
|
|
import io.gitea.model.CreateKeyOption;
|
|
import io.gitea.model.CreateOrgOption;
|
|
import io.gitea.model.CreateRepoOption;
|
|
import io.gitea.model.CreateUserOption;
|
|
import io.gitea.model.Cron;
|
|
import io.gitea.model.EditHookOption;
|
|
import io.gitea.model.EditUserOption;
|
|
import io.gitea.model.Email;
|
|
import io.gitea.model.Hook;
|
|
import io.gitea.model.Organization;
|
|
import io.gitea.model.PublicKey;
|
|
import io.gitea.model.RenameUserOption;
|
|
import io.gitea.model.Repository;
|
|
import io.gitea.model.User;
|
|
|
|
import java.lang.reflect.Type;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
public class AdminApi {
|
|
private ApiClient apiClient;
|
|
|
|
public AdminApi() {
|
|
this(Configuration.getDefaultApiClient());
|
|
}
|
|
|
|
public AdminApi(ApiClient apiClient) {
|
|
this.apiClient = apiClient;
|
|
}
|
|
|
|
public ApiClient getApiClient() {
|
|
return apiClient;
|
|
}
|
|
|
|
public void setApiClient(ApiClient apiClient) {
|
|
this.apiClient = apiClient;
|
|
}
|
|
|
|
/**
|
|
* Build call for adminAdoptRepository
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call adminAdoptRepositoryCall(String owner, String repo, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/admin/unadopted/{owner}/{repo}"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json", "text/plain"
|
|
};
|
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
|
|
|
if(progressListener != null) {
|
|
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
|
@Override
|
|
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
|
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
|
return originalResponse.newBuilder()
|
|
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
|
.build();
|
|
}
|
|
});
|
|
}
|
|
|
|
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "TOTPHeader", "Token" };
|
|
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call adminAdoptRepositoryValidateBeforeCall(String owner, String repo, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
// verify the required parameter 'owner' is set
|
|
if (owner == null) {
|
|
throw new ApiException("Missing the required parameter 'owner' when calling adminAdoptRepository(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling adminAdoptRepository(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = adminAdoptRepositoryCall(owner, repo, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Adopt unadopted files as a repository
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public void adminAdoptRepository(String owner, String repo) throws ApiException {
|
|
adminAdoptRepositoryWithHttpInfo(owner, repo);
|
|
}
|
|
|
|
/**
|
|
* Adopt unadopted files as a repository
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @return ApiResponse<Void>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<Void> adminAdoptRepositoryWithHttpInfo(String owner, String repo) throws ApiException {
|
|
com.squareup.okhttp.Call call = adminAdoptRepositoryValidateBeforeCall(owner, repo, null, null);
|
|
return apiClient.execute(call);
|
|
}
|
|
|
|
/**
|
|
* Adopt unadopted files as a repository (asynchronously)
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (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
|
|
*/
|
|
public com.squareup.okhttp.Call adminAdoptRepositoryAsync(String owner, String repo, final ApiCallback<Void> callback) throws ApiException {
|
|
|
|
ProgressResponseBody.ProgressListener progressListener = null;
|
|
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
|
if (callback != null) {
|
|
progressListener = new ProgressResponseBody.ProgressListener() {
|
|
@Override
|
|
public void update(long bytesRead, long contentLength, boolean done) {
|
|
callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
}
|
|
};
|
|
|
|
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
@Override
|
|
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
}
|
|
};
|
|
}
|
|
|
|
com.squareup.okhttp.Call call = adminAdoptRepositoryValidateBeforeCall(owner, repo, progressListener, progressRequestListener);
|
|
apiClient.executeAsync(call, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for adminCreateHook
|
|
* @param body (required)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call adminCreateHookCall(CreateHookOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = body;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/admin/hooks";
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json"
|
|
};
|
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
|
|
|
if(progressListener != null) {
|
|
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
|
@Override
|
|
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
|
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
|
return originalResponse.newBuilder()
|
|
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
|
.build();
|
|
}
|
|
});
|
|
}
|
|
|
|
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "TOTPHeader", "Token" };
|
|
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call adminCreateHookValidateBeforeCall(CreateHookOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
// verify the required parameter 'body' is set
|
|
if (body == null) {
|
|
throw new ApiException("Missing the required parameter 'body' when calling adminCreateHook(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = adminCreateHookCall(body, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Create a hook
|
|
*
|
|
* @param body (required)
|
|
* @return Hook
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public Hook adminCreateHook(CreateHookOption body) throws ApiException {
|
|
ApiResponse<Hook> resp = adminCreateHookWithHttpInfo(body);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Create a hook
|
|
*
|
|
* @param body (required)
|
|
* @return ApiResponse<Hook>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<Hook> adminCreateHookWithHttpInfo(CreateHookOption body) throws ApiException {
|
|
com.squareup.okhttp.Call call = adminCreateHookValidateBeforeCall(body, null, null);
|
|
Type localVarReturnType = new TypeToken<Hook>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Create a hook (asynchronously)
|
|
*
|
|
* @param body (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
|
|
*/
|
|
public com.squareup.okhttp.Call adminCreateHookAsync(CreateHookOption body, final ApiCallback<Hook> callback) throws ApiException {
|
|
|
|
ProgressResponseBody.ProgressListener progressListener = null;
|
|
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
|
if (callback != null) {
|
|
progressListener = new ProgressResponseBody.ProgressListener() {
|
|
@Override
|
|
public void update(long bytesRead, long contentLength, boolean done) {
|
|
callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
}
|
|
};
|
|
|
|
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
@Override
|
|
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
}
|
|
};
|
|
}
|
|
|
|
com.squareup.okhttp.Call call = adminCreateHookValidateBeforeCall(body, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<Hook>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for adminCreateOrg
|
|
* @param username username of the user that will own the created organization (required)
|
|
* @param organization (required)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call adminCreateOrgCall(String username, CreateOrgOption organization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = organization;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/admin/users/{username}/orgs"
|
|
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json"
|
|
};
|
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
|
|
|
if(progressListener != null) {
|
|
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
|
@Override
|
|
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
|
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
|
return originalResponse.newBuilder()
|
|
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
|
.build();
|
|
}
|
|
});
|
|
}
|
|
|
|
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "TOTPHeader", "Token" };
|
|
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call adminCreateOrgValidateBeforeCall(String username, CreateOrgOption organization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
// verify the required parameter 'username' is set
|
|
if (username == null) {
|
|
throw new ApiException("Missing the required parameter 'username' when calling adminCreateOrg(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'organization' is set
|
|
if (organization == null) {
|
|
throw new ApiException("Missing the required parameter 'organization' when calling adminCreateOrg(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = adminCreateOrgCall(username, organization, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Create an organization
|
|
*
|
|
* @param username username of the user that will own the created organization (required)
|
|
* @param organization (required)
|
|
* @return Organization
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public Organization adminCreateOrg(String username, CreateOrgOption organization) throws ApiException {
|
|
ApiResponse<Organization> resp = adminCreateOrgWithHttpInfo(username, organization);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Create an organization
|
|
*
|
|
* @param username username of the user that will own the created organization (required)
|
|
* @param organization (required)
|
|
* @return ApiResponse<Organization>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<Organization> adminCreateOrgWithHttpInfo(String username, CreateOrgOption organization) throws ApiException {
|
|
com.squareup.okhttp.Call call = adminCreateOrgValidateBeforeCall(username, organization, null, null);
|
|
Type localVarReturnType = new TypeToken<Organization>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Create an organization (asynchronously)
|
|
*
|
|
* @param username username of the user that will own the created organization (required)
|
|
* @param organization (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
|
|
*/
|
|
public com.squareup.okhttp.Call adminCreateOrgAsync(String username, CreateOrgOption organization, final ApiCallback<Organization> callback) throws ApiException {
|
|
|
|
ProgressResponseBody.ProgressListener progressListener = null;
|
|
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
|
if (callback != null) {
|
|
progressListener = new ProgressResponseBody.ProgressListener() {
|
|
@Override
|
|
public void update(long bytesRead, long contentLength, boolean done) {
|
|
callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
}
|
|
};
|
|
|
|
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
@Override
|
|
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
}
|
|
};
|
|
}
|
|
|
|
com.squareup.okhttp.Call call = adminCreateOrgValidateBeforeCall(username, organization, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<Organization>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for adminCreatePublicKey
|
|
* @param username username of the user (required)
|
|
* @param key (optional)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call adminCreatePublicKeyCall(String username, CreateKeyOption key, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = key;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/admin/users/{username}/keys"
|
|
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json"
|
|
};
|
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
|
|
|
if(progressListener != null) {
|
|
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
|
@Override
|
|
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
|
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
|
return originalResponse.newBuilder()
|
|
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
|
.build();
|
|
}
|
|
});
|
|
}
|
|
|
|
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "TOTPHeader", "Token" };
|
|
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call adminCreatePublicKeyValidateBeforeCall(String username, CreateKeyOption key, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
// verify the required parameter 'username' is set
|
|
if (username == null) {
|
|
throw new ApiException("Missing the required parameter 'username' when calling adminCreatePublicKey(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = adminCreatePublicKeyCall(username, key, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Add a public key on behalf of a user
|
|
*
|
|
* @param username username of the user (required)
|
|
* @param key (optional)
|
|
* @return PublicKey
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public PublicKey adminCreatePublicKey(String username, CreateKeyOption key) throws ApiException {
|
|
ApiResponse<PublicKey> resp = adminCreatePublicKeyWithHttpInfo(username, key);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Add a public key on behalf of a user
|
|
*
|
|
* @param username username of the user (required)
|
|
* @param key (optional)
|
|
* @return ApiResponse<PublicKey>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<PublicKey> adminCreatePublicKeyWithHttpInfo(String username, CreateKeyOption key) throws ApiException {
|
|
com.squareup.okhttp.Call call = adminCreatePublicKeyValidateBeforeCall(username, key, null, null);
|
|
Type localVarReturnType = new TypeToken<PublicKey>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Add a public key on behalf of a user (asynchronously)
|
|
*
|
|
* @param username username of the user (required)
|
|
* @param key (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
|
|
*/
|
|
public com.squareup.okhttp.Call adminCreatePublicKeyAsync(String username, CreateKeyOption key, final ApiCallback<PublicKey> callback) throws ApiException {
|
|
|
|
ProgressResponseBody.ProgressListener progressListener = null;
|
|
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
|
if (callback != null) {
|
|
progressListener = new ProgressResponseBody.ProgressListener() {
|
|
@Override
|
|
public void update(long bytesRead, long contentLength, boolean done) {
|
|
callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
}
|
|
};
|
|
|
|
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
@Override
|
|
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
}
|
|
};
|
|
}
|
|
|
|
com.squareup.okhttp.Call call = adminCreatePublicKeyValidateBeforeCall(username, key, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<PublicKey>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for adminCreateRepo
|
|
* @param username username of the user. This user will own the created repository (required)
|
|
* @param repository (required)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call adminCreateRepoCall(String username, CreateRepoOption repository, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = repository;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/admin/users/{username}/repos"
|
|
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json"
|
|
};
|
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
|
|
|
if(progressListener != null) {
|
|
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
|
@Override
|
|
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
|
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
|
return originalResponse.newBuilder()
|
|
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
|
.build();
|
|
}
|
|
});
|
|
}
|
|
|
|
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "TOTPHeader", "Token" };
|
|
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call adminCreateRepoValidateBeforeCall(String username, CreateRepoOption repository, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
// verify the required parameter 'username' is set
|
|
if (username == null) {
|
|
throw new ApiException("Missing the required parameter 'username' when calling adminCreateRepo(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repository' is set
|
|
if (repository == null) {
|
|
throw new ApiException("Missing the required parameter 'repository' when calling adminCreateRepo(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = adminCreateRepoCall(username, repository, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Create a repository on behalf of a user
|
|
*
|
|
* @param username username of the user. This user will own the created repository (required)
|
|
* @param repository (required)
|
|
* @return Repository
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public Repository adminCreateRepo(String username, CreateRepoOption repository) throws ApiException {
|
|
ApiResponse<Repository> resp = adminCreateRepoWithHttpInfo(username, repository);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Create a repository on behalf of a user
|
|
*
|
|
* @param username username of the user. This user will own the created repository (required)
|
|
* @param repository (required)
|
|
* @return ApiResponse<Repository>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<Repository> adminCreateRepoWithHttpInfo(String username, CreateRepoOption repository) throws ApiException {
|
|
com.squareup.okhttp.Call call = adminCreateRepoValidateBeforeCall(username, repository, null, null);
|
|
Type localVarReturnType = new TypeToken<Repository>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Create a repository on behalf of a user (asynchronously)
|
|
*
|
|
* @param username username of the user. This user will own the created repository (required)
|
|
* @param repository (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
|
|
*/
|
|
public com.squareup.okhttp.Call adminCreateRepoAsync(String username, CreateRepoOption repository, final ApiCallback<Repository> callback) throws ApiException {
|
|
|
|
ProgressResponseBody.ProgressListener progressListener = null;
|
|
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
|
if (callback != null) {
|
|
progressListener = new ProgressResponseBody.ProgressListener() {
|
|
@Override
|
|
public void update(long bytesRead, long contentLength, boolean done) {
|
|
callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
}
|
|
};
|
|
|
|
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
@Override
|
|
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
}
|
|
};
|
|
}
|
|
|
|
com.squareup.okhttp.Call call = adminCreateRepoValidateBeforeCall(username, repository, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<Repository>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for adminCreateUser
|
|
* @param body (optional)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call adminCreateUserCall(CreateUserOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = body;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/admin/users";
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json"
|
|
};
|
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
|
|
|
if(progressListener != null) {
|
|
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
|
@Override
|
|
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
|
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
|
return originalResponse.newBuilder()
|
|
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
|
.build();
|
|
}
|
|
});
|
|
}
|
|
|
|
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "TOTPHeader", "Token" };
|
|
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call adminCreateUserValidateBeforeCall(CreateUserOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
|
|
com.squareup.okhttp.Call call = adminCreateUserCall(body, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Create a user
|
|
*
|
|
* @param body (optional)
|
|
* @return User
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public User adminCreateUser(CreateUserOption body) throws ApiException {
|
|
ApiResponse<User> resp = adminCreateUserWithHttpInfo(body);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Create a user
|
|
*
|
|
* @param body (optional)
|
|
* @return ApiResponse<User>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<User> adminCreateUserWithHttpInfo(CreateUserOption body) throws ApiException {
|
|
com.squareup.okhttp.Call call = adminCreateUserValidateBeforeCall(body, null, null);
|
|
Type localVarReturnType = new TypeToken<User>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Create a user (asynchronously)
|
|
*
|
|
* @param body (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
|
|
*/
|
|
public com.squareup.okhttp.Call adminCreateUserAsync(CreateUserOption body, final ApiCallback<User> callback) throws ApiException {
|
|
|
|
ProgressResponseBody.ProgressListener progressListener = null;
|
|
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
|
if (callback != null) {
|
|
progressListener = new ProgressResponseBody.ProgressListener() {
|
|
@Override
|
|
public void update(long bytesRead, long contentLength, boolean done) {
|
|
callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
}
|
|
};
|
|
|
|
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
@Override
|
|
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
}
|
|
};
|
|
}
|
|
|
|
com.squareup.okhttp.Call call = adminCreateUserValidateBeforeCall(body, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<User>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for adminCronList
|
|
* @param page page number of results to return (1-based) (optional)
|
|
* @param limit page size of results (optional)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call adminCronListCall(Integer page, Integer limit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/admin/cron";
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
if (page != null)
|
|
localVarQueryParams.addAll(apiClient.parameterToPair("page", page));
|
|
if (limit != null)
|
|
localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json", "text/plain"
|
|
};
|
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
|
|
|
if(progressListener != null) {
|
|
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
|
@Override
|
|
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
|
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
|
return originalResponse.newBuilder()
|
|
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
|
.build();
|
|
}
|
|
});
|
|
}
|
|
|
|
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "TOTPHeader", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call adminCronListValidateBeforeCall(Integer page, Integer limit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
|
|
com.squareup.okhttp.Call call = adminCronListCall(page, limit, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* List cron tasks
|
|
*
|
|
* @param page page number of results to return (1-based) (optional)
|
|
* @param limit page size of results (optional)
|
|
* @return List<Cron>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<Cron> adminCronList(Integer page, Integer limit) throws ApiException {
|
|
ApiResponse<List<Cron>> resp = adminCronListWithHttpInfo(page, limit);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* List cron tasks
|
|
*
|
|
* @param page page number of results to return (1-based) (optional)
|
|
* @param limit page size of results (optional)
|
|
* @return ApiResponse<List<Cron>>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<List<Cron>> adminCronListWithHttpInfo(Integer page, Integer limit) throws ApiException {
|
|
com.squareup.okhttp.Call call = adminCronListValidateBeforeCall(page, limit, null, null);
|
|
Type localVarReturnType = new TypeToken<List<Cron>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* List cron tasks (asynchronously)
|
|
*
|
|
* @param page page number of results to return (1-based) (optional)
|
|
* @param limit page size of results (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
|
|
*/
|
|
public com.squareup.okhttp.Call adminCronListAsync(Integer page, Integer limit, final ApiCallback<List<Cron>> callback) throws ApiException {
|
|
|
|
ProgressResponseBody.ProgressListener progressListener = null;
|
|
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
|
if (callback != null) {
|
|
progressListener = new ProgressResponseBody.ProgressListener() {
|
|
@Override
|
|
public void update(long bytesRead, long contentLength, boolean done) {
|
|
callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
}
|
|
};
|
|
|
|
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
@Override
|
|
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
}
|
|
};
|
|
}
|
|
|
|
com.squareup.okhttp.Call call = adminCronListValidateBeforeCall(page, limit, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<Cron>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for adminCronRun
|
|
* @param task task to run (required)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call adminCronRunCall(String task, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/admin/cron/{task}"
|
|
.replaceAll("\\{" + "task" + "\\}", apiClient.escapeString(task.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json", "text/plain"
|
|
};
|
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
|
|
|
if(progressListener != null) {
|
|
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
|
@Override
|
|
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
|
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
|
return originalResponse.newBuilder()
|
|
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
|
.build();
|
|
}
|
|
});
|
|
}
|
|
|
|
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "TOTPHeader", "Token" };
|
|
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call adminCronRunValidateBeforeCall(String task, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
// verify the required parameter 'task' is set
|
|
if (task == null) {
|
|
throw new ApiException("Missing the required parameter 'task' when calling adminCronRun(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = adminCronRunCall(task, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Run cron task
|
|
*
|
|
* @param task task to run (required)
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public void adminCronRun(String task) throws ApiException {
|
|
adminCronRunWithHttpInfo(task);
|
|
}
|
|
|
|
/**
|
|
* Run cron task
|
|
*
|
|
* @param task task to run (required)
|
|
* @return ApiResponse<Void>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<Void> adminCronRunWithHttpInfo(String task) throws ApiException {
|
|
com.squareup.okhttp.Call call = adminCronRunValidateBeforeCall(task, null, null);
|
|
return apiClient.execute(call);
|
|
}
|
|
|
|
/**
|
|
* Run cron task (asynchronously)
|
|
*
|
|
* @param task task to run (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
|
|
*/
|
|
public com.squareup.okhttp.Call adminCronRunAsync(String task, final ApiCallback<Void> callback) throws ApiException {
|
|
|
|
ProgressResponseBody.ProgressListener progressListener = null;
|
|
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
|
if (callback != null) {
|
|
progressListener = new ProgressResponseBody.ProgressListener() {
|
|
@Override
|
|
public void update(long bytesRead, long contentLength, boolean done) {
|
|
callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
}
|
|
};
|
|
|
|
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
@Override
|
|
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
}
|
|
};
|
|
}
|
|
|
|
com.squareup.okhttp.Call call = adminCronRunValidateBeforeCall(task, progressListener, progressRequestListener);
|
|
apiClient.executeAsync(call, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for adminDeleteHook
|
|
* @param id id of the hook to delete (required)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call adminDeleteHookCall(Long id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/admin/hooks/{id}"
|
|
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json", "text/plain"
|
|
};
|
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
|
|
|
if(progressListener != null) {
|
|
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
|
@Override
|
|
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
|
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
|
return originalResponse.newBuilder()
|
|
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
|
.build();
|
|
}
|
|
});
|
|
}
|
|
|
|
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "TOTPHeader", "Token" };
|
|
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call adminDeleteHookValidateBeforeCall(Long id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
// verify the required parameter 'id' is set
|
|
if (id == null) {
|
|
throw new ApiException("Missing the required parameter 'id' when calling adminDeleteHook(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = adminDeleteHookCall(id, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Delete a hook
|
|
*
|
|
* @param id id of the hook to delete (required)
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public void adminDeleteHook(Long id) throws ApiException {
|
|
adminDeleteHookWithHttpInfo(id);
|
|
}
|
|
|
|
/**
|
|
* Delete a hook
|
|
*
|
|
* @param id id of the hook to delete (required)
|
|
* @return ApiResponse<Void>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<Void> adminDeleteHookWithHttpInfo(Long id) throws ApiException {
|
|
com.squareup.okhttp.Call call = adminDeleteHookValidateBeforeCall(id, null, null);
|
|
return apiClient.execute(call);
|
|
}
|
|
|
|
/**
|
|
* Delete a hook (asynchronously)
|
|
*
|
|
* @param id id of the hook to delete (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
|
|
*/
|
|
public com.squareup.okhttp.Call adminDeleteHookAsync(Long id, final ApiCallback<Void> callback) throws ApiException {
|
|
|
|
ProgressResponseBody.ProgressListener progressListener = null;
|
|
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
|
if (callback != null) {
|
|
progressListener = new ProgressResponseBody.ProgressListener() {
|
|
@Override
|
|
public void update(long bytesRead, long contentLength, boolean done) {
|
|
callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
}
|
|
};
|
|
|
|
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
@Override
|
|
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
}
|
|
};
|
|
}
|
|
|
|
com.squareup.okhttp.Call call = adminDeleteHookValidateBeforeCall(id, progressListener, progressRequestListener);
|
|
apiClient.executeAsync(call, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for adminDeleteUnadoptedRepository
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call adminDeleteUnadoptedRepositoryCall(String owner, String repo, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/admin/unadopted/{owner}/{repo}"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json", "text/plain"
|
|
};
|
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
|
|
|
if(progressListener != null) {
|
|
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
|
@Override
|
|
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
|
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
|
return originalResponse.newBuilder()
|
|
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
|
.build();
|
|
}
|
|
});
|
|
}
|
|
|
|
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "TOTPHeader", "Token" };
|
|
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call adminDeleteUnadoptedRepositoryValidateBeforeCall(String owner, String repo, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
// verify the required parameter 'owner' is set
|
|
if (owner == null) {
|
|
throw new ApiException("Missing the required parameter 'owner' when calling adminDeleteUnadoptedRepository(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling adminDeleteUnadoptedRepository(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = adminDeleteUnadoptedRepositoryCall(owner, repo, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Delete unadopted files
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public void adminDeleteUnadoptedRepository(String owner, String repo) throws ApiException {
|
|
adminDeleteUnadoptedRepositoryWithHttpInfo(owner, repo);
|
|
}
|
|
|
|
/**
|
|
* Delete unadopted files
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @return ApiResponse<Void>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<Void> adminDeleteUnadoptedRepositoryWithHttpInfo(String owner, String repo) throws ApiException {
|
|
com.squareup.okhttp.Call call = adminDeleteUnadoptedRepositoryValidateBeforeCall(owner, repo, null, null);
|
|
return apiClient.execute(call);
|
|
}
|
|
|
|
/**
|
|
* Delete unadopted files (asynchronously)
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (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
|
|
*/
|
|
public com.squareup.okhttp.Call adminDeleteUnadoptedRepositoryAsync(String owner, String repo, final ApiCallback<Void> callback) throws ApiException {
|
|
|
|
ProgressResponseBody.ProgressListener progressListener = null;
|
|
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
|
if (callback != null) {
|
|
progressListener = new ProgressResponseBody.ProgressListener() {
|
|
@Override
|
|
public void update(long bytesRead, long contentLength, boolean done) {
|
|
callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
}
|
|
};
|
|
|
|
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
@Override
|
|
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
}
|
|
};
|
|
}
|
|
|
|
com.squareup.okhttp.Call call = adminDeleteUnadoptedRepositoryValidateBeforeCall(owner, repo, progressListener, progressRequestListener);
|
|
apiClient.executeAsync(call, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for adminDeleteUser
|
|
* @param username username of user to delete (required)
|
|
* @param purge purge the user from the system completely (optional)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call adminDeleteUserCall(String username, Boolean purge, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/admin/users/{username}"
|
|
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
if (purge != null)
|
|
localVarQueryParams.addAll(apiClient.parameterToPair("purge", purge));
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json", "text/plain"
|
|
};
|
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
|
|
|
if(progressListener != null) {
|
|
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
|
@Override
|
|
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
|
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
|
return originalResponse.newBuilder()
|
|
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
|
.build();
|
|
}
|
|
});
|
|
}
|
|
|
|
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "TOTPHeader", "Token" };
|
|
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call adminDeleteUserValidateBeforeCall(String username, Boolean purge, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
// verify the required parameter 'username' is set
|
|
if (username == null) {
|
|
throw new ApiException("Missing the required parameter 'username' when calling adminDeleteUser(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = adminDeleteUserCall(username, purge, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Delete a user
|
|
*
|
|
* @param username username of user to delete (required)
|
|
* @param purge purge the user from the system completely (optional)
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public void adminDeleteUser(String username, Boolean purge) throws ApiException {
|
|
adminDeleteUserWithHttpInfo(username, purge);
|
|
}
|
|
|
|
/**
|
|
* Delete a user
|
|
*
|
|
* @param username username of user to delete (required)
|
|
* @param purge purge the user from the system completely (optional)
|
|
* @return ApiResponse<Void>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<Void> adminDeleteUserWithHttpInfo(String username, Boolean purge) throws ApiException {
|
|
com.squareup.okhttp.Call call = adminDeleteUserValidateBeforeCall(username, purge, null, null);
|
|
return apiClient.execute(call);
|
|
}
|
|
|
|
/**
|
|
* Delete a user (asynchronously)
|
|
*
|
|
* @param username username of user to delete (required)
|
|
* @param purge purge the user from the system completely (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
|
|
*/
|
|
public com.squareup.okhttp.Call adminDeleteUserAsync(String username, Boolean purge, final ApiCallback<Void> callback) throws ApiException {
|
|
|
|
ProgressResponseBody.ProgressListener progressListener = null;
|
|
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
|
if (callback != null) {
|
|
progressListener = new ProgressResponseBody.ProgressListener() {
|
|
@Override
|
|
public void update(long bytesRead, long contentLength, boolean done) {
|
|
callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
}
|
|
};
|
|
|
|
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
@Override
|
|
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
}
|
|
};
|
|
}
|
|
|
|
com.squareup.okhttp.Call call = adminDeleteUserValidateBeforeCall(username, purge, progressListener, progressRequestListener);
|
|
apiClient.executeAsync(call, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for adminDeleteUserPublicKey
|
|
* @param username username of user (required)
|
|
* @param id id of the key to delete (required)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call adminDeleteUserPublicKeyCall(String username, Long id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/admin/users/{username}/keys/{id}"
|
|
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()))
|
|
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json", "text/plain"
|
|
};
|
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
|
|
|
if(progressListener != null) {
|
|
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
|
@Override
|
|
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
|
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
|
return originalResponse.newBuilder()
|
|
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
|
.build();
|
|
}
|
|
});
|
|
}
|
|
|
|
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "TOTPHeader", "Token" };
|
|
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call adminDeleteUserPublicKeyValidateBeforeCall(String username, Long id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
// verify the required parameter 'username' is set
|
|
if (username == null) {
|
|
throw new ApiException("Missing the required parameter 'username' when calling adminDeleteUserPublicKey(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'id' is set
|
|
if (id == null) {
|
|
throw new ApiException("Missing the required parameter 'id' when calling adminDeleteUserPublicKey(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = adminDeleteUserPublicKeyCall(username, id, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Delete a user's public key
|
|
*
|
|
* @param username username of user (required)
|
|
* @param id id of the key to delete (required)
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public void adminDeleteUserPublicKey(String username, Long id) throws ApiException {
|
|
adminDeleteUserPublicKeyWithHttpInfo(username, id);
|
|
}
|
|
|
|
/**
|
|
* Delete a user's public key
|
|
*
|
|
* @param username username of user (required)
|
|
* @param id id of the key to delete (required)
|
|
* @return ApiResponse<Void>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<Void> adminDeleteUserPublicKeyWithHttpInfo(String username, Long id) throws ApiException {
|
|
com.squareup.okhttp.Call call = adminDeleteUserPublicKeyValidateBeforeCall(username, id, null, null);
|
|
return apiClient.execute(call);
|
|
}
|
|
|
|
/**
|
|
* Delete a user's public key (asynchronously)
|
|
*
|
|
* @param username username of user (required)
|
|
* @param id id of the key to delete (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
|
|
*/
|
|
public com.squareup.okhttp.Call adminDeleteUserPublicKeyAsync(String username, Long id, final ApiCallback<Void> callback) throws ApiException {
|
|
|
|
ProgressResponseBody.ProgressListener progressListener = null;
|
|
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
|
if (callback != null) {
|
|
progressListener = new ProgressResponseBody.ProgressListener() {
|
|
@Override
|
|
public void update(long bytesRead, long contentLength, boolean done) {
|
|
callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
}
|
|
};
|
|
|
|
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
@Override
|
|
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
}
|
|
};
|
|
}
|
|
|
|
com.squareup.okhttp.Call call = adminDeleteUserPublicKeyValidateBeforeCall(username, id, progressListener, progressRequestListener);
|
|
apiClient.executeAsync(call, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for adminEditHook
|
|
* @param id id of the hook to update (required)
|
|
* @param body (optional)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call adminEditHookCall(Long id, EditHookOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = body;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/admin/hooks/{id}"
|
|
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json"
|
|
};
|
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
|
|
|
if(progressListener != null) {
|
|
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
|
@Override
|
|
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
|
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
|
return originalResponse.newBuilder()
|
|
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
|
.build();
|
|
}
|
|
});
|
|
}
|
|
|
|
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "TOTPHeader", "Token" };
|
|
return apiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call adminEditHookValidateBeforeCall(Long id, EditHookOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
// verify the required parameter 'id' is set
|
|
if (id == null) {
|
|
throw new ApiException("Missing the required parameter 'id' when calling adminEditHook(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = adminEditHookCall(id, body, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Update a hook
|
|
*
|
|
* @param id id of the hook to update (required)
|
|
* @param body (optional)
|
|
* @return Hook
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public Hook adminEditHook(Long id, EditHookOption body) throws ApiException {
|
|
ApiResponse<Hook> resp = adminEditHookWithHttpInfo(id, body);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Update a hook
|
|
*
|
|
* @param id id of the hook to update (required)
|
|
* @param body (optional)
|
|
* @return ApiResponse<Hook>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<Hook> adminEditHookWithHttpInfo(Long id, EditHookOption body) throws ApiException {
|
|
com.squareup.okhttp.Call call = adminEditHookValidateBeforeCall(id, body, null, null);
|
|
Type localVarReturnType = new TypeToken<Hook>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Update a hook (asynchronously)
|
|
*
|
|
* @param id id of the hook to update (required)
|
|
* @param body (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
|
|
*/
|
|
public com.squareup.okhttp.Call adminEditHookAsync(Long id, EditHookOption body, final ApiCallback<Hook> callback) throws ApiException {
|
|
|
|
ProgressResponseBody.ProgressListener progressListener = null;
|
|
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
|
if (callback != null) {
|
|
progressListener = new ProgressResponseBody.ProgressListener() {
|
|
@Override
|
|
public void update(long bytesRead, long contentLength, boolean done) {
|
|
callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
}
|
|
};
|
|
|
|
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
@Override
|
|
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
}
|
|
};
|
|
}
|
|
|
|
com.squareup.okhttp.Call call = adminEditHookValidateBeforeCall(id, body, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<Hook>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for adminEditUser
|
|
* @param username username of user to edit (required)
|
|
* @param body (optional)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call adminEditUserCall(String username, EditUserOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = body;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/admin/users/{username}"
|
|
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json"
|
|
};
|
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
|
|
|
if(progressListener != null) {
|
|
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
|
@Override
|
|
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
|
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
|
return originalResponse.newBuilder()
|
|
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
|
.build();
|
|
}
|
|
});
|
|
}
|
|
|
|
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "TOTPHeader", "Token" };
|
|
return apiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call adminEditUserValidateBeforeCall(String username, EditUserOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
// verify the required parameter 'username' is set
|
|
if (username == null) {
|
|
throw new ApiException("Missing the required parameter 'username' when calling adminEditUser(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = adminEditUserCall(username, body, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Edit an existing user
|
|
*
|
|
* @param username username of user to edit (required)
|
|
* @param body (optional)
|
|
* @return User
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public User adminEditUser(String username, EditUserOption body) throws ApiException {
|
|
ApiResponse<User> resp = adminEditUserWithHttpInfo(username, body);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Edit an existing user
|
|
*
|
|
* @param username username of user to edit (required)
|
|
* @param body (optional)
|
|
* @return ApiResponse<User>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<User> adminEditUserWithHttpInfo(String username, EditUserOption body) throws ApiException {
|
|
com.squareup.okhttp.Call call = adminEditUserValidateBeforeCall(username, body, null, null);
|
|
Type localVarReturnType = new TypeToken<User>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Edit an existing user (asynchronously)
|
|
*
|
|
* @param username username of user to edit (required)
|
|
* @param body (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
|
|
*/
|
|
public com.squareup.okhttp.Call adminEditUserAsync(String username, EditUserOption body, final ApiCallback<User> callback) throws ApiException {
|
|
|
|
ProgressResponseBody.ProgressListener progressListener = null;
|
|
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
|
if (callback != null) {
|
|
progressListener = new ProgressResponseBody.ProgressListener() {
|
|
@Override
|
|
public void update(long bytesRead, long contentLength, boolean done) {
|
|
callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
}
|
|
};
|
|
|
|
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
@Override
|
|
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
}
|
|
};
|
|
}
|
|
|
|
com.squareup.okhttp.Call call = adminEditUserValidateBeforeCall(username, body, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<User>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for adminGetAllEmails
|
|
* @param page page number of results to return (1-based) (optional)
|
|
* @param limit page size of results (optional)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call adminGetAllEmailsCall(Integer page, Integer limit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/admin/emails";
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
if (page != null)
|
|
localVarQueryParams.addAll(apiClient.parameterToPair("page", page));
|
|
if (limit != null)
|
|
localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json", "text/plain"
|
|
};
|
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
|
|
|
if(progressListener != null) {
|
|
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
|
@Override
|
|
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
|
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
|
return originalResponse.newBuilder()
|
|
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
|
.build();
|
|
}
|
|
});
|
|
}
|
|
|
|
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "TOTPHeader", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call adminGetAllEmailsValidateBeforeCall(Integer page, Integer limit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
|
|
com.squareup.okhttp.Call call = adminGetAllEmailsCall(page, limit, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* List all emails
|
|
*
|
|
* @param page page number of results to return (1-based) (optional)
|
|
* @param limit page size of results (optional)
|
|
* @return List<Email>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<Email> adminGetAllEmails(Integer page, Integer limit) throws ApiException {
|
|
ApiResponse<List<Email>> resp = adminGetAllEmailsWithHttpInfo(page, limit);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* List all emails
|
|
*
|
|
* @param page page number of results to return (1-based) (optional)
|
|
* @param limit page size of results (optional)
|
|
* @return ApiResponse<List<Email>>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<List<Email>> adminGetAllEmailsWithHttpInfo(Integer page, Integer limit) throws ApiException {
|
|
com.squareup.okhttp.Call call = adminGetAllEmailsValidateBeforeCall(page, limit, null, null);
|
|
Type localVarReturnType = new TypeToken<List<Email>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* List all emails (asynchronously)
|
|
*
|
|
* @param page page number of results to return (1-based) (optional)
|
|
* @param limit page size of results (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
|
|
*/
|
|
public com.squareup.okhttp.Call adminGetAllEmailsAsync(Integer page, Integer limit, final ApiCallback<List<Email>> callback) throws ApiException {
|
|
|
|
ProgressResponseBody.ProgressListener progressListener = null;
|
|
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
|
if (callback != null) {
|
|
progressListener = new ProgressResponseBody.ProgressListener() {
|
|
@Override
|
|
public void update(long bytesRead, long contentLength, boolean done) {
|
|
callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
}
|
|
};
|
|
|
|
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
@Override
|
|
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
}
|
|
};
|
|
}
|
|
|
|
com.squareup.okhttp.Call call = adminGetAllEmailsValidateBeforeCall(page, limit, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<Email>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for adminGetAllOrgs
|
|
* @param page page number of results to return (1-based) (optional)
|
|
* @param limit page size of results (optional)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call adminGetAllOrgsCall(Integer page, Integer limit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/admin/orgs";
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
if (page != null)
|
|
localVarQueryParams.addAll(apiClient.parameterToPair("page", page));
|
|
if (limit != null)
|
|
localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json", "text/plain"
|
|
};
|
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
|
|
|
if(progressListener != null) {
|
|
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
|
@Override
|
|
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
|
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
|
return originalResponse.newBuilder()
|
|
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
|
.build();
|
|
}
|
|
});
|
|
}
|
|
|
|
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "TOTPHeader", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call adminGetAllOrgsValidateBeforeCall(Integer page, Integer limit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
|
|
com.squareup.okhttp.Call call = adminGetAllOrgsCall(page, limit, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* List all organizations
|
|
*
|
|
* @param page page number of results to return (1-based) (optional)
|
|
* @param limit page size of results (optional)
|
|
* @return List<Organization>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<Organization> adminGetAllOrgs(Integer page, Integer limit) throws ApiException {
|
|
ApiResponse<List<Organization>> resp = adminGetAllOrgsWithHttpInfo(page, limit);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* List all organizations
|
|
*
|
|
* @param page page number of results to return (1-based) (optional)
|
|
* @param limit page size of results (optional)
|
|
* @return ApiResponse<List<Organization>>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<List<Organization>> adminGetAllOrgsWithHttpInfo(Integer page, Integer limit) throws ApiException {
|
|
com.squareup.okhttp.Call call = adminGetAllOrgsValidateBeforeCall(page, limit, null, null);
|
|
Type localVarReturnType = new TypeToken<List<Organization>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* List all organizations (asynchronously)
|
|
*
|
|
* @param page page number of results to return (1-based) (optional)
|
|
* @param limit page size of results (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
|
|
*/
|
|
public com.squareup.okhttp.Call adminGetAllOrgsAsync(Integer page, Integer limit, final ApiCallback<List<Organization>> callback) throws ApiException {
|
|
|
|
ProgressResponseBody.ProgressListener progressListener = null;
|
|
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
|
if (callback != null) {
|
|
progressListener = new ProgressResponseBody.ProgressListener() {
|
|
@Override
|
|
public void update(long bytesRead, long contentLength, boolean done) {
|
|
callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
}
|
|
};
|
|
|
|
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
@Override
|
|
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
}
|
|
};
|
|
}
|
|
|
|
com.squareup.okhttp.Call call = adminGetAllOrgsValidateBeforeCall(page, limit, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<Organization>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for adminGetHook
|
|
* @param id id of the hook to get (required)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call adminGetHookCall(Long id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/admin/hooks/{id}"
|
|
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json", "text/plain"
|
|
};
|
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
|
|
|
if(progressListener != null) {
|
|
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
|
@Override
|
|
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
|
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
|
return originalResponse.newBuilder()
|
|
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
|
.build();
|
|
}
|
|
});
|
|
}
|
|
|
|
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "TOTPHeader", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call adminGetHookValidateBeforeCall(Long id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
// verify the required parameter 'id' is set
|
|
if (id == null) {
|
|
throw new ApiException("Missing the required parameter 'id' when calling adminGetHook(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = adminGetHookCall(id, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Get a hook
|
|
*
|
|
* @param id id of the hook to get (required)
|
|
* @return Hook
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public Hook adminGetHook(Long id) throws ApiException {
|
|
ApiResponse<Hook> resp = adminGetHookWithHttpInfo(id);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Get a hook
|
|
*
|
|
* @param id id of the hook to get (required)
|
|
* @return ApiResponse<Hook>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<Hook> adminGetHookWithHttpInfo(Long id) throws ApiException {
|
|
com.squareup.okhttp.Call call = adminGetHookValidateBeforeCall(id, null, null);
|
|
Type localVarReturnType = new TypeToken<Hook>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Get a hook (asynchronously)
|
|
*
|
|
* @param id id of the hook to get (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
|
|
*/
|
|
public com.squareup.okhttp.Call adminGetHookAsync(Long id, final ApiCallback<Hook> callback) throws ApiException {
|
|
|
|
ProgressResponseBody.ProgressListener progressListener = null;
|
|
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
|
if (callback != null) {
|
|
progressListener = new ProgressResponseBody.ProgressListener() {
|
|
@Override
|
|
public void update(long bytesRead, long contentLength, boolean done) {
|
|
callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
}
|
|
};
|
|
|
|
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
@Override
|
|
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
}
|
|
};
|
|
}
|
|
|
|
com.squareup.okhttp.Call call = adminGetHookValidateBeforeCall(id, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<Hook>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for adminListHooks
|
|
* @param page page number of results to return (1-based) (optional)
|
|
* @param limit page size of results (optional)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call adminListHooksCall(Integer page, Integer limit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/admin/hooks";
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
if (page != null)
|
|
localVarQueryParams.addAll(apiClient.parameterToPair("page", page));
|
|
if (limit != null)
|
|
localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json", "text/plain"
|
|
};
|
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
|
|
|
if(progressListener != null) {
|
|
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
|
@Override
|
|
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
|
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
|
return originalResponse.newBuilder()
|
|
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
|
.build();
|
|
}
|
|
});
|
|
}
|
|
|
|
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "TOTPHeader", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call adminListHooksValidateBeforeCall(Integer page, Integer limit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
|
|
com.squareup.okhttp.Call call = adminListHooksCall(page, limit, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* List system's webhooks
|
|
*
|
|
* @param page page number of results to return (1-based) (optional)
|
|
* @param limit page size of results (optional)
|
|
* @return List<Hook>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<Hook> adminListHooks(Integer page, Integer limit) throws ApiException {
|
|
ApiResponse<List<Hook>> resp = adminListHooksWithHttpInfo(page, limit);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* List system's webhooks
|
|
*
|
|
* @param page page number of results to return (1-based) (optional)
|
|
* @param limit page size of results (optional)
|
|
* @return ApiResponse<List<Hook>>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<List<Hook>> adminListHooksWithHttpInfo(Integer page, Integer limit) throws ApiException {
|
|
com.squareup.okhttp.Call call = adminListHooksValidateBeforeCall(page, limit, null, null);
|
|
Type localVarReturnType = new TypeToken<List<Hook>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* List system's webhooks (asynchronously)
|
|
*
|
|
* @param page page number of results to return (1-based) (optional)
|
|
* @param limit page size of results (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
|
|
*/
|
|
public com.squareup.okhttp.Call adminListHooksAsync(Integer page, Integer limit, final ApiCallback<List<Hook>> callback) throws ApiException {
|
|
|
|
ProgressResponseBody.ProgressListener progressListener = null;
|
|
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
|
if (callback != null) {
|
|
progressListener = new ProgressResponseBody.ProgressListener() {
|
|
@Override
|
|
public void update(long bytesRead, long contentLength, boolean done) {
|
|
callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
}
|
|
};
|
|
|
|
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
@Override
|
|
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
}
|
|
};
|
|
}
|
|
|
|
com.squareup.okhttp.Call call = adminListHooksValidateBeforeCall(page, limit, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<Hook>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for adminRenameUser
|
|
* @param username existing username of user (required)
|
|
* @param body (required)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call adminRenameUserCall(String username, RenameUserOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = body;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/admin/users/{username}/rename"
|
|
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json", "text/plain"
|
|
};
|
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
|
|
|
if(progressListener != null) {
|
|
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
|
@Override
|
|
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
|
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
|
return originalResponse.newBuilder()
|
|
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
|
.build();
|
|
}
|
|
});
|
|
}
|
|
|
|
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "TOTPHeader", "Token" };
|
|
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call adminRenameUserValidateBeforeCall(String username, RenameUserOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
// verify the required parameter 'username' is set
|
|
if (username == null) {
|
|
throw new ApiException("Missing the required parameter 'username' when calling adminRenameUser(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'body' is set
|
|
if (body == null) {
|
|
throw new ApiException("Missing the required parameter 'body' when calling adminRenameUser(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = adminRenameUserCall(username, body, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Rename a user
|
|
*
|
|
* @param username existing username of user (required)
|
|
* @param body (required)
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public void adminRenameUser(String username, RenameUserOption body) throws ApiException {
|
|
adminRenameUserWithHttpInfo(username, body);
|
|
}
|
|
|
|
/**
|
|
* Rename a user
|
|
*
|
|
* @param username existing username of user (required)
|
|
* @param body (required)
|
|
* @return ApiResponse<Void>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<Void> adminRenameUserWithHttpInfo(String username, RenameUserOption body) throws ApiException {
|
|
com.squareup.okhttp.Call call = adminRenameUserValidateBeforeCall(username, body, null, null);
|
|
return apiClient.execute(call);
|
|
}
|
|
|
|
/**
|
|
* Rename a user (asynchronously)
|
|
*
|
|
* @param username existing username of user (required)
|
|
* @param body (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
|
|
*/
|
|
public com.squareup.okhttp.Call adminRenameUserAsync(String username, RenameUserOption body, final ApiCallback<Void> callback) throws ApiException {
|
|
|
|
ProgressResponseBody.ProgressListener progressListener = null;
|
|
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
|
if (callback != null) {
|
|
progressListener = new ProgressResponseBody.ProgressListener() {
|
|
@Override
|
|
public void update(long bytesRead, long contentLength, boolean done) {
|
|
callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
}
|
|
};
|
|
|
|
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
@Override
|
|
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
}
|
|
};
|
|
}
|
|
|
|
com.squareup.okhttp.Call call = adminRenameUserValidateBeforeCall(username, body, progressListener, progressRequestListener);
|
|
apiClient.executeAsync(call, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for adminSearchEmails
|
|
* @param q keyword (optional)
|
|
* @param page page number of results to return (1-based) (optional)
|
|
* @param limit page size of results (optional)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call adminSearchEmailsCall(String q, Integer page, Integer limit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/admin/emails/search";
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
if (q != null)
|
|
localVarQueryParams.addAll(apiClient.parameterToPair("q", q));
|
|
if (page != null)
|
|
localVarQueryParams.addAll(apiClient.parameterToPair("page", page));
|
|
if (limit != null)
|
|
localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json", "text/plain"
|
|
};
|
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
|
|
|
if(progressListener != null) {
|
|
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
|
@Override
|
|
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
|
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
|
return originalResponse.newBuilder()
|
|
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
|
.build();
|
|
}
|
|
});
|
|
}
|
|
|
|
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "TOTPHeader", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call adminSearchEmailsValidateBeforeCall(String q, Integer page, Integer limit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
|
|
com.squareup.okhttp.Call call = adminSearchEmailsCall(q, page, limit, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Search all emails
|
|
*
|
|
* @param q keyword (optional)
|
|
* @param page page number of results to return (1-based) (optional)
|
|
* @param limit page size of results (optional)
|
|
* @return List<Email>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<Email> adminSearchEmails(String q, Integer page, Integer limit) throws ApiException {
|
|
ApiResponse<List<Email>> resp = adminSearchEmailsWithHttpInfo(q, page, limit);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Search all emails
|
|
*
|
|
* @param q keyword (optional)
|
|
* @param page page number of results to return (1-based) (optional)
|
|
* @param limit page size of results (optional)
|
|
* @return ApiResponse<List<Email>>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<List<Email>> adminSearchEmailsWithHttpInfo(String q, Integer page, Integer limit) throws ApiException {
|
|
com.squareup.okhttp.Call call = adminSearchEmailsValidateBeforeCall(q, page, limit, null, null);
|
|
Type localVarReturnType = new TypeToken<List<Email>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Search all emails (asynchronously)
|
|
*
|
|
* @param q keyword (optional)
|
|
* @param page page number of results to return (1-based) (optional)
|
|
* @param limit page size of results (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
|
|
*/
|
|
public com.squareup.okhttp.Call adminSearchEmailsAsync(String q, Integer page, Integer limit, final ApiCallback<List<Email>> callback) throws ApiException {
|
|
|
|
ProgressResponseBody.ProgressListener progressListener = null;
|
|
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
|
if (callback != null) {
|
|
progressListener = new ProgressResponseBody.ProgressListener() {
|
|
@Override
|
|
public void update(long bytesRead, long contentLength, boolean done) {
|
|
callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
}
|
|
};
|
|
|
|
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
@Override
|
|
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
}
|
|
};
|
|
}
|
|
|
|
com.squareup.okhttp.Call call = adminSearchEmailsValidateBeforeCall(q, page, limit, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<Email>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for adminSearchUsers
|
|
* @param sourceId ID of the user's login source to search for (optional)
|
|
* @param loginName user's login name to search for (optional)
|
|
* @param page page number of results to return (1-based) (optional)
|
|
* @param limit page size of results (optional)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call adminSearchUsersCall(Long sourceId, String loginName, Integer page, Integer limit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/admin/users";
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
if (sourceId != null)
|
|
localVarQueryParams.addAll(apiClient.parameterToPair("source_id", sourceId));
|
|
if (loginName != null)
|
|
localVarQueryParams.addAll(apiClient.parameterToPair("login_name", loginName));
|
|
if (page != null)
|
|
localVarQueryParams.addAll(apiClient.parameterToPair("page", page));
|
|
if (limit != null)
|
|
localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json", "text/plain"
|
|
};
|
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
|
|
|
if(progressListener != null) {
|
|
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
|
@Override
|
|
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
|
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
|
return originalResponse.newBuilder()
|
|
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
|
.build();
|
|
}
|
|
});
|
|
}
|
|
|
|
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "TOTPHeader", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call adminSearchUsersValidateBeforeCall(Long sourceId, String loginName, Integer page, Integer limit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
|
|
com.squareup.okhttp.Call call = adminSearchUsersCall(sourceId, loginName, page, limit, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Search users according filter conditions
|
|
*
|
|
* @param sourceId ID of the user's login source to search for (optional)
|
|
* @param loginName user's login name to search for (optional)
|
|
* @param page page number of results to return (1-based) (optional)
|
|
* @param limit page size of results (optional)
|
|
* @return List<User>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<User> adminSearchUsers(Long sourceId, String loginName, Integer page, Integer limit) throws ApiException {
|
|
ApiResponse<List<User>> resp = adminSearchUsersWithHttpInfo(sourceId, loginName, page, limit);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Search users according filter conditions
|
|
*
|
|
* @param sourceId ID of the user's login source to search for (optional)
|
|
* @param loginName user's login name to search for (optional)
|
|
* @param page page number of results to return (1-based) (optional)
|
|
* @param limit page size of results (optional)
|
|
* @return ApiResponse<List<User>>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<List<User>> adminSearchUsersWithHttpInfo(Long sourceId, String loginName, Integer page, Integer limit) throws ApiException {
|
|
com.squareup.okhttp.Call call = adminSearchUsersValidateBeforeCall(sourceId, loginName, page, limit, null, null);
|
|
Type localVarReturnType = new TypeToken<List<User>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Search users according filter conditions (asynchronously)
|
|
*
|
|
* @param sourceId ID of the user's login source to search for (optional)
|
|
* @param loginName user's login name to search for (optional)
|
|
* @param page page number of results to return (1-based) (optional)
|
|
* @param limit page size of results (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
|
|
*/
|
|
public com.squareup.okhttp.Call adminSearchUsersAsync(Long sourceId, String loginName, Integer page, Integer limit, final ApiCallback<List<User>> callback) throws ApiException {
|
|
|
|
ProgressResponseBody.ProgressListener progressListener = null;
|
|
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
|
if (callback != null) {
|
|
progressListener = new ProgressResponseBody.ProgressListener() {
|
|
@Override
|
|
public void update(long bytesRead, long contentLength, boolean done) {
|
|
callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
}
|
|
};
|
|
|
|
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
@Override
|
|
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
}
|
|
};
|
|
}
|
|
|
|
com.squareup.okhttp.Call call = adminSearchUsersValidateBeforeCall(sourceId, loginName, page, limit, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<User>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for adminUnadoptedList
|
|
* @param page page number of results to return (1-based) (optional)
|
|
* @param limit page size of results (optional)
|
|
* @param pattern pattern of repositories to search for (optional)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call adminUnadoptedListCall(Integer page, Integer limit, String pattern, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/admin/unadopted";
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
if (page != null)
|
|
localVarQueryParams.addAll(apiClient.parameterToPair("page", page));
|
|
if (limit != null)
|
|
localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));
|
|
if (pattern != null)
|
|
localVarQueryParams.addAll(apiClient.parameterToPair("pattern", pattern));
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json", "text/plain"
|
|
};
|
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
|
|
|
if(progressListener != null) {
|
|
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
|
@Override
|
|
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
|
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
|
return originalResponse.newBuilder()
|
|
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
|
.build();
|
|
}
|
|
});
|
|
}
|
|
|
|
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "TOTPHeader", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call adminUnadoptedListValidateBeforeCall(Integer page, Integer limit, String pattern, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
|
|
com.squareup.okhttp.Call call = adminUnadoptedListCall(page, limit, pattern, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* List unadopted repositories
|
|
*
|
|
* @param page page number of results to return (1-based) (optional)
|
|
* @param limit page size of results (optional)
|
|
* @param pattern pattern of repositories to search for (optional)
|
|
* @return List<String>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<String> adminUnadoptedList(Integer page, Integer limit, String pattern) throws ApiException {
|
|
ApiResponse<List<String>> resp = adminUnadoptedListWithHttpInfo(page, limit, pattern);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* List unadopted repositories
|
|
*
|
|
* @param page page number of results to return (1-based) (optional)
|
|
* @param limit page size of results (optional)
|
|
* @param pattern pattern of repositories to search for (optional)
|
|
* @return ApiResponse<List<String>>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<List<String>> adminUnadoptedListWithHttpInfo(Integer page, Integer limit, String pattern) throws ApiException {
|
|
com.squareup.okhttp.Call call = adminUnadoptedListValidateBeforeCall(page, limit, pattern, null, null);
|
|
Type localVarReturnType = new TypeToken<List<String>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* List unadopted repositories (asynchronously)
|
|
*
|
|
* @param page page number of results to return (1-based) (optional)
|
|
* @param limit page size of results (optional)
|
|
* @param pattern pattern of repositories to search for (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
|
|
*/
|
|
public com.squareup.okhttp.Call adminUnadoptedListAsync(Integer page, Integer limit, String pattern, final ApiCallback<List<String>> callback) throws ApiException {
|
|
|
|
ProgressResponseBody.ProgressListener progressListener = null;
|
|
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
|
if (callback != null) {
|
|
progressListener = new ProgressResponseBody.ProgressListener() {
|
|
@Override
|
|
public void update(long bytesRead, long contentLength, boolean done) {
|
|
callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
}
|
|
};
|
|
|
|
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
@Override
|
|
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
}
|
|
};
|
|
}
|
|
|
|
com.squareup.okhttp.Call call = adminUnadoptedListValidateBeforeCall(page, limit, pattern, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<String>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
}
|