4257 lines
205 KiB
Java
4257 lines
205 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.AddTimeOption;
|
|
import io.gitea.model.Comment;
|
|
import io.gitea.model.CreateIssueCommentOption;
|
|
import io.gitea.model.CreateIssueOption;
|
|
import io.gitea.model.CreateLabelOption;
|
|
import io.gitea.model.CreateMilestoneOption;
|
|
import io.gitea.model.EditDeadlineOption;
|
|
import io.gitea.model.EditIssueCommentOption;
|
|
import io.gitea.model.EditIssueOption;
|
|
import io.gitea.model.EditLabelOption;
|
|
import io.gitea.model.EditMilestoneOption;
|
|
import io.gitea.model.Issue;
|
|
import io.gitea.model.IssueDeadline;
|
|
import io.gitea.model.IssueLabelsOption;
|
|
import io.gitea.model.Label;
|
|
import io.gitea.model.Milestone;
|
|
import io.gitea.model.TrackedTime;
|
|
|
|
import java.lang.reflect.Type;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
public class IssueApi {
|
|
private ApiClient apiClient;
|
|
|
|
public IssueApi() {
|
|
this(Configuration.getDefaultApiClient());
|
|
}
|
|
|
|
public IssueApi(ApiClient apiClient) {
|
|
this.apiClient = apiClient;
|
|
}
|
|
|
|
public ApiClient getApiClient() {
|
|
return apiClient;
|
|
}
|
|
|
|
public void setApiClient(ApiClient apiClient) {
|
|
this.apiClient = apiClient;
|
|
}
|
|
|
|
/**
|
|
* Build call for issueAddLabel
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue (required)
|
|
* @param body (optional)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call issueAddLabelCall(String owner, String repo, Long index, IssueLabelsOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = body;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/repos/{owner}/{repo}/issues/{index}/labels"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()))
|
|
.replaceAll("\\{" + "index" + "\\}", apiClient.escapeString(index.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 issueAddLabelValidateBeforeCall(String owner, String repo, Long index, IssueLabelsOption body, 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 issueAddLabel(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling issueAddLabel(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'index' is set
|
|
if (index == null) {
|
|
throw new ApiException("Missing the required parameter 'index' when calling issueAddLabel(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = issueAddLabelCall(owner, repo, index, body, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Add a label to an issue
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue (required)
|
|
* @param body (optional)
|
|
* @return List<Label>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<Label> issueAddLabel(String owner, String repo, Long index, IssueLabelsOption body) throws ApiException {
|
|
ApiResponse<List<Label>> resp = issueAddLabelWithHttpInfo(owner, repo, index, body);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Add a label to an issue
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue (required)
|
|
* @param body (optional)
|
|
* @return ApiResponse<List<Label>>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<List<Label>> issueAddLabelWithHttpInfo(String owner, String repo, Long index, IssueLabelsOption body) throws ApiException {
|
|
com.squareup.okhttp.Call call = issueAddLabelValidateBeforeCall(owner, repo, index, body, null, null);
|
|
Type localVarReturnType = new TypeToken<List<Label>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Add a label to an issue (asynchronously)
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue (required)
|
|
* @param body (optional)
|
|
* @param callback The callback to be executed when the API call finishes
|
|
* @return The request call
|
|
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call issueAddLabelAsync(String owner, String repo, Long index, IssueLabelsOption body, final ApiCallback<List<Label>> 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 = issueAddLabelValidateBeforeCall(owner, repo, index, body, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<Label>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for issueAddTime
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id index of the issue to add tracked time to (required)
|
|
* @param body (optional)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call issueAddTimeCall(String owner, String repo, Long id, AddTimeOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = body;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/repos/{owner}/{repo}/issues/{id}/times"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()))
|
|
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json"
|
|
};
|
|
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 issueAddTimeValidateBeforeCall(String owner, String repo, Long id, AddTimeOption body, 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 issueAddTime(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling issueAddTime(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'id' is set
|
|
if (id == null) {
|
|
throw new ApiException("Missing the required parameter 'id' when calling issueAddTime(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = issueAddTimeCall(owner, repo, id, body, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Add a tracked time to a issue
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id index of the issue to add tracked time to (required)
|
|
* @param body (optional)
|
|
* @return TrackedTime
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public TrackedTime issueAddTime(String owner, String repo, Long id, AddTimeOption body) throws ApiException {
|
|
ApiResponse<TrackedTime> resp = issueAddTimeWithHttpInfo(owner, repo, id, body);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Add a tracked time to a issue
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id index of the issue to add tracked time to (required)
|
|
* @param body (optional)
|
|
* @return ApiResponse<TrackedTime>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<TrackedTime> issueAddTimeWithHttpInfo(String owner, String repo, Long id, AddTimeOption body) throws ApiException {
|
|
com.squareup.okhttp.Call call = issueAddTimeValidateBeforeCall(owner, repo, id, body, null, null);
|
|
Type localVarReturnType = new TypeToken<TrackedTime>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Add a tracked time to a issue (asynchronously)
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id index of the issue to add tracked time to (required)
|
|
* @param body (optional)
|
|
* @param callback The callback to be executed when the API call finishes
|
|
* @return The request call
|
|
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call issueAddTimeAsync(String owner, String repo, Long id, AddTimeOption body, final ApiCallback<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 = issueAddTimeValidateBeforeCall(owner, repo, id, body, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<TrackedTime>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for issueClearLabels
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue (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 issueClearLabelsCall(String owner, String repo, Long index, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/repos/{owner}/{repo}/issues/{index}/labels"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()))
|
|
.replaceAll("\\{" + "index" + "\\}", apiClient.escapeString(index.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 issueClearLabelsValidateBeforeCall(String owner, String repo, Long index, 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 issueClearLabels(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling issueClearLabels(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'index' is set
|
|
if (index == null) {
|
|
throw new ApiException("Missing the required parameter 'index' when calling issueClearLabels(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = issueClearLabelsCall(owner, repo, index, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Remove all labels from an issue
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue (required)
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public void issueClearLabels(String owner, String repo, Long index) throws ApiException {
|
|
issueClearLabelsWithHttpInfo(owner, repo, index);
|
|
}
|
|
|
|
/**
|
|
* Remove all labels from an issue
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue (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> issueClearLabelsWithHttpInfo(String owner, String repo, Long index) throws ApiException {
|
|
com.squareup.okhttp.Call call = issueClearLabelsValidateBeforeCall(owner, repo, index, null, null);
|
|
return apiClient.execute(call);
|
|
}
|
|
|
|
/**
|
|
* Remove all labels from an issue (asynchronously)
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue (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 issueClearLabelsAsync(String owner, String repo, Long index, 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 = issueClearLabelsValidateBeforeCall(owner, repo, index, progressListener, progressRequestListener);
|
|
apiClient.executeAsync(call, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for issueCreateComment
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue (required)
|
|
* @param body (optional)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call issueCreateCommentCall(String owner, String repo, Long index, CreateIssueCommentOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = body;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/repos/{owner}/{repo}/issues/{index}/comments"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()))
|
|
.replaceAll("\\{" + "index" + "\\}", apiClient.escapeString(index.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 issueCreateCommentValidateBeforeCall(String owner, String repo, Long index, CreateIssueCommentOption body, 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 issueCreateComment(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling issueCreateComment(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'index' is set
|
|
if (index == null) {
|
|
throw new ApiException("Missing the required parameter 'index' when calling issueCreateComment(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = issueCreateCommentCall(owner, repo, index, body, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Add a comment to an issue
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue (required)
|
|
* @param body (optional)
|
|
* @return Comment
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public Comment issueCreateComment(String owner, String repo, Long index, CreateIssueCommentOption body) throws ApiException {
|
|
ApiResponse<Comment> resp = issueCreateCommentWithHttpInfo(owner, repo, index, body);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Add a comment to an issue
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue (required)
|
|
* @param body (optional)
|
|
* @return ApiResponse<Comment>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<Comment> issueCreateCommentWithHttpInfo(String owner, String repo, Long index, CreateIssueCommentOption body) throws ApiException {
|
|
com.squareup.okhttp.Call call = issueCreateCommentValidateBeforeCall(owner, repo, index, body, null, null);
|
|
Type localVarReturnType = new TypeToken<Comment>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Add a comment to an issue (asynchronously)
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue (required)
|
|
* @param body (optional)
|
|
* @param callback The callback to be executed when the API call finishes
|
|
* @return The request call
|
|
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call issueCreateCommentAsync(String owner, String repo, Long index, CreateIssueCommentOption body, final ApiCallback<Comment> 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 = issueCreateCommentValidateBeforeCall(owner, repo, index, body, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<Comment>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for issueCreateIssue
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param body (optional)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call issueCreateIssueCall(String owner, String repo, CreateIssueOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = body;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/repos/{owner}/{repo}/issues"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json"
|
|
};
|
|
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 issueCreateIssueValidateBeforeCall(String owner, String repo, CreateIssueOption body, 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 issueCreateIssue(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling issueCreateIssue(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = issueCreateIssueCall(owner, repo, body, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Create an issue
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param body (optional)
|
|
* @return Issue
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public Issue issueCreateIssue(String owner, String repo, CreateIssueOption body) throws ApiException {
|
|
ApiResponse<Issue> resp = issueCreateIssueWithHttpInfo(owner, repo, body);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Create an issue
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param body (optional)
|
|
* @return ApiResponse<Issue>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<Issue> issueCreateIssueWithHttpInfo(String owner, String repo, CreateIssueOption body) throws ApiException {
|
|
com.squareup.okhttp.Call call = issueCreateIssueValidateBeforeCall(owner, repo, body, null, null);
|
|
Type localVarReturnType = new TypeToken<Issue>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Create an issue (asynchronously)
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param body (optional)
|
|
* @param callback The callback to be executed when the API call finishes
|
|
* @return The request call
|
|
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call issueCreateIssueAsync(String owner, String repo, CreateIssueOption body, final ApiCallback<Issue> 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 = issueCreateIssueValidateBeforeCall(owner, repo, body, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<Issue>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for issueCreateLabel
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param body (optional)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call issueCreateLabelCall(String owner, String repo, CreateLabelOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = body;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/repos/{owner}/{repo}/labels"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json"
|
|
};
|
|
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 issueCreateLabelValidateBeforeCall(String owner, String repo, CreateLabelOption body, 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 issueCreateLabel(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling issueCreateLabel(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = issueCreateLabelCall(owner, repo, body, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Create a label
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param body (optional)
|
|
* @return Label
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public Label issueCreateLabel(String owner, String repo, CreateLabelOption body) throws ApiException {
|
|
ApiResponse<Label> resp = issueCreateLabelWithHttpInfo(owner, repo, body);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Create a label
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param body (optional)
|
|
* @return ApiResponse<Label>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<Label> issueCreateLabelWithHttpInfo(String owner, String repo, CreateLabelOption body) throws ApiException {
|
|
com.squareup.okhttp.Call call = issueCreateLabelValidateBeforeCall(owner, repo, body, null, null);
|
|
Type localVarReturnType = new TypeToken<Label>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Create a label (asynchronously)
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param body (optional)
|
|
* @param callback The callback to be executed when the API call finishes
|
|
* @return The request call
|
|
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call issueCreateLabelAsync(String owner, String repo, CreateLabelOption body, final ApiCallback<Label> 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 = issueCreateLabelValidateBeforeCall(owner, repo, body, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<Label>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for issueCreateMilestone
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param body (optional)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call issueCreateMilestoneCall(String owner, String repo, CreateMilestoneOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = body;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/repos/{owner}/{repo}/milestones"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json"
|
|
};
|
|
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 issueCreateMilestoneValidateBeforeCall(String owner, String repo, CreateMilestoneOption body, 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 issueCreateMilestone(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling issueCreateMilestone(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = issueCreateMilestoneCall(owner, repo, body, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Create a milestone
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param body (optional)
|
|
* @return Milestone
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public Milestone issueCreateMilestone(String owner, String repo, CreateMilestoneOption body) throws ApiException {
|
|
ApiResponse<Milestone> resp = issueCreateMilestoneWithHttpInfo(owner, repo, body);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Create a milestone
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param body (optional)
|
|
* @return ApiResponse<Milestone>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<Milestone> issueCreateMilestoneWithHttpInfo(String owner, String repo, CreateMilestoneOption body) throws ApiException {
|
|
com.squareup.okhttp.Call call = issueCreateMilestoneValidateBeforeCall(owner, repo, body, null, null);
|
|
Type localVarReturnType = new TypeToken<Milestone>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Create a milestone (asynchronously)
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param body (optional)
|
|
* @param callback The callback to be executed when the API call finishes
|
|
* @return The request call
|
|
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call issueCreateMilestoneAsync(String owner, String repo, CreateMilestoneOption body, final ApiCallback<Milestone> 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 = issueCreateMilestoneValidateBeforeCall(owner, repo, body, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<Milestone>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for issueDeleteComment
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of comment 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 issueDeleteCommentCall(String owner, String repo, Long id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/repos/{owner}/{repo}/issues/comments/{id}"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()))
|
|
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json", "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 issueDeleteCommentValidateBeforeCall(String owner, String repo, Long id, 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 issueDeleteComment(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling issueDeleteComment(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'id' is set
|
|
if (id == null) {
|
|
throw new ApiException("Missing the required parameter 'id' when calling issueDeleteComment(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = issueDeleteCommentCall(owner, repo, id, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Delete a comment
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of comment to delete (required)
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public void issueDeleteComment(String owner, String repo, Long id) throws ApiException {
|
|
issueDeleteCommentWithHttpInfo(owner, repo, id);
|
|
}
|
|
|
|
/**
|
|
* Delete a comment
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of comment 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> issueDeleteCommentWithHttpInfo(String owner, String repo, Long id) throws ApiException {
|
|
com.squareup.okhttp.Call call = issueDeleteCommentValidateBeforeCall(owner, repo, id, null, null);
|
|
return apiClient.execute(call);
|
|
}
|
|
|
|
/**
|
|
* Delete a comment (asynchronously)
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of comment 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 issueDeleteCommentAsync(String owner, String repo, 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 = issueDeleteCommentValidateBeforeCall(owner, repo, id, progressListener, progressRequestListener);
|
|
apiClient.executeAsync(call, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for issueDeleteCommentDeprecated
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index this parameter is ignored (required)
|
|
* @param id id of comment 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
|
|
* @deprecated
|
|
*/
|
|
@Deprecated
|
|
public com.squareup.okhttp.Call issueDeleteCommentDeprecatedCall(String owner, String repo, Integer index, Long id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/repos/{owner}/{repo}/issues/{index}/comments/{id}"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()))
|
|
.replaceAll("\\{" + "index" + "\\}", apiClient.escapeString(index.toString()))
|
|
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json", "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);
|
|
}
|
|
|
|
@Deprecated
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call issueDeleteCommentDeprecatedValidateBeforeCall(String owner, String repo, Integer index, Long id, 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 issueDeleteCommentDeprecated(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling issueDeleteCommentDeprecated(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'index' is set
|
|
if (index == null) {
|
|
throw new ApiException("Missing the required parameter 'index' when calling issueDeleteCommentDeprecated(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'id' is set
|
|
if (id == null) {
|
|
throw new ApiException("Missing the required parameter 'id' when calling issueDeleteCommentDeprecated(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = issueDeleteCommentDeprecatedCall(owner, repo, index, id, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Delete a comment
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index this parameter is ignored (required)
|
|
* @param id id of comment to delete (required)
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
* @deprecated
|
|
*/
|
|
@Deprecated
|
|
public void issueDeleteCommentDeprecated(String owner, String repo, Integer index, Long id) throws ApiException {
|
|
issueDeleteCommentDeprecatedWithHttpInfo(owner, repo, index, id);
|
|
}
|
|
|
|
/**
|
|
* Delete a comment
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index this parameter is ignored (required)
|
|
* @param id id of comment to delete (required)
|
|
* @return ApiResponse<Void>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
* @deprecated
|
|
*/
|
|
@Deprecated
|
|
public ApiResponse<Void> issueDeleteCommentDeprecatedWithHttpInfo(String owner, String repo, Integer index, Long id) throws ApiException {
|
|
com.squareup.okhttp.Call call = issueDeleteCommentDeprecatedValidateBeforeCall(owner, repo, index, id, null, null);
|
|
return apiClient.execute(call);
|
|
}
|
|
|
|
/**
|
|
* Delete a comment (asynchronously)
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index this parameter is ignored (required)
|
|
* @param id id of comment 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
|
|
* @deprecated
|
|
*/
|
|
@Deprecated
|
|
public com.squareup.okhttp.Call issueDeleteCommentDeprecatedAsync(String owner, String repo, Integer index, 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 = issueDeleteCommentDeprecatedValidateBeforeCall(owner, repo, index, id, progressListener, progressRequestListener);
|
|
apiClient.executeAsync(call, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for issueDeleteLabel
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of the label 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 issueDeleteLabelCall(String owner, String repo, Long id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/repos/{owner}/{repo}/labels/{id}"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()))
|
|
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json", "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 issueDeleteLabelValidateBeforeCall(String owner, String repo, Long id, 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 issueDeleteLabel(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling issueDeleteLabel(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'id' is set
|
|
if (id == null) {
|
|
throw new ApiException("Missing the required parameter 'id' when calling issueDeleteLabel(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = issueDeleteLabelCall(owner, repo, id, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Delete a label
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of the label to delete (required)
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public void issueDeleteLabel(String owner, String repo, Long id) throws ApiException {
|
|
issueDeleteLabelWithHttpInfo(owner, repo, id);
|
|
}
|
|
|
|
/**
|
|
* Delete a label
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of the label 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> issueDeleteLabelWithHttpInfo(String owner, String repo, Long id) throws ApiException {
|
|
com.squareup.okhttp.Call call = issueDeleteLabelValidateBeforeCall(owner, repo, id, null, null);
|
|
return apiClient.execute(call);
|
|
}
|
|
|
|
/**
|
|
* Delete a label (asynchronously)
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of the label 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 issueDeleteLabelAsync(String owner, String repo, 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 = issueDeleteLabelValidateBeforeCall(owner, repo, id, progressListener, progressRequestListener);
|
|
apiClient.executeAsync(call, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for issueDeleteMilestone
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of the milestone 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 issueDeleteMilestoneCall(String owner, String repo, Long id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/repos/{owner}/{repo}/milestones/{id}"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()))
|
|
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json", "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 issueDeleteMilestoneValidateBeforeCall(String owner, String repo, Long id, 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 issueDeleteMilestone(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling issueDeleteMilestone(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'id' is set
|
|
if (id == null) {
|
|
throw new ApiException("Missing the required parameter 'id' when calling issueDeleteMilestone(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = issueDeleteMilestoneCall(owner, repo, id, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Delete a milestone
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of the milestone to delete (required)
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public void issueDeleteMilestone(String owner, String repo, Long id) throws ApiException {
|
|
issueDeleteMilestoneWithHttpInfo(owner, repo, id);
|
|
}
|
|
|
|
/**
|
|
* Delete a milestone
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of the milestone 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> issueDeleteMilestoneWithHttpInfo(String owner, String repo, Long id) throws ApiException {
|
|
com.squareup.okhttp.Call call = issueDeleteMilestoneValidateBeforeCall(owner, repo, id, null, null);
|
|
return apiClient.execute(call);
|
|
}
|
|
|
|
/**
|
|
* Delete a milestone (asynchronously)
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of the milestone 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 issueDeleteMilestoneAsync(String owner, String repo, 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 = issueDeleteMilestoneValidateBeforeCall(owner, repo, id, progressListener, progressRequestListener);
|
|
apiClient.executeAsync(call, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for issueEditComment
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of the comment to edit (required)
|
|
* @param body (optional)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call issueEditCommentCall(String owner, String repo, Long id, EditIssueCommentOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = body;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/repos/{owner}/{repo}/issues/comments/{id}"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()))
|
|
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json"
|
|
};
|
|
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, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call issueEditCommentValidateBeforeCall(String owner, String repo, Long id, EditIssueCommentOption body, 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 issueEditComment(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling issueEditComment(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'id' is set
|
|
if (id == null) {
|
|
throw new ApiException("Missing the required parameter 'id' when calling issueEditComment(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = issueEditCommentCall(owner, repo, id, body, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Edit a comment
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of the comment to edit (required)
|
|
* @param body (optional)
|
|
* @return Comment
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public Comment issueEditComment(String owner, String repo, Long id, EditIssueCommentOption body) throws ApiException {
|
|
ApiResponse<Comment> resp = issueEditCommentWithHttpInfo(owner, repo, id, body);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Edit a comment
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of the comment to edit (required)
|
|
* @param body (optional)
|
|
* @return ApiResponse<Comment>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<Comment> issueEditCommentWithHttpInfo(String owner, String repo, Long id, EditIssueCommentOption body) throws ApiException {
|
|
com.squareup.okhttp.Call call = issueEditCommentValidateBeforeCall(owner, repo, id, body, null, null);
|
|
Type localVarReturnType = new TypeToken<Comment>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Edit a comment (asynchronously)
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of the comment to edit (required)
|
|
* @param body (optional)
|
|
* @param callback The callback to be executed when the API call finishes
|
|
* @return The request call
|
|
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call issueEditCommentAsync(String owner, String repo, Long id, EditIssueCommentOption body, final ApiCallback<Comment> 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 = issueEditCommentValidateBeforeCall(owner, repo, id, body, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<Comment>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for issueEditCommentDeprecated
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index this parameter is ignored (required)
|
|
* @param id id of the comment to edit (required)
|
|
* @param body (optional)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
* @deprecated
|
|
*/
|
|
@Deprecated
|
|
public com.squareup.okhttp.Call issueEditCommentDeprecatedCall(String owner, String repo, Integer index, Long id, EditIssueCommentOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = body;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/repos/{owner}/{repo}/issues/{index}/comments/{id}"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()))
|
|
.replaceAll("\\{" + "index" + "\\}", apiClient.escapeString(index.toString()))
|
|
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json"
|
|
};
|
|
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, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@Deprecated
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call issueEditCommentDeprecatedValidateBeforeCall(String owner, String repo, Integer index, Long id, EditIssueCommentOption body, 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 issueEditCommentDeprecated(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling issueEditCommentDeprecated(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'index' is set
|
|
if (index == null) {
|
|
throw new ApiException("Missing the required parameter 'index' when calling issueEditCommentDeprecated(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'id' is set
|
|
if (id == null) {
|
|
throw new ApiException("Missing the required parameter 'id' when calling issueEditCommentDeprecated(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = issueEditCommentDeprecatedCall(owner, repo, index, id, body, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Edit a comment
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index this parameter is ignored (required)
|
|
* @param id id of the comment to edit (required)
|
|
* @param body (optional)
|
|
* @return Comment
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
* @deprecated
|
|
*/
|
|
@Deprecated
|
|
public Comment issueEditCommentDeprecated(String owner, String repo, Integer index, Long id, EditIssueCommentOption body) throws ApiException {
|
|
ApiResponse<Comment> resp = issueEditCommentDeprecatedWithHttpInfo(owner, repo, index, id, body);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Edit a comment
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index this parameter is ignored (required)
|
|
* @param id id of the comment to edit (required)
|
|
* @param body (optional)
|
|
* @return ApiResponse<Comment>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
* @deprecated
|
|
*/
|
|
@Deprecated
|
|
public ApiResponse<Comment> issueEditCommentDeprecatedWithHttpInfo(String owner, String repo, Integer index, Long id, EditIssueCommentOption body) throws ApiException {
|
|
com.squareup.okhttp.Call call = issueEditCommentDeprecatedValidateBeforeCall(owner, repo, index, id, body, null, null);
|
|
Type localVarReturnType = new TypeToken<Comment>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Edit a comment (asynchronously)
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index this parameter is ignored (required)
|
|
* @param id id of the comment to edit (required)
|
|
* @param body (optional)
|
|
* @param callback The callback to be executed when the API call finishes
|
|
* @return The request call
|
|
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
* @deprecated
|
|
*/
|
|
@Deprecated
|
|
public com.squareup.okhttp.Call issueEditCommentDeprecatedAsync(String owner, String repo, Integer index, Long id, EditIssueCommentOption body, final ApiCallback<Comment> 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 = issueEditCommentDeprecatedValidateBeforeCall(owner, repo, index, id, body, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<Comment>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for issueEditIssue
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue to edit (required)
|
|
* @param body (optional)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call issueEditIssueCall(String owner, String repo, Long index, EditIssueOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = body;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/repos/{owner}/{repo}/issues/{index}"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()))
|
|
.replaceAll("\\{" + "index" + "\\}", apiClient.escapeString(index.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, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call issueEditIssueValidateBeforeCall(String owner, String repo, Long index, EditIssueOption body, 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 issueEditIssue(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling issueEditIssue(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'index' is set
|
|
if (index == null) {
|
|
throw new ApiException("Missing the required parameter 'index' when calling issueEditIssue(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = issueEditIssueCall(owner, repo, index, body, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Edit an issue
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue to edit (required)
|
|
* @param body (optional)
|
|
* @return Issue
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public Issue issueEditIssue(String owner, String repo, Long index, EditIssueOption body) throws ApiException {
|
|
ApiResponse<Issue> resp = issueEditIssueWithHttpInfo(owner, repo, index, body);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Edit an issue
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue to edit (required)
|
|
* @param body (optional)
|
|
* @return ApiResponse<Issue>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<Issue> issueEditIssueWithHttpInfo(String owner, String repo, Long index, EditIssueOption body) throws ApiException {
|
|
com.squareup.okhttp.Call call = issueEditIssueValidateBeforeCall(owner, repo, index, body, null, null);
|
|
Type localVarReturnType = new TypeToken<Issue>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Edit an issue (asynchronously)
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue to edit (required)
|
|
* @param body (optional)
|
|
* @param callback The callback to be executed when the API call finishes
|
|
* @return The request call
|
|
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call issueEditIssueAsync(String owner, String repo, Long index, EditIssueOption body, final ApiCallback<Issue> 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 = issueEditIssueValidateBeforeCall(owner, repo, index, body, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<Issue>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for issueEditIssueDeadline
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue to create or update a deadline on (required)
|
|
* @param body (optional)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call issueEditIssueDeadlineCall(String owner, String repo, Long index, EditDeadlineOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = body;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/repos/{owner}/{repo}/issues/{index}/deadline"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()))
|
|
.replaceAll("\\{" + "index" + "\\}", apiClient.escapeString(index.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 issueEditIssueDeadlineValidateBeforeCall(String owner, String repo, Long index, EditDeadlineOption body, 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 issueEditIssueDeadline(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling issueEditIssueDeadline(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'index' is set
|
|
if (index == null) {
|
|
throw new ApiException("Missing the required parameter 'index' when calling issueEditIssueDeadline(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = issueEditIssueDeadlineCall(owner, repo, index, body, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Set an issue deadline. If set to null, the deadline is deleted.
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue to create or update a deadline on (required)
|
|
* @param body (optional)
|
|
* @return IssueDeadline
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public IssueDeadline issueEditIssueDeadline(String owner, String repo, Long index, EditDeadlineOption body) throws ApiException {
|
|
ApiResponse<IssueDeadline> resp = issueEditIssueDeadlineWithHttpInfo(owner, repo, index, body);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Set an issue deadline. If set to null, the deadline is deleted.
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue to create or update a deadline on (required)
|
|
* @param body (optional)
|
|
* @return ApiResponse<IssueDeadline>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<IssueDeadline> issueEditIssueDeadlineWithHttpInfo(String owner, String repo, Long index, EditDeadlineOption body) throws ApiException {
|
|
com.squareup.okhttp.Call call = issueEditIssueDeadlineValidateBeforeCall(owner, repo, index, body, null, null);
|
|
Type localVarReturnType = new TypeToken<IssueDeadline>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Set an issue deadline. If set to null, the deadline is deleted. (asynchronously)
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue to create or update a deadline on (required)
|
|
* @param body (optional)
|
|
* @param callback The callback to be executed when the API call finishes
|
|
* @return The request call
|
|
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call issueEditIssueDeadlineAsync(String owner, String repo, Long index, EditDeadlineOption body, final ApiCallback<IssueDeadline> 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 = issueEditIssueDeadlineValidateBeforeCall(owner, repo, index, body, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<IssueDeadline>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for issueEditLabel
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of the label to edit (required)
|
|
* @param body (optional)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call issueEditLabelCall(String owner, String repo, Long id, EditLabelOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = body;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/repos/{owner}/{repo}/labels/{id}"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()))
|
|
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json"
|
|
};
|
|
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, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call issueEditLabelValidateBeforeCall(String owner, String repo, Long id, EditLabelOption body, 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 issueEditLabel(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling issueEditLabel(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'id' is set
|
|
if (id == null) {
|
|
throw new ApiException("Missing the required parameter 'id' when calling issueEditLabel(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = issueEditLabelCall(owner, repo, id, body, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Update a label
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of the label to edit (required)
|
|
* @param body (optional)
|
|
* @return Label
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public Label issueEditLabel(String owner, String repo, Long id, EditLabelOption body) throws ApiException {
|
|
ApiResponse<Label> resp = issueEditLabelWithHttpInfo(owner, repo, id, body);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Update a label
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of the label to edit (required)
|
|
* @param body (optional)
|
|
* @return ApiResponse<Label>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<Label> issueEditLabelWithHttpInfo(String owner, String repo, Long id, EditLabelOption body) throws ApiException {
|
|
com.squareup.okhttp.Call call = issueEditLabelValidateBeforeCall(owner, repo, id, body, null, null);
|
|
Type localVarReturnType = new TypeToken<Label>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Update a label (asynchronously)
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of the label to edit (required)
|
|
* @param body (optional)
|
|
* @param callback The callback to be executed when the API call finishes
|
|
* @return The request call
|
|
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call issueEditLabelAsync(String owner, String repo, Long id, EditLabelOption body, final ApiCallback<Label> 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 = issueEditLabelValidateBeforeCall(owner, repo, id, body, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<Label>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for issueEditMilestone
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of the milestone (required)
|
|
* @param body (optional)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call issueEditMilestoneCall(String owner, String repo, Long id, EditMilestoneOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = body;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/repos/{owner}/{repo}/milestones/{id}"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()))
|
|
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json"
|
|
};
|
|
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, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call issueEditMilestoneValidateBeforeCall(String owner, String repo, Long id, EditMilestoneOption body, 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 issueEditMilestone(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling issueEditMilestone(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'id' is set
|
|
if (id == null) {
|
|
throw new ApiException("Missing the required parameter 'id' when calling issueEditMilestone(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = issueEditMilestoneCall(owner, repo, id, body, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Update a milestone
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of the milestone (required)
|
|
* @param body (optional)
|
|
* @return Milestone
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public Milestone issueEditMilestone(String owner, String repo, Long id, EditMilestoneOption body) throws ApiException {
|
|
ApiResponse<Milestone> resp = issueEditMilestoneWithHttpInfo(owner, repo, id, body);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Update a milestone
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of the milestone (required)
|
|
* @param body (optional)
|
|
* @return ApiResponse<Milestone>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<Milestone> issueEditMilestoneWithHttpInfo(String owner, String repo, Long id, EditMilestoneOption body) throws ApiException {
|
|
com.squareup.okhttp.Call call = issueEditMilestoneValidateBeforeCall(owner, repo, id, body, null, null);
|
|
Type localVarReturnType = new TypeToken<Milestone>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Update a milestone (asynchronously)
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of the milestone (required)
|
|
* @param body (optional)
|
|
* @param callback The callback to be executed when the API call finishes
|
|
* @return The request call
|
|
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call issueEditMilestoneAsync(String owner, String repo, Long id, EditMilestoneOption body, final ApiCallback<Milestone> 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 = issueEditMilestoneValidateBeforeCall(owner, repo, id, body, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<Milestone>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for issueGetComments
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue (required)
|
|
* @param since if provided, only comments updated since the specified time are returned. (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 issueGetCommentsCall(String owner, String repo, Long index, String since, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/repos/{owner}/{repo}/issues/{index}/comments"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()))
|
|
.replaceAll("\\{" + "index" + "\\}", apiClient.escapeString(index.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
if (since != null)
|
|
localVarQueryParams.addAll(apiClient.parameterToPair("since", since));
|
|
|
|
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 issueGetCommentsValidateBeforeCall(String owner, String repo, Long index, String since, 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 issueGetComments(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling issueGetComments(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'index' is set
|
|
if (index == null) {
|
|
throw new ApiException("Missing the required parameter 'index' when calling issueGetComments(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = issueGetCommentsCall(owner, repo, index, since, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* List all comments on an issue
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue (required)
|
|
* @param since if provided, only comments updated since the specified time are returned. (optional)
|
|
* @return List<Comment>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<Comment> issueGetComments(String owner, String repo, Long index, String since) throws ApiException {
|
|
ApiResponse<List<Comment>> resp = issueGetCommentsWithHttpInfo(owner, repo, index, since);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* List all comments on an issue
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue (required)
|
|
* @param since if provided, only comments updated since the specified time are returned. (optional)
|
|
* @return ApiResponse<List<Comment>>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<List<Comment>> issueGetCommentsWithHttpInfo(String owner, String repo, Long index, String since) throws ApiException {
|
|
com.squareup.okhttp.Call call = issueGetCommentsValidateBeforeCall(owner, repo, index, since, null, null);
|
|
Type localVarReturnType = new TypeToken<List<Comment>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* List all comments on an issue (asynchronously)
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue (required)
|
|
* @param since if provided, only comments updated since the specified time are returned. (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 issueGetCommentsAsync(String owner, String repo, Long index, String since, final ApiCallback<List<Comment>> 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 = issueGetCommentsValidateBeforeCall(owner, repo, index, since, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<Comment>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for issueGetIssue
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue 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 issueGetIssueCall(String owner, String repo, Long index, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/repos/{owner}/{repo}/issues/{index}"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()))
|
|
.replaceAll("\\{" + "index" + "\\}", apiClient.escapeString(index.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 issueGetIssueValidateBeforeCall(String owner, String repo, Long index, 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 issueGetIssue(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling issueGetIssue(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'index' is set
|
|
if (index == null) {
|
|
throw new ApiException("Missing the required parameter 'index' when calling issueGetIssue(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = issueGetIssueCall(owner, repo, index, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Get an issue
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue to get (required)
|
|
* @return Issue
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public Issue issueGetIssue(String owner, String repo, Long index) throws ApiException {
|
|
ApiResponse<Issue> resp = issueGetIssueWithHttpInfo(owner, repo, index);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Get an issue
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue to get (required)
|
|
* @return ApiResponse<Issue>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<Issue> issueGetIssueWithHttpInfo(String owner, String repo, Long index) throws ApiException {
|
|
com.squareup.okhttp.Call call = issueGetIssueValidateBeforeCall(owner, repo, index, null, null);
|
|
Type localVarReturnType = new TypeToken<Issue>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Get an issue (asynchronously)
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue 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 issueGetIssueAsync(String owner, String repo, Long index, final ApiCallback<Issue> 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 = issueGetIssueValidateBeforeCall(owner, repo, index, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<Issue>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for issueGetLabel
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of the label 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 issueGetLabelCall(String owner, String repo, Long id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/repos/{owner}/{repo}/labels/{id}"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()))
|
|
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json", "text/plain"
|
|
};
|
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
|
|
|
if(progressListener != null) {
|
|
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
|
@Override
|
|
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
|
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
|
return originalResponse.newBuilder()
|
|
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
|
.build();
|
|
}
|
|
});
|
|
}
|
|
|
|
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call issueGetLabelValidateBeforeCall(String owner, String repo, Long id, 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 issueGetLabel(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling issueGetLabel(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'id' is set
|
|
if (id == null) {
|
|
throw new ApiException("Missing the required parameter 'id' when calling issueGetLabel(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = issueGetLabelCall(owner, repo, id, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Get a single label
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of the label to get (required)
|
|
* @return Label
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public Label issueGetLabel(String owner, String repo, Long id) throws ApiException {
|
|
ApiResponse<Label> resp = issueGetLabelWithHttpInfo(owner, repo, id);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Get a single label
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of the label to get (required)
|
|
* @return ApiResponse<Label>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<Label> issueGetLabelWithHttpInfo(String owner, String repo, Long id) throws ApiException {
|
|
com.squareup.okhttp.Call call = issueGetLabelValidateBeforeCall(owner, repo, id, null, null);
|
|
Type localVarReturnType = new TypeToken<Label>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Get a single label (asynchronously)
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of the label 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 issueGetLabelAsync(String owner, String repo, Long id, final ApiCallback<Label> 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 = issueGetLabelValidateBeforeCall(owner, repo, id, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<Label>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for issueGetLabels
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue (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 issueGetLabelsCall(String owner, String repo, Long index, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/repos/{owner}/{repo}/issues/{index}/labels"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()))
|
|
.replaceAll("\\{" + "index" + "\\}", apiClient.escapeString(index.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 issueGetLabelsValidateBeforeCall(String owner, String repo, Long index, 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 issueGetLabels(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling issueGetLabels(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'index' is set
|
|
if (index == null) {
|
|
throw new ApiException("Missing the required parameter 'index' when calling issueGetLabels(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = issueGetLabelsCall(owner, repo, index, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Get an issue's labels
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue (required)
|
|
* @return List<Label>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<Label> issueGetLabels(String owner, String repo, Long index) throws ApiException {
|
|
ApiResponse<List<Label>> resp = issueGetLabelsWithHttpInfo(owner, repo, index);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Get an issue's labels
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue (required)
|
|
* @return ApiResponse<List<Label>>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<List<Label>> issueGetLabelsWithHttpInfo(String owner, String repo, Long index) throws ApiException {
|
|
com.squareup.okhttp.Call call = issueGetLabelsValidateBeforeCall(owner, repo, index, null, null);
|
|
Type localVarReturnType = new TypeToken<List<Label>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Get an issue's labels (asynchronously)
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue (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 issueGetLabelsAsync(String owner, String repo, Long index, final ApiCallback<List<Label>> 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 = issueGetLabelsValidateBeforeCall(owner, repo, index, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<Label>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for issueGetMilestone
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of the milestone (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 issueGetMilestoneCall(String owner, String repo, Long id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/repos/{owner}/{repo}/milestones/{id}"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()))
|
|
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json", "text/plain"
|
|
};
|
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
|
|
|
if(progressListener != null) {
|
|
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
|
@Override
|
|
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
|
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
|
return originalResponse.newBuilder()
|
|
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
|
.build();
|
|
}
|
|
});
|
|
}
|
|
|
|
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call issueGetMilestoneValidateBeforeCall(String owner, String repo, Long id, 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 issueGetMilestone(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling issueGetMilestone(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'id' is set
|
|
if (id == null) {
|
|
throw new ApiException("Missing the required parameter 'id' when calling issueGetMilestone(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = issueGetMilestoneCall(owner, repo, id, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Get a milestone
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of the milestone (required)
|
|
* @return Milestone
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public Milestone issueGetMilestone(String owner, String repo, Long id) throws ApiException {
|
|
ApiResponse<Milestone> resp = issueGetMilestoneWithHttpInfo(owner, repo, id);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Get a milestone
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of the milestone (required)
|
|
* @return ApiResponse<Milestone>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<Milestone> issueGetMilestoneWithHttpInfo(String owner, String repo, Long id) throws ApiException {
|
|
com.squareup.okhttp.Call call = issueGetMilestoneValidateBeforeCall(owner, repo, id, null, null);
|
|
Type localVarReturnType = new TypeToken<Milestone>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Get a milestone (asynchronously)
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id id of the milestone (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 issueGetMilestoneAsync(String owner, String repo, Long id, final ApiCallback<Milestone> 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 = issueGetMilestoneValidateBeforeCall(owner, repo, id, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<Milestone>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for issueGetMilestonesList
|
|
* @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 issueGetMilestonesListCall(String owner, String repo, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/repos/{owner}/{repo}/milestones"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json", "text/plain"
|
|
};
|
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
|
|
|
if(progressListener != null) {
|
|
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
|
@Override
|
|
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
|
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
|
return originalResponse.newBuilder()
|
|
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
|
.build();
|
|
}
|
|
});
|
|
}
|
|
|
|
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call issueGetMilestonesListValidateBeforeCall(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 issueGetMilestonesList(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling issueGetMilestonesList(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = issueGetMilestonesListCall(owner, repo, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Get all of a repository's milestones
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @return List<Milestone>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<Milestone> issueGetMilestonesList(String owner, String repo) throws ApiException {
|
|
ApiResponse<List<Milestone>> resp = issueGetMilestonesListWithHttpInfo(owner, repo);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Get all of a repository's milestones
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @return ApiResponse<List<Milestone>>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<List<Milestone>> issueGetMilestonesListWithHttpInfo(String owner, String repo) throws ApiException {
|
|
com.squareup.okhttp.Call call = issueGetMilestonesListValidateBeforeCall(owner, repo, null, null);
|
|
Type localVarReturnType = new TypeToken<List<Milestone>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Get all of a repository's milestones (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 issueGetMilestonesListAsync(String owner, String repo, final ApiCallback<List<Milestone>> 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 = issueGetMilestonesListValidateBeforeCall(owner, repo, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<Milestone>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for issueGetRepoComments
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param since if provided, only comments updated since the provided time are returned. (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 issueGetRepoCommentsCall(String owner, String repo, String since, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/repos/{owner}/{repo}/issues/comments"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
if (since != null)
|
|
localVarQueryParams.addAll(apiClient.parameterToPair("since", since));
|
|
|
|
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 issueGetRepoCommentsValidateBeforeCall(String owner, String repo, String since, 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 issueGetRepoComments(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling issueGetRepoComments(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = issueGetRepoCommentsCall(owner, repo, since, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* List all comments in a repository
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param since if provided, only comments updated since the provided time are returned. (optional)
|
|
* @return List<Comment>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<Comment> issueGetRepoComments(String owner, String repo, String since) throws ApiException {
|
|
ApiResponse<List<Comment>> resp = issueGetRepoCommentsWithHttpInfo(owner, repo, since);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* List all comments in a repository
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param since if provided, only comments updated since the provided time are returned. (optional)
|
|
* @return ApiResponse<List<Comment>>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<List<Comment>> issueGetRepoCommentsWithHttpInfo(String owner, String repo, String since) throws ApiException {
|
|
com.squareup.okhttp.Call call = issueGetRepoCommentsValidateBeforeCall(owner, repo, since, null, null);
|
|
Type localVarReturnType = new TypeToken<List<Comment>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* List all comments in a repository (asynchronously)
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param since if provided, only comments updated since the provided time are returned. (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 issueGetRepoCommentsAsync(String owner, String repo, String since, final ApiCallback<List<Comment>> 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 = issueGetRepoCommentsValidateBeforeCall(owner, repo, since, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<Comment>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for issueListIssues
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param state whether issue is open or closed (optional)
|
|
* @param page page number of requested issues (optional)
|
|
* @param q search string (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 issueListIssuesCall(String owner, String repo, String state, Integer page, String q, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/repos/{owner}/{repo}/issues"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
if (state != null)
|
|
localVarQueryParams.addAll(apiClient.parameterToPair("state", state));
|
|
if (page != null)
|
|
localVarQueryParams.addAll(apiClient.parameterToPair("page", page));
|
|
if (q != null)
|
|
localVarQueryParams.addAll(apiClient.parameterToPair("q", q));
|
|
|
|
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 issueListIssuesValidateBeforeCall(String owner, String repo, String state, Integer page, String q, 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 issueListIssues(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling issueListIssues(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = issueListIssuesCall(owner, repo, state, page, q, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* List a repository's issues
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param state whether issue is open or closed (optional)
|
|
* @param page page number of requested issues (optional)
|
|
* @param q search string (optional)
|
|
* @return List<Issue>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<Issue> issueListIssues(String owner, String repo, String state, Integer page, String q) throws ApiException {
|
|
ApiResponse<List<Issue>> resp = issueListIssuesWithHttpInfo(owner, repo, state, page, q);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* List a repository's issues
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param state whether issue is open or closed (optional)
|
|
* @param page page number of requested issues (optional)
|
|
* @param q search string (optional)
|
|
* @return ApiResponse<List<Issue>>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<List<Issue>> issueListIssuesWithHttpInfo(String owner, String repo, String state, Integer page, String q) throws ApiException {
|
|
com.squareup.okhttp.Call call = issueListIssuesValidateBeforeCall(owner, repo, state, page, q, null, null);
|
|
Type localVarReturnType = new TypeToken<List<Issue>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* List a repository's issues (asynchronously)
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param state whether issue is open or closed (optional)
|
|
* @param page page number of requested issues (optional)
|
|
* @param q search string (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 issueListIssuesAsync(String owner, String repo, String state, Integer page, String q, final ApiCallback<List<Issue>> 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 = issueListIssuesValidateBeforeCall(owner, repo, state, page, q, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<Issue>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for issueListLabels
|
|
* @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 issueListLabelsCall(String owner, String repo, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/repos/{owner}/{repo}/labels"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json", "text/plain"
|
|
};
|
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
|
|
|
if(progressListener != null) {
|
|
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
|
@Override
|
|
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
|
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
|
return originalResponse.newBuilder()
|
|
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
|
.build();
|
|
}
|
|
});
|
|
}
|
|
|
|
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call issueListLabelsValidateBeforeCall(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 issueListLabels(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling issueListLabels(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = issueListLabelsCall(owner, repo, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Get all of a repository's labels
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @return List<Label>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<Label> issueListLabels(String owner, String repo) throws ApiException {
|
|
ApiResponse<List<Label>> resp = issueListLabelsWithHttpInfo(owner, repo);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Get all of a repository's labels
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @return ApiResponse<List<Label>>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<List<Label>> issueListLabelsWithHttpInfo(String owner, String repo) throws ApiException {
|
|
com.squareup.okhttp.Call call = issueListLabelsValidateBeforeCall(owner, repo, null, null);
|
|
Type localVarReturnType = new TypeToken<List<Label>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Get all of a repository's labels (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 issueListLabelsAsync(String owner, String repo, final ApiCallback<List<Label>> 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 = issueListLabelsValidateBeforeCall(owner, repo, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<Label>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for issueRemoveLabel
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue (required)
|
|
* @param id id of the label to remove (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 issueRemoveLabelCall(String owner, String repo, Long index, Long id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/repos/{owner}/{repo}/issues/{index}/labels/{id}"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()))
|
|
.replaceAll("\\{" + "index" + "\\}", apiClient.escapeString(index.toString()))
|
|
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json", "text/plain"
|
|
};
|
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
|
|
|
if(progressListener != null) {
|
|
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
|
@Override
|
|
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
|
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
|
return originalResponse.newBuilder()
|
|
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
|
.build();
|
|
}
|
|
});
|
|
}
|
|
|
|
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "Token" };
|
|
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call issueRemoveLabelValidateBeforeCall(String owner, String repo, Long index, Long id, 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 issueRemoveLabel(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling issueRemoveLabel(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'index' is set
|
|
if (index == null) {
|
|
throw new ApiException("Missing the required parameter 'index' when calling issueRemoveLabel(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'id' is set
|
|
if (id == null) {
|
|
throw new ApiException("Missing the required parameter 'id' when calling issueRemoveLabel(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = issueRemoveLabelCall(owner, repo, index, id, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Remove a label from an issue
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue (required)
|
|
* @param id id of the label to remove (required)
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public void issueRemoveLabel(String owner, String repo, Long index, Long id) throws ApiException {
|
|
issueRemoveLabelWithHttpInfo(owner, repo, index, id);
|
|
}
|
|
|
|
/**
|
|
* Remove a label from an issue
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue (required)
|
|
* @param id id of the label to remove (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> issueRemoveLabelWithHttpInfo(String owner, String repo, Long index, Long id) throws ApiException {
|
|
com.squareup.okhttp.Call call = issueRemoveLabelValidateBeforeCall(owner, repo, index, id, null, null);
|
|
return apiClient.execute(call);
|
|
}
|
|
|
|
/**
|
|
* Remove a label from an issue (asynchronously)
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue (required)
|
|
* @param id id of the label to remove (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 issueRemoveLabelAsync(String owner, String repo, Long index, 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 = issueRemoveLabelValidateBeforeCall(owner, repo, index, id, progressListener, progressRequestListener);
|
|
apiClient.executeAsync(call, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for issueReplaceLabels
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue (required)
|
|
* @param body (optional)
|
|
* @param progressListener Progress listener
|
|
* @param progressRequestListener Progress request listener
|
|
* @return Call to execute
|
|
* @throws ApiException If fail to serialize the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call issueReplaceLabelsCall(String owner, String repo, Long index, IssueLabelsOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = body;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/repos/{owner}/{repo}/issues/{index}/labels"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()))
|
|
.replaceAll("\\{" + "index" + "\\}", apiClient.escapeString(index.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, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call issueReplaceLabelsValidateBeforeCall(String owner, String repo, Long index, IssueLabelsOption body, 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 issueReplaceLabels(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling issueReplaceLabels(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'index' is set
|
|
if (index == null) {
|
|
throw new ApiException("Missing the required parameter 'index' when calling issueReplaceLabels(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = issueReplaceLabelsCall(owner, repo, index, body, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* Replace an issue's labels
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue (required)
|
|
* @param body (optional)
|
|
* @return List<Label>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public List<Label> issueReplaceLabels(String owner, String repo, Long index, IssueLabelsOption body) throws ApiException {
|
|
ApiResponse<List<Label>> resp = issueReplaceLabelsWithHttpInfo(owner, repo, index, body);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* Replace an issue's labels
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue (required)
|
|
* @param body (optional)
|
|
* @return ApiResponse<List<Label>>
|
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
*/
|
|
public ApiResponse<List<Label>> issueReplaceLabelsWithHttpInfo(String owner, String repo, Long index, IssueLabelsOption body) throws ApiException {
|
|
com.squareup.okhttp.Call call = issueReplaceLabelsValidateBeforeCall(owner, repo, index, body, null, null);
|
|
Type localVarReturnType = new TypeToken<List<Label>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* Replace an issue's labels (asynchronously)
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param index index of the issue (required)
|
|
* @param body (optional)
|
|
* @param callback The callback to be executed when the API call finishes
|
|
* @return The request call
|
|
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
*/
|
|
public com.squareup.okhttp.Call issueReplaceLabelsAsync(String owner, String repo, Long index, IssueLabelsOption body, final ApiCallback<List<Label>> 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 = issueReplaceLabelsValidateBeforeCall(owner, repo, index, body, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<Label>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
/**
|
|
* Build call for issueTrackedTimes
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id index of the issue (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 issueTrackedTimesCall(String owner, String repo, Long id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
Object localVarPostBody = null;
|
|
|
|
// create path and map variables
|
|
String localVarPath = "/repos/{owner}/{repo}/issues/{id}/times"
|
|
.replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString()))
|
|
.replaceAll("\\{" + "repo" + "\\}", apiClient.escapeString(repo.toString()))
|
|
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
|
|
|
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
|
final String[] localVarAccepts = {
|
|
"application/json"
|
|
};
|
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
|
final String[] localVarContentTypes = {
|
|
"application/json", "text/plain"
|
|
};
|
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
|
|
|
if(progressListener != null) {
|
|
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
|
@Override
|
|
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
|
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
|
return originalResponse.newBuilder()
|
|
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
|
.build();
|
|
}
|
|
});
|
|
}
|
|
|
|
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "Token" };
|
|
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
}
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
private com.squareup.okhttp.Call issueTrackedTimesValidateBeforeCall(String owner, String repo, Long id, 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 issueTrackedTimes(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'repo' is set
|
|
if (repo == null) {
|
|
throw new ApiException("Missing the required parameter 'repo' when calling issueTrackedTimes(Async)");
|
|
}
|
|
|
|
// verify the required parameter 'id' is set
|
|
if (id == null) {
|
|
throw new ApiException("Missing the required parameter 'id' when calling issueTrackedTimes(Async)");
|
|
}
|
|
|
|
|
|
com.squareup.okhttp.Call call = issueTrackedTimesCall(owner, repo, id, progressListener, progressRequestListener);
|
|
return call;
|
|
|
|
}
|
|
|
|
/**
|
|
* List an issue's tracked times
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id index of the issue (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> issueTrackedTimes(String owner, String repo, Long id) throws ApiException {
|
|
ApiResponse<List<TrackedTime>> resp = issueTrackedTimesWithHttpInfo(owner, repo, id);
|
|
return resp.getData();
|
|
}
|
|
|
|
/**
|
|
* List an issue's tracked times
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id index of the issue (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>> issueTrackedTimesWithHttpInfo(String owner, String repo, Long id) throws ApiException {
|
|
com.squareup.okhttp.Call call = issueTrackedTimesValidateBeforeCall(owner, repo, id, null, null);
|
|
Type localVarReturnType = new TypeToken<List<TrackedTime>>(){}.getType();
|
|
return apiClient.execute(call, localVarReturnType);
|
|
}
|
|
|
|
/**
|
|
* List an issue's tracked times (asynchronously)
|
|
*
|
|
* @param owner owner of the repo (required)
|
|
* @param repo name of the repo (required)
|
|
* @param id index of the issue (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 issueTrackedTimesAsync(String owner, String repo, Long id, 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 = issueTrackedTimesValidateBeforeCall(owner, repo, id, progressListener, progressRequestListener);
|
|
Type localVarReturnType = new TypeToken<List<TrackedTime>>(){}.getType();
|
|
apiClient.executeAsync(call, localVarReturnType, callback);
|
|
return call;
|
|
}
|
|
}
|