5021 lines
235 KiB
Java
5021 lines
235 KiB
Java
/*
|
|
* Gitea API.
|
|
* This documentation describes the Gitea API.
|
|
*
|
|
* OpenAPI spec version: 1.1.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.AccessToken;
|
|
import io.gitea.model.CreateEmailOption;
|
|
import io.gitea.model.CreateGPGKeyOption;
|
|
import io.gitea.model.CreateKeyOption;
|
|
import io.gitea.model.CreateRepoOption;
|
|
import io.gitea.model.DeleteEmailOption;
|
|
import io.gitea.model.Email;
|
|
import io.gitea.model.GPGKey;
|
|
import io.gitea.model.InlineResponse2001;
|
|
import io.gitea.model.PublicKey;
|
|
import io.gitea.model.Repository;
|
|
import io.gitea.model.Team;
|
|
import io.gitea.model.TrackedTime;
|
|
import io.gitea.model.User;
|
|
import io.gitea.model.UserHeatmapData;
|
|
|
|
import java.lang.reflect.Type;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
public class UserApi {
|
|
private ApiClient apiClient;
|
|
|
|
public UserApi() {
|
|
this(Configuration.getDefaultApiClient());
|
|
}
|
|
|
|
public UserApi(ApiClient apiClient) {
|
|
this.apiClient = apiClient;
|
|
}
|
|
|
|
public ApiClient getApiClient() {
|
|
return apiClient;
|
|
}
|
|
|
|
public void setApiClient(ApiClient apiClient) {
|
|
this.apiClient = apiClient;
|
|
}
|
|
|
|
/**
|
|
* Build call for createCurrentUserRepo
|
|
* @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 createCurrentUserRepoCall(CreateRepoOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = body;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/user/repos";
|
|
|
|
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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call createCurrentUserRepoValidateBeforeCall(CreateRepoOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
|
|
com.squareup.okhttp.Call call = createCurrentUserRepoCall(body, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Create a repository
|
|
*
|
|
* @param body (optional)
|
|
* @return Repository
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public Repository createCurrentUserRepo(CreateRepoOption body) throws ApiException {
|
|
ApiResponse<Repository> resp = createCurrentUserRepoWithHttpInfo(body);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Create a repository
|
|
*
|
|
* @param body (optional)
|
|
* @return ApiResponse<Repository>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<Repository> createCurrentUserRepoWithHttpInfo(CreateRepoOption body) throws ApiException {
|
|
com.squareup.okhttp.Call call = createCurrentUserRepoValidateBeforeCall(body, null, null);
|
|
Type localVarReturnType = new TypeToken<Repository>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Create a repository (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 createCurrentUserRepoAsync(CreateRepoOption body, 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 = createCurrentUserRepoValidateBeforeCall(body, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<Repository>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userAddEmail
|
|
* @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 userAddEmailCall(CreateEmailOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = body;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/user/emails";
|
|
|
|
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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userAddEmailValidateBeforeCall(CreateEmailOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
|
|
com.squareup.okhttp.Call call = userAddEmailCall(body, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Add email addresses
|
|
*
|
|
* @param body (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> userAddEmail(CreateEmailOption body) throws ApiException {
|
|
ApiResponse<List<Email>> resp = userAddEmailWithHttpInfo(body);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Add email addresses
|
|
*
|
|
* @param body (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>> userAddEmailWithHttpInfo(CreateEmailOption body) throws ApiException {
|
|
com.squareup.okhttp.Call call = userAddEmailValidateBeforeCall(body, null, null);
|
|
Type localVarReturnType = new TypeToken<List<Email>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Add email addresses (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 userAddEmailAsync(CreateEmailOption body, 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 = userAddEmailValidateBeforeCall(body, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<Email>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userCheckFollowing
|
|
* @param follower username of following user (required)
|
|
* @param followee username of followed user (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 userCheckFollowingCall(String follower, String followee, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/users/{follower}/following/{followee}"
|
|
.replaceAll("\\{" + "follower" + "\\}", apiClient.escapeString(follower.toString()))
|
|
.replaceAll("\\{" + "followee" + "\\}", apiClient.escapeString(followee.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", "text/html"
|
|
};
|
|
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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userCheckFollowingValidateBeforeCall(String follower, String followee, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
// verify the required parameter 'follower' is set
|
|
if (follower == null) {
|
|
throw new ApiException("Missing the required parameter 'follower' when calling userCheckFollowing(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'followee' is set
|
|
if (followee == null) {
|
|
throw new ApiException("Missing the required parameter 'followee' when calling userCheckFollowing(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = userCheckFollowingCall(follower, followee, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Check if one user is following another user
|
|
*
|
|
* @param follower username of following user (required)
|
|
* @param followee username of followed user (required)
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public void userCheckFollowing(String follower, String followee) throws ApiException {
|
|
userCheckFollowingWithHttpInfo(follower, followee);
|
|
}
|
|
|
|
/**
|
|
* Check if one user is following another user
|
|
*
|
|
* @param follower username of following user (required)
|
|
* @param followee username of followed user (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> userCheckFollowingWithHttpInfo(String follower, String followee) throws ApiException {
|
|
com.squareup.okhttp.Call call = userCheckFollowingValidateBeforeCall(follower, followee, null, null);
|
|
return apiClient.execute(call);
|
|
}
|
|
|
|
/**
|
|
* Check if one user is following another user (asynchronously)
|
|
*
|
|
* @param follower username of following user (required)
|
|
* @param followee username of followed user (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 userCheckFollowingAsync(String follower, String followee, 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 = userCheckFollowingValidateBeforeCall(follower, followee, progressListener, progressRequestListener);
|
|
apiClient.executeAsync(call, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userCreateToken
|
|
* @param username username of user (required)
|
|
* @param accessToken (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 userCreateTokenCall(String username, AccessToken accessToken, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = accessToken;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/users/{username}/tokens"
|
|
.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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userCreateTokenValidateBeforeCall(String username, AccessToken accessToken, 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 userCreateToken(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = userCreateTokenCall(username, accessToken, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Create an access token
|
|
*
|
|
* @param username username of user (required)
|
|
* @param accessToken (optional)
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public void userCreateToken(String username, AccessToken accessToken) throws ApiException {
|
|
userCreateTokenWithHttpInfo(username, accessToken);
|
|
}
|
|
|
|
/**
|
|
* Create an access token
|
|
*
|
|
* @param username username of user (required)
|
|
* @param accessToken (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> userCreateTokenWithHttpInfo(String username, AccessToken accessToken) throws ApiException {
|
|
com.squareup.okhttp.Call call = userCreateTokenValidateBeforeCall(username, accessToken, null, null);
|
|
return apiClient.execute(call);
|
|
}
|
|
|
|
/**
|
|
* Create an access token (asynchronously)
|
|
*
|
|
* @param username username of user (required)
|
|
* @param accessToken (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 userCreateTokenAsync(String username, AccessToken accessToken, 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 = userCreateTokenValidateBeforeCall(username, accessToken, progressListener, progressRequestListener);
|
|
apiClient.executeAsync(call, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userCurrentCheckFollowing
|
|
* @param username username of followed user (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 userCurrentCheckFollowingCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/user/following/{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", "text/html"
|
|
};
|
|
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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userCurrentCheckFollowingValidateBeforeCall(String username, 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 userCurrentCheckFollowing(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = userCurrentCheckFollowingCall(username, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Check whether a user is followed by the authenticated user
|
|
*
|
|
* @param username username of followed user (required)
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public void userCurrentCheckFollowing(String username) throws ApiException {
|
|
userCurrentCheckFollowingWithHttpInfo(username);
|
|
}
|
|
|
|
/**
|
|
* Check whether a user is followed by the authenticated user
|
|
*
|
|
* @param username username of followed user (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> userCurrentCheckFollowingWithHttpInfo(String username) throws ApiException {
|
|
com.squareup.okhttp.Call call = userCurrentCheckFollowingValidateBeforeCall(username, null, null);
|
|
return apiClient.execute(call);
|
|
}
|
|
|
|
/**
|
|
* Check whether a user is followed by the authenticated user (asynchronously)
|
|
*
|
|
* @param username username of followed user (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 userCurrentCheckFollowingAsync(String username, 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 = userCurrentCheckFollowingValidateBeforeCall(username, progressListener, progressRequestListener);
|
|
apiClient.executeAsync(call, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userCurrentCheckStarring
|
|
* @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 userCurrentCheckStarringCall(String owner, String repo, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/user/starred/{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", "text/html"
|
|
};
|
|
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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userCurrentCheckStarringValidateBeforeCall(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 userCurrentCheckStarring(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling userCurrentCheckStarring(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = userCurrentCheckStarringCall(owner, repo, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Whether the authenticated is starring the repo
|
|
*
|
|
* @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 userCurrentCheckStarring(String owner, String repo) throws ApiException {
|
|
userCurrentCheckStarringWithHttpInfo(owner, repo);
|
|
}
|
|
|
|
/**
|
|
* Whether the authenticated is starring the repo
|
|
*
|
|
* @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> userCurrentCheckStarringWithHttpInfo(String owner, String repo) throws ApiException {
|
|
com.squareup.okhttp.Call call = userCurrentCheckStarringValidateBeforeCall(owner, repo, null, null);
|
|
return apiClient.execute(call);
|
|
}
|
|
|
|
/**
|
|
* Whether the authenticated is starring the repo (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 userCurrentCheckStarringAsync(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 = userCurrentCheckStarringValidateBeforeCall(owner, repo, progressListener, progressRequestListener);
|
|
apiClient.executeAsync(call, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userCurrentDeleteFollow
|
|
* @param username username of user to unfollow (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 userCurrentDeleteFollowCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/user/following/{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", "text/html"
|
|
};
|
|
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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userCurrentDeleteFollowValidateBeforeCall(String username, 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 userCurrentDeleteFollow(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = userCurrentDeleteFollowCall(username, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Unfollow a user
|
|
*
|
|
* @param username username of user to unfollow (required)
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public void userCurrentDeleteFollow(String username) throws ApiException {
|
|
userCurrentDeleteFollowWithHttpInfo(username);
|
|
}
|
|
|
|
/**
|
|
* Unfollow a user
|
|
*
|
|
* @param username username of user to unfollow (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> userCurrentDeleteFollowWithHttpInfo(String username) throws ApiException {
|
|
com.squareup.okhttp.Call call = userCurrentDeleteFollowValidateBeforeCall(username, null, null);
|
|
return apiClient.execute(call);
|
|
}
|
|
|
|
/**
|
|
* Unfollow a user (asynchronously)
|
|
*
|
|
* @param username username of user to unfollow (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 userCurrentDeleteFollowAsync(String username, 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 = userCurrentDeleteFollowValidateBeforeCall(username, progressListener, progressRequestListener);
|
|
apiClient.executeAsync(call, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userCurrentDeleteGPGKey
|
|
* @param id id of 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 userCurrentDeleteGPGKeyCall(Long id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/user/gpg_keys/{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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userCurrentDeleteGPGKeyValidateBeforeCall(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 userCurrentDeleteGPGKey(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = userCurrentDeleteGPGKeyCall(id, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Remove a GPG key
|
|
*
|
|
* @param id id of key to delete (required)
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public void userCurrentDeleteGPGKey(Long id) throws ApiException {
|
|
userCurrentDeleteGPGKeyWithHttpInfo(id);
|
|
}
|
|
|
|
/**
|
|
* Remove a GPG key
|
|
*
|
|
* @param id id of 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> userCurrentDeleteGPGKeyWithHttpInfo(Long id) throws ApiException {
|
|
com.squareup.okhttp.Call call = userCurrentDeleteGPGKeyValidateBeforeCall(id, null, null);
|
|
return apiClient.execute(call);
|
|
}
|
|
|
|
/**
|
|
* Remove a GPG key (asynchronously)
|
|
*
|
|
* @param id id of 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 userCurrentDeleteGPGKeyAsync(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 = userCurrentDeleteGPGKeyValidateBeforeCall(id, progressListener, progressRequestListener);
|
|
apiClient.executeAsync(call, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userCurrentDeleteKey
|
|
* @param id id of 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 userCurrentDeleteKeyCall(Long id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/user/keys/{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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userCurrentDeleteKeyValidateBeforeCall(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 userCurrentDeleteKey(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = userCurrentDeleteKeyCall(id, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Delete a public key
|
|
*
|
|
* @param id id of key to delete (required)
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public void userCurrentDeleteKey(Long id) throws ApiException {
|
|
userCurrentDeleteKeyWithHttpInfo(id);
|
|
}
|
|
|
|
/**
|
|
* Delete a public key
|
|
*
|
|
* @param id id of 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> userCurrentDeleteKeyWithHttpInfo(Long id) throws ApiException {
|
|
com.squareup.okhttp.Call call = userCurrentDeleteKeyValidateBeforeCall(id, null, null);
|
|
return apiClient.execute(call);
|
|
}
|
|
|
|
/**
|
|
* Delete a public key (asynchronously)
|
|
*
|
|
* @param id id of 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 userCurrentDeleteKeyAsync(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 = userCurrentDeleteKeyValidateBeforeCall(id, progressListener, progressRequestListener);
|
|
apiClient.executeAsync(call, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userCurrentDeleteStar
|
|
* @param owner owner of the repo to unstar (required)
|
|
* @param repo name of the repo to unstar (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 userCurrentDeleteStarCall(String owner, String repo, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/user/starred/{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", "text/html"
|
|
};
|
|
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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userCurrentDeleteStarValidateBeforeCall(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 userCurrentDeleteStar(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling userCurrentDeleteStar(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = userCurrentDeleteStarCall(owner, repo, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Unstar the given repo
|
|
*
|
|
* @param owner owner of the repo to unstar (required)
|
|
* @param repo name of the repo to unstar (required)
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public void userCurrentDeleteStar(String owner, String repo) throws ApiException {
|
|
userCurrentDeleteStarWithHttpInfo(owner, repo);
|
|
}
|
|
|
|
/**
|
|
* Unstar the given repo
|
|
*
|
|
* @param owner owner of the repo to unstar (required)
|
|
* @param repo name of the repo to unstar (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> userCurrentDeleteStarWithHttpInfo(String owner, String repo) throws ApiException {
|
|
com.squareup.okhttp.Call call = userCurrentDeleteStarValidateBeforeCall(owner, repo, null, null);
|
|
return apiClient.execute(call);
|
|
}
|
|
|
|
/**
|
|
* Unstar the given repo (asynchronously)
|
|
*
|
|
* @param owner owner of the repo to unstar (required)
|
|
* @param repo name of the repo to unstar (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 userCurrentDeleteStarAsync(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 = userCurrentDeleteStarValidateBeforeCall(owner, repo, progressListener, progressRequestListener);
|
|
apiClient.executeAsync(call, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userCurrentGetGPGKey
|
|
* @param id id of key 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 userCurrentGetGPGKeyCall(Long id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/user/gpg_keys/{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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userCurrentGetGPGKeyValidateBeforeCall(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 userCurrentGetGPGKey(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = userCurrentGetGPGKeyCall(id, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Get a GPG key
|
|
*
|
|
* @param id id of key to get (required)
|
|
* @return GPGKey
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public GPGKey userCurrentGetGPGKey(Long id) throws ApiException {
|
|
ApiResponse<GPGKey> resp = userCurrentGetGPGKeyWithHttpInfo(id);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Get a GPG key
|
|
*
|
|
* @param id id of key to get (required)
|
|
* @return ApiResponse<GPGKey>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<GPGKey> userCurrentGetGPGKeyWithHttpInfo(Long id) throws ApiException {
|
|
com.squareup.okhttp.Call call = userCurrentGetGPGKeyValidateBeforeCall(id, null, null);
|
|
Type localVarReturnType = new TypeToken<GPGKey>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Get a GPG key (asynchronously)
|
|
*
|
|
* @param id id of key 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 userCurrentGetGPGKeyAsync(Long id, final ApiCallback<GPGKey> 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 = userCurrentGetGPGKeyValidateBeforeCall(id, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<GPGKey>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userCurrentGetKey
|
|
* @param id id of key 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 userCurrentGetKeyCall(Long id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/user/keys/{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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userCurrentGetKeyValidateBeforeCall(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 userCurrentGetKey(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = userCurrentGetKeyCall(id, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Get a public key
|
|
*
|
|
* @param id id of key to get (required)
|
|
* @return PublicKey
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public PublicKey userCurrentGetKey(Long id) throws ApiException {
|
|
ApiResponse<PublicKey> resp = userCurrentGetKeyWithHttpInfo(id);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Get a public key
|
|
*
|
|
* @param id id of key to get (required)
|
|
* @return ApiResponse<PublicKey>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<PublicKey> userCurrentGetKeyWithHttpInfo(Long id) throws ApiException {
|
|
com.squareup.okhttp.Call call = userCurrentGetKeyValidateBeforeCall(id, null, null);
|
|
Type localVarReturnType = new TypeToken<PublicKey>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Get a public key (asynchronously)
|
|
*
|
|
* @param id id of key 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 userCurrentGetKeyAsync(Long id, 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 = userCurrentGetKeyValidateBeforeCall(id, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<PublicKey>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userCurrentListFollowers
|
|
* @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 userCurrentListFollowersCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/user/followers";
|
|
|
|
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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userCurrentListFollowersValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
|
|
com.squareup.okhttp.Call call = userCurrentListFollowersCall(progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* List the authenticated user's followers
|
|
*
|
|
* @return List<User>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<User> userCurrentListFollowers() throws ApiException {
|
|
ApiResponse<List<User>> resp = userCurrentListFollowersWithHttpInfo();
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* List the authenticated user's followers
|
|
*
|
|
* @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>> userCurrentListFollowersWithHttpInfo() throws ApiException {
|
|
com.squareup.okhttp.Call call = userCurrentListFollowersValidateBeforeCall(null, null);
|
|
Type localVarReturnType = new TypeToken<List<User>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* List the authenticated user's followers (asynchronously)
|
|
*
|
|
* @param callback The callback to be executed when the API call finishes
|
|
* @return The request call
|
|
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call userCurrentListFollowersAsync(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 = userCurrentListFollowersValidateBeforeCall(progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<User>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userCurrentListFollowing
|
|
* @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 userCurrentListFollowingCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/user/following";
|
|
|
|
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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userCurrentListFollowingValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
|
|
com.squareup.okhttp.Call call = userCurrentListFollowingCall(progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* List the users that the authenticated user is following
|
|
*
|
|
* @return List<User>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<User> userCurrentListFollowing() throws ApiException {
|
|
ApiResponse<List<User>> resp = userCurrentListFollowingWithHttpInfo();
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* List the users that the authenticated user is following
|
|
*
|
|
* @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>> userCurrentListFollowingWithHttpInfo() throws ApiException {
|
|
com.squareup.okhttp.Call call = userCurrentListFollowingValidateBeforeCall(null, null);
|
|
Type localVarReturnType = new TypeToken<List<User>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* List the users that the authenticated user is following (asynchronously)
|
|
*
|
|
* @param callback The callback to be executed when the API call finishes
|
|
* @return The request call
|
|
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call userCurrentListFollowingAsync(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 = userCurrentListFollowingValidateBeforeCall(progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<User>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userCurrentListGPGKeys
|
|
* @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 userCurrentListGPGKeysCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/user/gpg_keys";
|
|
|
|
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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userCurrentListGPGKeysValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
|
|
com.squareup.okhttp.Call call = userCurrentListGPGKeysCall(progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* List the authenticated user's GPG keys
|
|
*
|
|
* @return List<GPGKey>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<GPGKey> userCurrentListGPGKeys() throws ApiException {
|
|
ApiResponse<List<GPGKey>> resp = userCurrentListGPGKeysWithHttpInfo();
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* List the authenticated user's GPG keys
|
|
*
|
|
* @return ApiResponse<List<GPGKey>>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<List<GPGKey>> userCurrentListGPGKeysWithHttpInfo() throws ApiException {
|
|
com.squareup.okhttp.Call call = userCurrentListGPGKeysValidateBeforeCall(null, null);
|
|
Type localVarReturnType = new TypeToken<List<GPGKey>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* List the authenticated user's GPG keys (asynchronously)
|
|
*
|
|
* @param callback The callback to be executed when the API call finishes
|
|
* @return The request call
|
|
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call userCurrentListGPGKeysAsync(final ApiCallback<List<GPGKey>> 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 = userCurrentListGPGKeysValidateBeforeCall(progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<GPGKey>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userCurrentListKeys
|
|
* @param fingerprint fingerprint of the 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 userCurrentListKeysCall(String fingerprint, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/user/keys";
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
if (fingerprint != null)
|
|
localVarQueryParams.addAll(apiClient.parameterToPair("fingerprint", fingerprint));
|
|
|
|
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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userCurrentListKeysValidateBeforeCall(String fingerprint, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
|
|
com.squareup.okhttp.Call call = userCurrentListKeysCall(fingerprint, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* List the authenticated user's public keys
|
|
*
|
|
* @param fingerprint fingerprint of the key (optional)
|
|
* @return List<PublicKey>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<PublicKey> userCurrentListKeys(String fingerprint) throws ApiException {
|
|
ApiResponse<List<PublicKey>> resp = userCurrentListKeysWithHttpInfo(fingerprint);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* List the authenticated user's public keys
|
|
*
|
|
* @param fingerprint fingerprint of the key (optional)
|
|
* @return ApiResponse<List<PublicKey>>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<List<PublicKey>> userCurrentListKeysWithHttpInfo(String fingerprint) throws ApiException {
|
|
com.squareup.okhttp.Call call = userCurrentListKeysValidateBeforeCall(fingerprint, null, null);
|
|
Type localVarReturnType = new TypeToken<List<PublicKey>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* List the authenticated user's public keys (asynchronously)
|
|
*
|
|
* @param fingerprint fingerprint of the 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 userCurrentListKeysAsync(String fingerprint, final ApiCallback<List<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 = userCurrentListKeysValidateBeforeCall(fingerprint, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<PublicKey>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userCurrentListRepos
|
|
* @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 userCurrentListReposCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/user/repos";
|
|
|
|
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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userCurrentListReposValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
|
|
com.squareup.okhttp.Call call = userCurrentListReposCall(progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* List the repos that the authenticated user owns or has access to
|
|
*
|
|
* @return List<Repository>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<Repository> userCurrentListRepos() throws ApiException {
|
|
ApiResponse<List<Repository>> resp = userCurrentListReposWithHttpInfo();
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* List the repos that the authenticated user owns or has access to
|
|
*
|
|
* @return ApiResponse<List<Repository>>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<List<Repository>> userCurrentListReposWithHttpInfo() throws ApiException {
|
|
com.squareup.okhttp.Call call = userCurrentListReposValidateBeforeCall(null, null);
|
|
Type localVarReturnType = new TypeToken<List<Repository>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* List the repos that the authenticated user owns or has access to (asynchronously)
|
|
*
|
|
* @param callback The callback to be executed when the API call finishes
|
|
* @return The request call
|
|
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call userCurrentListReposAsync(final ApiCallback<List<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 = userCurrentListReposValidateBeforeCall(progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<Repository>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userCurrentListStarred
|
|
* @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 userCurrentListStarredCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/user/starred";
|
|
|
|
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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userCurrentListStarredValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
|
|
com.squareup.okhttp.Call call = userCurrentListStarredCall(progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* The repos that the authenticated user has starred
|
|
*
|
|
* @return List<Repository>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<Repository> userCurrentListStarred() throws ApiException {
|
|
ApiResponse<List<Repository>> resp = userCurrentListStarredWithHttpInfo();
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* The repos that the authenticated user has starred
|
|
*
|
|
* @return ApiResponse<List<Repository>>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<List<Repository>> userCurrentListStarredWithHttpInfo() throws ApiException {
|
|
com.squareup.okhttp.Call call = userCurrentListStarredValidateBeforeCall(null, null);
|
|
Type localVarReturnType = new TypeToken<List<Repository>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* The repos that the authenticated user has starred (asynchronously)
|
|
*
|
|
* @param callback The callback to be executed when the API call finishes
|
|
* @return The request call
|
|
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call userCurrentListStarredAsync(final ApiCallback<List<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 = userCurrentListStarredValidateBeforeCall(progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<Repository>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userCurrentListSubscriptions
|
|
* @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 userCurrentListSubscriptionsCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/user/subscriptions";
|
|
|
|
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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userCurrentListSubscriptionsValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
|
|
com.squareup.okhttp.Call call = userCurrentListSubscriptionsCall(progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* List repositories watched by the authenticated user
|
|
*
|
|
* @return List<Repository>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<Repository> userCurrentListSubscriptions() throws ApiException {
|
|
ApiResponse<List<Repository>> resp = userCurrentListSubscriptionsWithHttpInfo();
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* List repositories watched by the authenticated user
|
|
*
|
|
* @return ApiResponse<List<Repository>>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<List<Repository>> userCurrentListSubscriptionsWithHttpInfo() throws ApiException {
|
|
com.squareup.okhttp.Call call = userCurrentListSubscriptionsValidateBeforeCall(null, null);
|
|
Type localVarReturnType = new TypeToken<List<Repository>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* List repositories watched by the authenticated user (asynchronously)
|
|
*
|
|
* @param callback The callback to be executed when the API call finishes
|
|
* @return The request call
|
|
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call userCurrentListSubscriptionsAsync(final ApiCallback<List<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 = userCurrentListSubscriptionsValidateBeforeCall(progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<Repository>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userCurrentPostGPGKey
|
|
* @param form (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 userCurrentPostGPGKeyCall(CreateGPGKeyOption form, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = form;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/user/gpg_keys";
|
|
|
|
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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userCurrentPostGPGKeyValidateBeforeCall(CreateGPGKeyOption form, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
|
|
com.squareup.okhttp.Call call = userCurrentPostGPGKeyCall(form, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Create a GPG key
|
|
*
|
|
* @param form (optional)
|
|
* @return GPGKey
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public GPGKey userCurrentPostGPGKey(CreateGPGKeyOption form) throws ApiException {
|
|
ApiResponse<GPGKey> resp = userCurrentPostGPGKeyWithHttpInfo(form);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Create a GPG key
|
|
*
|
|
* @param form (optional)
|
|
* @return ApiResponse<GPGKey>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<GPGKey> userCurrentPostGPGKeyWithHttpInfo(CreateGPGKeyOption form) throws ApiException {
|
|
com.squareup.okhttp.Call call = userCurrentPostGPGKeyValidateBeforeCall(form, null, null);
|
|
Type localVarReturnType = new TypeToken<GPGKey>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Create a GPG key (asynchronously)
|
|
*
|
|
* @param form (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 userCurrentPostGPGKeyAsync(CreateGPGKeyOption form, final ApiCallback<GPGKey> 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 = userCurrentPostGPGKeyValidateBeforeCall(form, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<GPGKey>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userCurrentPostKey
|
|
* @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 userCurrentPostKeyCall(CreateKeyOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = body;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/user/keys";
|
|
|
|
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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userCurrentPostKeyValidateBeforeCall(CreateKeyOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
|
|
com.squareup.okhttp.Call call = userCurrentPostKeyCall(body, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Create a public key
|
|
*
|
|
* @param body (optional)
|
|
* @return PublicKey
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public PublicKey userCurrentPostKey(CreateKeyOption body) throws ApiException {
|
|
ApiResponse<PublicKey> resp = userCurrentPostKeyWithHttpInfo(body);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Create a public key
|
|
*
|
|
* @param body (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> userCurrentPostKeyWithHttpInfo(CreateKeyOption body) throws ApiException {
|
|
com.squareup.okhttp.Call call = userCurrentPostKeyValidateBeforeCall(body, null, null);
|
|
Type localVarReturnType = new TypeToken<PublicKey>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Create a public key (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 userCurrentPostKeyAsync(CreateKeyOption body, 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 = userCurrentPostKeyValidateBeforeCall(body, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<PublicKey>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userCurrentPutFollow
|
|
* @param username username of user to follow (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 userCurrentPutFollowCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/user/following/{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", "text/html"
|
|
};
|
|
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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userCurrentPutFollowValidateBeforeCall(String username, 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 userCurrentPutFollow(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = userCurrentPutFollowCall(username, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Follow a user
|
|
*
|
|
* @param username username of user to follow (required)
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public void userCurrentPutFollow(String username) throws ApiException {
|
|
userCurrentPutFollowWithHttpInfo(username);
|
|
}
|
|
|
|
/**
|
|
* Follow a user
|
|
*
|
|
* @param username username of user to follow (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> userCurrentPutFollowWithHttpInfo(String username) throws ApiException {
|
|
com.squareup.okhttp.Call call = userCurrentPutFollowValidateBeforeCall(username, null, null);
|
|
return apiClient.execute(call);
|
|
}
|
|
|
|
/**
|
|
* Follow a user (asynchronously)
|
|
*
|
|
* @param username username of user to follow (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 userCurrentPutFollowAsync(String username, 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 = userCurrentPutFollowValidateBeforeCall(username, progressListener, progressRequestListener);
|
|
apiClient.executeAsync(call, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userCurrentPutStar
|
|
* @param owner owner of the repo to star (required)
|
|
* @param repo name of the repo to star (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 userCurrentPutStarCall(String owner, String repo, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/user/starred/{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", "text/html"
|
|
};
|
|
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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userCurrentPutStarValidateBeforeCall(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 userCurrentPutStar(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling userCurrentPutStar(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = userCurrentPutStarCall(owner, repo, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Star the given repo
|
|
*
|
|
* @param owner owner of the repo to star (required)
|
|
* @param repo name of the repo to star (required)
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public void userCurrentPutStar(String owner, String repo) throws ApiException {
|
|
userCurrentPutStarWithHttpInfo(owner, repo);
|
|
}
|
|
|
|
/**
|
|
* Star the given repo
|
|
*
|
|
* @param owner owner of the repo to star (required)
|
|
* @param repo name of the repo to star (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> userCurrentPutStarWithHttpInfo(String owner, String repo) throws ApiException {
|
|
com.squareup.okhttp.Call call = userCurrentPutStarValidateBeforeCall(owner, repo, null, null);
|
|
return apiClient.execute(call);
|
|
}
|
|
|
|
/**
|
|
* Star the given repo (asynchronously)
|
|
*
|
|
* @param owner owner of the repo to star (required)
|
|
* @param repo name of the repo to star (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 userCurrentPutStarAsync(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 = userCurrentPutStarValidateBeforeCall(owner, repo, progressListener, progressRequestListener);
|
|
apiClient.executeAsync(call, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userCurrentTrackedTimes
|
|
* @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 userCurrentTrackedTimesCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/user/times";
|
|
|
|
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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userCurrentTrackedTimesValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
|
|
com.squareup.okhttp.Call call = userCurrentTrackedTimesCall(progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* List the current user's tracked times
|
|
*
|
|
* @return List<TrackedTime>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<TrackedTime> userCurrentTrackedTimes() throws ApiException {
|
|
ApiResponse<List<TrackedTime>> resp = userCurrentTrackedTimesWithHttpInfo();
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* List the current user's tracked times
|
|
*
|
|
* @return ApiResponse<List<TrackedTime>>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<List<TrackedTime>> userCurrentTrackedTimesWithHttpInfo() throws ApiException {
|
|
com.squareup.okhttp.Call call = userCurrentTrackedTimesValidateBeforeCall(null, null);
|
|
Type localVarReturnType = new TypeToken<List<TrackedTime>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* List the current user's tracked times (asynchronously)
|
|
*
|
|
* @param callback The callback to be executed when the API call finishes
|
|
* @return The request call
|
|
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call userCurrentTrackedTimesAsync(final ApiCallback<List<TrackedTime>> 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 = userCurrentTrackedTimesValidateBeforeCall(progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<TrackedTime>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userDeleteAccessToken
|
|
* @param username username of user (required)
|
|
* @param token token to be deleted (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 userDeleteAccessTokenCall(String username, Long token, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/users/{username}/tokens/{token}"
|
|
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()))
|
|
.replaceAll("\\{" + "token" + "\\}", apiClient.escapeString(token.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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userDeleteAccessTokenValidateBeforeCall(String username, Long token, 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 userDeleteAccessToken(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'token' is set
|
|
if (token == null) {
|
|
throw new ApiException("Missing the required parameter 'token' when calling userDeleteAccessToken(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = userDeleteAccessTokenCall(username, token, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* delete an access token
|
|
*
|
|
* @param username username of user (required)
|
|
* @param token token to be deleted (required)
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public void userDeleteAccessToken(String username, Long token) throws ApiException {
|
|
userDeleteAccessTokenWithHttpInfo(username, token);
|
|
}
|
|
|
|
/**
|
|
* delete an access token
|
|
*
|
|
* @param username username of user (required)
|
|
* @param token token to be deleted (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> userDeleteAccessTokenWithHttpInfo(String username, Long token) throws ApiException {
|
|
com.squareup.okhttp.Call call = userDeleteAccessTokenValidateBeforeCall(username, token, null, null);
|
|
return apiClient.execute(call);
|
|
}
|
|
|
|
/**
|
|
* delete an access token (asynchronously)
|
|
*
|
|
* @param username username of user (required)
|
|
* @param token token to be deleted (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 userDeleteAccessTokenAsync(String username, Long token, 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 = userDeleteAccessTokenValidateBeforeCall(username, token, progressListener, progressRequestListener);
|
|
apiClient.executeAsync(call, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userDeleteEmail
|
|
* @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 userDeleteEmailCall(DeleteEmailOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = body;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/user/emails";
|
|
|
|
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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userDeleteEmailValidateBeforeCall(DeleteEmailOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
|
|
com.squareup.okhttp.Call call = userDeleteEmailCall(body, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Delete email addresses
|
|
*
|
|
* @param body (optional)
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public void userDeleteEmail(DeleteEmailOption body) throws ApiException {
|
|
userDeleteEmailWithHttpInfo(body);
|
|
}
|
|
|
|
/**
|
|
* Delete email addresses
|
|
*
|
|
* @param body (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> userDeleteEmailWithHttpInfo(DeleteEmailOption body) throws ApiException {
|
|
com.squareup.okhttp.Call call = userDeleteEmailValidateBeforeCall(body, null, null);
|
|
return apiClient.execute(call);
|
|
}
|
|
|
|
/**
|
|
* Delete email addresses (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 userDeleteEmailAsync(DeleteEmailOption 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 = userDeleteEmailValidateBeforeCall(body, progressListener, progressRequestListener);
|
|
apiClient.executeAsync(call, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userGet
|
|
* @param username username of user 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 userGetCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/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", "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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userGetValidateBeforeCall(String username, 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 userGet(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = userGetCall(username, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Get a user
|
|
*
|
|
* @param username username of user to get (required)
|
|
* @return User
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public User userGet(String username) throws ApiException {
|
|
ApiResponse<User> resp = userGetWithHttpInfo(username);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Get a user
|
|
*
|
|
* @param username username of user to get (required)
|
|
* @return ApiResponse<User>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<User> userGetWithHttpInfo(String username) throws ApiException {
|
|
com.squareup.okhttp.Call call = userGetValidateBeforeCall(username, null, null);
|
|
Type localVarReturnType = new TypeToken<User>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Get a user (asynchronously)
|
|
*
|
|
* @param username username of user 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 userGetAsync(String username, 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 = userGetValidateBeforeCall(username, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<User>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userGetCurrent
|
|
* @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 userGetCurrentCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/user";
|
|
|
|
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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userGetCurrentValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
|
|
com.squareup.okhttp.Call call = userGetCurrentCall(progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Get the authenticated user
|
|
*
|
|
* @return User
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public User userGetCurrent() throws ApiException {
|
|
ApiResponse<User> resp = userGetCurrentWithHttpInfo();
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Get the authenticated user
|
|
*
|
|
* @return ApiResponse<User>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<User> userGetCurrentWithHttpInfo() throws ApiException {
|
|
com.squareup.okhttp.Call call = userGetCurrentValidateBeforeCall(null, null);
|
|
Type localVarReturnType = new TypeToken<User>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Get the authenticated user (asynchronously)
|
|
*
|
|
* @param callback The callback to be executed when the API call finishes
|
|
* @return The request call
|
|
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call userGetCurrentAsync(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 = userGetCurrentValidateBeforeCall(progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<User>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userGetHeatmapData
|
|
* @param username username of user 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 userGetHeatmapDataCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/users/{username}/heatmap"
|
|
.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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userGetHeatmapDataValidateBeforeCall(String username, 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 userGetHeatmapData(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = userGetHeatmapDataCall(username, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Get a user's heatmap
|
|
*
|
|
* @param username username of user to get (required)
|
|
* @return List<UserHeatmapData>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<UserHeatmapData> userGetHeatmapData(String username) throws ApiException {
|
|
ApiResponse<List<UserHeatmapData>> resp = userGetHeatmapDataWithHttpInfo(username);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Get a user's heatmap
|
|
*
|
|
* @param username username of user to get (required)
|
|
* @return ApiResponse<List<UserHeatmapData>>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<List<UserHeatmapData>> userGetHeatmapDataWithHttpInfo(String username) throws ApiException {
|
|
com.squareup.okhttp.Call call = userGetHeatmapDataValidateBeforeCall(username, null, null);
|
|
Type localVarReturnType = new TypeToken<List<UserHeatmapData>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Get a user's heatmap (asynchronously)
|
|
*
|
|
* @param username username of user 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 userGetHeatmapDataAsync(String username, final ApiCallback<List<UserHeatmapData>> 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 = userGetHeatmapDataValidateBeforeCall(username, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<UserHeatmapData>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userGetTokens
|
|
* @param username username of user (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 userGetTokensCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/users/{username}/tokens"
|
|
.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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userGetTokensValidateBeforeCall(String username, 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 userGetTokens(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = userGetTokensCall(username, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* List the authenticated user's access tokens
|
|
*
|
|
* @param username username of user (required)
|
|
* @return List<AccessToken>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<AccessToken> userGetTokens(String username) throws ApiException {
|
|
ApiResponse<List<AccessToken>> resp = userGetTokensWithHttpInfo(username);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* List the authenticated user's access tokens
|
|
*
|
|
* @param username username of user (required)
|
|
* @return ApiResponse<List<AccessToken>>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<List<AccessToken>> userGetTokensWithHttpInfo(String username) throws ApiException {
|
|
com.squareup.okhttp.Call call = userGetTokensValidateBeforeCall(username, null, null);
|
|
Type localVarReturnType = new TypeToken<List<AccessToken>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* List the authenticated user's access tokens (asynchronously)
|
|
*
|
|
* @param username username of user (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 userGetTokensAsync(String username, final ApiCallback<List<AccessToken>> 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 = userGetTokensValidateBeforeCall(username, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<AccessToken>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userListEmails
|
|
* @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 userListEmailsCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/user/emails";
|
|
|
|
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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userListEmailsValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
|
|
com.squareup.okhttp.Call call = userListEmailsCall(progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* List the authenticated user's email addresses
|
|
*
|
|
* @return List<Email>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<Email> userListEmails() throws ApiException {
|
|
ApiResponse<List<Email>> resp = userListEmailsWithHttpInfo();
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* List the authenticated user's email addresses
|
|
*
|
|
* @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>> userListEmailsWithHttpInfo() throws ApiException {
|
|
com.squareup.okhttp.Call call = userListEmailsValidateBeforeCall(null, null);
|
|
Type localVarReturnType = new TypeToken<List<Email>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* List the authenticated user's email addresses (asynchronously)
|
|
*
|
|
* @param callback The callback to be executed when the API call finishes
|
|
* @return The request call
|
|
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call userListEmailsAsync(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 = userListEmailsValidateBeforeCall(progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<Email>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userListFollowers
|
|
* @param username username of user (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 userListFollowersCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/users/{username}/followers"
|
|
.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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userListFollowersValidateBeforeCall(String username, 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 userListFollowers(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = userListFollowersCall(username, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* List the given user's followers
|
|
*
|
|
* @param username username of user (required)
|
|
* @return List<User>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<User> userListFollowers(String username) throws ApiException {
|
|
ApiResponse<List<User>> resp = userListFollowersWithHttpInfo(username);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* List the given user's followers
|
|
*
|
|
* @param username username of user (required)
|
|
* @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>> userListFollowersWithHttpInfo(String username) throws ApiException {
|
|
com.squareup.okhttp.Call call = userListFollowersValidateBeforeCall(username, null, null);
|
|
Type localVarReturnType = new TypeToken<List<User>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* List the given user's followers (asynchronously)
|
|
*
|
|
* @param username username of user (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 userListFollowersAsync(String username, 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 = userListFollowersValidateBeforeCall(username, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<User>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userListFollowing
|
|
* @param username username of user (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 userListFollowingCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/users/{username}/following"
|
|
.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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userListFollowingValidateBeforeCall(String username, 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 userListFollowing(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = userListFollowingCall(username, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* List the users that the given user is following
|
|
*
|
|
* @param username username of user (required)
|
|
* @return List<User>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<User> userListFollowing(String username) throws ApiException {
|
|
ApiResponse<List<User>> resp = userListFollowingWithHttpInfo(username);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* List the users that the given user is following
|
|
*
|
|
* @param username username of user (required)
|
|
* @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>> userListFollowingWithHttpInfo(String username) throws ApiException {
|
|
com.squareup.okhttp.Call call = userListFollowingValidateBeforeCall(username, null, null);
|
|
Type localVarReturnType = new TypeToken<List<User>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* List the users that the given user is following (asynchronously)
|
|
*
|
|
* @param username username of user (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 userListFollowingAsync(String username, 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 = userListFollowingValidateBeforeCall(username, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<User>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userListGPGKeys
|
|
* @param username username of user (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 userListGPGKeysCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/users/{username}/gpg_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", "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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userListGPGKeysValidateBeforeCall(String username, 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 userListGPGKeys(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = userListGPGKeysCall(username, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* List the given user's GPG keys
|
|
*
|
|
* @param username username of user (required)
|
|
* @return List<GPGKey>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<GPGKey> userListGPGKeys(String username) throws ApiException {
|
|
ApiResponse<List<GPGKey>> resp = userListGPGKeysWithHttpInfo(username);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* List the given user's GPG keys
|
|
*
|
|
* @param username username of user (required)
|
|
* @return ApiResponse<List<GPGKey>>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<List<GPGKey>> userListGPGKeysWithHttpInfo(String username) throws ApiException {
|
|
com.squareup.okhttp.Call call = userListGPGKeysValidateBeforeCall(username, null, null);
|
|
Type localVarReturnType = new TypeToken<List<GPGKey>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* List the given user's GPG keys (asynchronously)
|
|
*
|
|
* @param username username of user (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 userListGPGKeysAsync(String username, final ApiCallback<List<GPGKey>> 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 = userListGPGKeysValidateBeforeCall(username, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<GPGKey>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userListKeys
|
|
* @param username username of user (required)
|
|
* @param fingerprint fingerprint of the 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 userListKeysCall(String username, String fingerprint, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/users/{username}/keys"
|
|
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
if (fingerprint != null)
|
|
localVarQueryParams.addAll(apiClient.parameterToPair("fingerprint", fingerprint));
|
|
|
|
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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userListKeysValidateBeforeCall(String username, String fingerprint, 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 userListKeys(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = userListKeysCall(username, fingerprint, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* List the given user's public keys
|
|
*
|
|
* @param username username of user (required)
|
|
* @param fingerprint fingerprint of the key (optional)
|
|
* @return List<PublicKey>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<PublicKey> userListKeys(String username, String fingerprint) throws ApiException {
|
|
ApiResponse<List<PublicKey>> resp = userListKeysWithHttpInfo(username, fingerprint);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* List the given user's public keys
|
|
*
|
|
* @param username username of user (required)
|
|
* @param fingerprint fingerprint of the key (optional)
|
|
* @return ApiResponse<List<PublicKey>>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<List<PublicKey>> userListKeysWithHttpInfo(String username, String fingerprint) throws ApiException {
|
|
com.squareup.okhttp.Call call = userListKeysValidateBeforeCall(username, fingerprint, null, null);
|
|
Type localVarReturnType = new TypeToken<List<PublicKey>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* List the given user's public keys (asynchronously)
|
|
*
|
|
* @param username username of user (required)
|
|
* @param fingerprint fingerprint of the 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 userListKeysAsync(String username, String fingerprint, final ApiCallback<List<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 = userListKeysValidateBeforeCall(username, fingerprint, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<PublicKey>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userListRepos
|
|
* @param username username of user (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 userListReposCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/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", "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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userListReposValidateBeforeCall(String username, 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 userListRepos(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = userListReposCall(username, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* List the repos owned by the given user
|
|
*
|
|
* @param username username of user (required)
|
|
* @return List<Repository>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<Repository> userListRepos(String username) throws ApiException {
|
|
ApiResponse<List<Repository>> resp = userListReposWithHttpInfo(username);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* List the repos owned by the given user
|
|
*
|
|
* @param username username of user (required)
|
|
* @return ApiResponse<List<Repository>>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<List<Repository>> userListReposWithHttpInfo(String username) throws ApiException {
|
|
com.squareup.okhttp.Call call = userListReposValidateBeforeCall(username, null, null);
|
|
Type localVarReturnType = new TypeToken<List<Repository>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* List the repos owned by the given user (asynchronously)
|
|
*
|
|
* @param username username of user (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 userListReposAsync(String username, final ApiCallback<List<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 = userListReposValidateBeforeCall(username, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<Repository>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userListStarred
|
|
* @param username username of user (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 userListStarredCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/users/{username}/starred"
|
|
.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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userListStarredValidateBeforeCall(String username, 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 userListStarred(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = userListStarredCall(username, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* The repos that the given user has starred
|
|
*
|
|
* @param username username of user (required)
|
|
* @return List<Repository>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<Repository> userListStarred(String username) throws ApiException {
|
|
ApiResponse<List<Repository>> resp = userListStarredWithHttpInfo(username);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* The repos that the given user has starred
|
|
*
|
|
* @param username username of user (required)
|
|
* @return ApiResponse<List<Repository>>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<List<Repository>> userListStarredWithHttpInfo(String username) throws ApiException {
|
|
com.squareup.okhttp.Call call = userListStarredValidateBeforeCall(username, null, null);
|
|
Type localVarReturnType = new TypeToken<List<Repository>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* The repos that the given user has starred (asynchronously)
|
|
*
|
|
* @param username username of user (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 userListStarredAsync(String username, final ApiCallback<List<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 = userListStarredValidateBeforeCall(username, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<Repository>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userListSubscriptions
|
|
* @param username username of the user (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 userListSubscriptionsCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/users/{username}/subscriptions"
|
|
.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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userListSubscriptionsValidateBeforeCall(String username, 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 userListSubscriptions(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = userListSubscriptionsCall(username, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* List the repositories watched by a user
|
|
*
|
|
* @param username username of the user (required)
|
|
* @return List<Repository>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<Repository> userListSubscriptions(String username) throws ApiException {
|
|
ApiResponse<List<Repository>> resp = userListSubscriptionsWithHttpInfo(username);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* List the repositories watched by a user
|
|
*
|
|
* @param username username of the user (required)
|
|
* @return ApiResponse<List<Repository>>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<List<Repository>> userListSubscriptionsWithHttpInfo(String username) throws ApiException {
|
|
com.squareup.okhttp.Call call = userListSubscriptionsValidateBeforeCall(username, null, null);
|
|
Type localVarReturnType = new TypeToken<List<Repository>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* List the repositories watched by a user (asynchronously)
|
|
*
|
|
* @param username username of the user (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 userListSubscriptionsAsync(String username, final ApiCallback<List<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 = userListSubscriptionsValidateBeforeCall(username, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<Repository>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userListTeams
|
|
* @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 userListTeamsCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/user/teams";
|
|
|
|
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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userListTeamsValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
|
|
com.squareup.okhttp.Call call = userListTeamsCall(progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* List all the teams a user belongs to
|
|
*
|
|
* @return List<Team>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<Team> userListTeams() throws ApiException {
|
|
ApiResponse<List<Team>> resp = userListTeamsWithHttpInfo();
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* List all the teams a user belongs to
|
|
*
|
|
* @return ApiResponse<List<Team>>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<List<Team>> userListTeamsWithHttpInfo() throws ApiException {
|
|
com.squareup.okhttp.Call call = userListTeamsValidateBeforeCall(null, null);
|
|
Type localVarReturnType = new TypeToken<List<Team>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* List all the teams a user belongs to (asynchronously)
|
|
*
|
|
* @param callback The callback to be executed when the API call finishes
|
|
* @return The request call
|
|
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call userListTeamsAsync(final ApiCallback<List<Team>> 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 = userListTeamsValidateBeforeCall(progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<Team>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userSearch
|
|
* @param q keyword (optional)
|
|
* @param uid ID of the user to search for (optional)
|
|
* @param limit maximum number of users to return (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 userSearchCall(String q, Long uid, Integer limit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/users/search";
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
if (q != null)
|
|
localVarQueryParams.addAll(apiClient.parameterToPair("q", q));
|
|
if (uid != null)
|
|
localVarQueryParams.addAll(apiClient.parameterToPair("uid", uid));
|
|
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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userSearchValidateBeforeCall(String q, Long uid, Integer limit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
|
|
|
com.squareup.okhttp.Call call = userSearchCall(q, uid, limit, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Search for users
|
|
*
|
|
* @param q keyword (optional)
|
|
* @param uid ID of the user to search for (optional)
|
|
* @param limit maximum number of users to return (optional)
|
|
* @return InlineResponse2001
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public InlineResponse2001 userSearch(String q, Long uid, Integer limit) throws ApiException {
|
|
ApiResponse<InlineResponse2001> resp = userSearchWithHttpInfo(q, uid, limit);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Search for users
|
|
*
|
|
* @param q keyword (optional)
|
|
* @param uid ID of the user to search for (optional)
|
|
* @param limit maximum number of users to return (optional)
|
|
* @return ApiResponse<InlineResponse2001>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<InlineResponse2001> userSearchWithHttpInfo(String q, Long uid, Integer limit) throws ApiException {
|
|
com.squareup.okhttp.Call call = userSearchValidateBeforeCall(q, uid, limit, null, null);
|
|
Type localVarReturnType = new TypeToken<InlineResponse2001>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Search for users (asynchronously)
|
|
*
|
|
* @param q keyword (optional)
|
|
* @param uid ID of the user to search for (optional)
|
|
* @param limit maximum number of users to return (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 userSearchAsync(String q, Long uid, Integer limit, final ApiCallback<InlineResponse2001> 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 = userSearchValidateBeforeCall(q, uid, limit, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<InlineResponse2001>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for userTrackedTimes
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param user username of user (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 userTrackedTimesCall(String owner, String repo, String user, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/repos/{owner}/{repo}/times/{user}"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()))
|
|
.replaceAll("\\{" + "user" + "\\}", apiClient.escapeString(user.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", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call userTrackedTimesValidateBeforeCall(String owner, String repo, String user, 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 userTrackedTimes(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling userTrackedTimes(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'user' is set
|
|
if (user == null) {
|
|
throw new ApiException("Missing the required parameter 'user' when calling userTrackedTimes(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = userTrackedTimesCall(owner, repo, user, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* List a user's tracked times in a repo
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param user username of user (required)
|
|
* @return List<TrackedTime>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<TrackedTime> userTrackedTimes(String owner, String repo, String user) throws ApiException {
|
|
ApiResponse<List<TrackedTime>> resp = userTrackedTimesWithHttpInfo(owner, repo, user);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* List a user's tracked times in a repo
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param user username of user (required)
|
|
* @return ApiResponse<List<TrackedTime>>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<List<TrackedTime>> userTrackedTimesWithHttpInfo(String owner, String repo, String user) throws ApiException {
|
|
com.squareup.okhttp.Call call = userTrackedTimesValidateBeforeCall(owner, repo, user, null, null);
|
|
Type localVarReturnType = new TypeToken<List<TrackedTime>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* List a user's tracked times in a repo (asynchronously)
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param user username of user (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 userTrackedTimesAsync(String owner, String repo, String user, final ApiCallback<List<TrackedTime>> 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 = userTrackedTimesValidateBeforeCall(owner, repo, user, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<TrackedTime>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
}
|