java-gitea-api/src/main/java/io/gitea/api/OrganizationApi.java

3750 lines
174 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.Branch;
import io.gitea.model.CreateHookOption;
import io.gitea.model.CreateRepoOption;
import io.gitea.model.CreateTeamOption;
import io.gitea.model.EditHookOption;
import io.gitea.model.EditOrgOption;
import io.gitea.model.EditTeamOption;
import io.gitea.model.Organization;
import io.gitea.model.Repository;
import io.gitea.model.Team;
import io.gitea.model.User;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class OrganizationApi {
private ApiClient apiClient;
public OrganizationApi() {
this(Configuration.getDefaultApiClient());
}
public OrganizationApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Build call for createOrgRepo
* @param org name of organization (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 createOrgRepoCall(String org, CreateRepoOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = body;
// create path and map variables
String localVarPath = "/org/{org}/repos"
.replaceAll("\\{" + "org" + "\\}", apiClient.escapeString(org.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 createOrgRepoValidateBeforeCall(String org, CreateRepoOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'org' is set
if (org == null) {
throw new ApiException("Missing the required parameter 'org' when calling createOrgRepo(Async)");
}
com.squareup.okhttp.Call call = createOrgRepoCall(org, body, progressListener, progressRequestListener);
return call;
}
/**
* Create a repository in an organization
*
* @param org name of organization (required)
* @param body (optional)
* @return Repository
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public Repository createOrgRepo(String org, CreateRepoOption body) throws ApiException {
ApiResponse<Repository> resp = createOrgRepoWithHttpInfo(org, body);
return resp.getData();
}
/**
* Create a repository in an organization
*
* @param org name of organization (required)
* @param body (optional)
* @return ApiResponse&lt;Repository&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Repository> createOrgRepoWithHttpInfo(String org, CreateRepoOption body) throws ApiException {
com.squareup.okhttp.Call call = createOrgRepoValidateBeforeCall(org, body, null, null);
Type localVarReturnType = new TypeToken<Repository>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Create a repository in an organization (asynchronously)
*
* @param org name of organization (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 createOrgRepoAsync(String org, CreateRepoOption body, final ApiCallback<Repository> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = createOrgRepoValidateBeforeCall(org, body, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<Repository>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for orgAddTeamMember
* @param id id of the team (required)
* @param username username of the user to add (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 orgAddTeamMemberCall(Long id, String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/teams/{id}/members/{username}"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json", "text/plain"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "Token" };
return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call orgAddTeamMemberValidateBeforeCall(Long id, String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling orgAddTeamMember(Async)");
}
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException("Missing the required parameter 'username' when calling orgAddTeamMember(Async)");
}
com.squareup.okhttp.Call call = orgAddTeamMemberCall(id, username, progressListener, progressRequestListener);
return call;
}
/**
* Add a team member
*
* @param id id of the team (required)
* @param username username of the user to add (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void orgAddTeamMember(Long id, String username) throws ApiException {
orgAddTeamMemberWithHttpInfo(id, username);
}
/**
* Add a team member
*
* @param id id of the team (required)
* @param username username of the user to add (required)
* @return ApiResponse&lt;Void&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> orgAddTeamMemberWithHttpInfo(Long id, String username) throws ApiException {
com.squareup.okhttp.Call call = orgAddTeamMemberValidateBeforeCall(id, username, null, null);
return apiClient.execute(call);
}
/**
* Add a team member (asynchronously)
*
* @param id id of the team (required)
* @param username username of the user to add (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 orgAddTeamMemberAsync(Long id, String username, final ApiCallback<Void> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = orgAddTeamMemberValidateBeforeCall(id, username, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/**
* Build call for orgAddTeamRepository
* @param id id of the team (required)
* @param org organization that owns the repo to add (required)
* @param repo name of the repo to add (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 orgAddTeamRepositoryCall(Long id, String org, String repo, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/teams/{id}/repos/{org}/{repo}"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
.replaceAll("\\{" + "org" + "\\}", apiClient.escapeString(org.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, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call orgAddTeamRepositoryValidateBeforeCall(Long id, String org, String repo, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling orgAddTeamRepository(Async)");
}
// verify the required parameter 'org' is set
if (org == null) {
throw new ApiException("Missing the required parameter 'org' when calling orgAddTeamRepository(Async)");
}
// verify the required parameter 'repo' is set
if (repo == null) {
throw new ApiException("Missing the required parameter 'repo' when calling orgAddTeamRepository(Async)");
}
com.squareup.okhttp.Call call = orgAddTeamRepositoryCall(id, org, repo, progressListener, progressRequestListener);
return call;
}
/**
* Add a repository to a team
*
* @param id id of the team (required)
* @param org organization that owns the repo to add (required)
* @param repo name of the repo to add (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void orgAddTeamRepository(Long id, String org, String repo) throws ApiException {
orgAddTeamRepositoryWithHttpInfo(id, org, repo);
}
/**
* Add a repository to a team
*
* @param id id of the team (required)
* @param org organization that owns the repo to add (required)
* @param repo name of the repo to add (required)
* @return ApiResponse&lt;Void&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> orgAddTeamRepositoryWithHttpInfo(Long id, String org, String repo) throws ApiException {
com.squareup.okhttp.Call call = orgAddTeamRepositoryValidateBeforeCall(id, org, repo, null, null);
return apiClient.execute(call);
}
/**
* Add a repository to a team (asynchronously)
*
* @param id id of the team (required)
* @param org organization that owns the repo to add (required)
* @param repo name of the repo to add (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 orgAddTeamRepositoryAsync(Long id, String org, String repo, final ApiCallback<Void> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = orgAddTeamRepositoryValidateBeforeCall(id, org, repo, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/**
* Build call for orgConcealMember
* @param org name of the organization (required)
* @param username username of the user (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call orgConcealMemberCall(String org, String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/orgs/{org}/public_members/{username}"
.replaceAll("\\{" + "org" + "\\}", apiClient.escapeString(org.toString()))
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json", "text/plain"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "Token" };
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call orgConcealMemberValidateBeforeCall(String org, String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'org' is set
if (org == null) {
throw new ApiException("Missing the required parameter 'org' when calling orgConcealMember(Async)");
}
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException("Missing the required parameter 'username' when calling orgConcealMember(Async)");
}
com.squareup.okhttp.Call call = orgConcealMemberCall(org, username, progressListener, progressRequestListener);
return call;
}
/**
* Conceal a user&#39;s membership
*
* @param org name of the organization (required)
* @param username username of the user (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void orgConcealMember(String org, String username) throws ApiException {
orgConcealMemberWithHttpInfo(org, username);
}
/**
* Conceal a user&#39;s membership
*
* @param org name of the organization (required)
* @param username username of the user (required)
* @return ApiResponse&lt;Void&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> orgConcealMemberWithHttpInfo(String org, String username) throws ApiException {
com.squareup.okhttp.Call call = orgConcealMemberValidateBeforeCall(org, username, null, null);
return apiClient.execute(call);
}
/**
* Conceal a user&#39;s membership (asynchronously)
*
* @param org name of the organization (required)
* @param username username of the user (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call orgConcealMemberAsync(String org, String username, final ApiCallback<Void> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = orgConcealMemberValidateBeforeCall(org, username, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/**
* Build call for orgCreateHook
* @param org name of the organization (required)
* @param body (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call orgCreateHookCall(String org, CreateHookOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = body;
// create path and map variables
String localVarPath = "/orgs/{org}/hooks/"
.replaceAll("\\{" + "org" + "\\}", apiClient.escapeString(org.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 orgCreateHookValidateBeforeCall(String org, CreateHookOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'org' is set
if (org == null) {
throw new ApiException("Missing the required parameter 'org' when calling orgCreateHook(Async)");
}
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException("Missing the required parameter 'body' when calling orgCreateHook(Async)");
}
com.squareup.okhttp.Call call = orgCreateHookCall(org, body, progressListener, progressRequestListener);
return call;
}
/**
* Create a hook
*
* @param org name of the organization (required)
* @param body (required)
* @return List&lt;Branch&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public List<Branch> orgCreateHook(String org, CreateHookOption body) throws ApiException {
ApiResponse<List<Branch>> resp = orgCreateHookWithHttpInfo(org, body);
return resp.getData();
}
/**
* Create a hook
*
* @param org name of the organization (required)
* @param body (required)
* @return ApiResponse&lt;List&lt;Branch&gt;&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<List<Branch>> orgCreateHookWithHttpInfo(String org, CreateHookOption body) throws ApiException {
com.squareup.okhttp.Call call = orgCreateHookValidateBeforeCall(org, body, null, null);
Type localVarReturnType = new TypeToken<List<Branch>>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Create a hook (asynchronously)
*
* @param org name of the organization (required)
* @param body (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call orgCreateHookAsync(String org, CreateHookOption body, final ApiCallback<List<Branch>> 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 = orgCreateHookValidateBeforeCall(org, body, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<List<Branch>>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for orgCreateTeam
* @param org name of the organization (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 orgCreateTeamCall(String org, CreateTeamOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = body;
// create path and map variables
String localVarPath = "/orgs/{org}/teams"
.replaceAll("\\{" + "org" + "\\}", apiClient.escapeString(org.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 orgCreateTeamValidateBeforeCall(String org, CreateTeamOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'org' is set
if (org == null) {
throw new ApiException("Missing the required parameter 'org' when calling orgCreateTeam(Async)");
}
com.squareup.okhttp.Call call = orgCreateTeamCall(org, body, progressListener, progressRequestListener);
return call;
}
/**
* Create a team
*
* @param org name of the organization (required)
* @param body (optional)
* @return Team
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public Team orgCreateTeam(String org, CreateTeamOption body) throws ApiException {
ApiResponse<Team> resp = orgCreateTeamWithHttpInfo(org, body);
return resp.getData();
}
/**
* Create a team
*
* @param org name of the organization (required)
* @param body (optional)
* @return ApiResponse&lt;Team&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Team> orgCreateTeamWithHttpInfo(String org, CreateTeamOption body) throws ApiException {
com.squareup.okhttp.Call call = orgCreateTeamValidateBeforeCall(org, body, null, null);
Type localVarReturnType = new TypeToken<Team>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Create a team (asynchronously)
*
* @param org name of the organization (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 orgCreateTeamAsync(String org, CreateTeamOption body, final ApiCallback<Team> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = orgCreateTeamValidateBeforeCall(org, body, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<Team>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for orgDeleteHook
* @param org name of the organization (required)
* @param id id of the hook to delete (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call orgDeleteHookCall(String org, Long id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/orgs/{org}/hooks/{id}"
.replaceAll("\\{" + "org" + "\\}", apiClient.escapeString(org.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 orgDeleteHookValidateBeforeCall(String org, Long id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'org' is set
if (org == null) {
throw new ApiException("Missing the required parameter 'org' when calling orgDeleteHook(Async)");
}
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling orgDeleteHook(Async)");
}
com.squareup.okhttp.Call call = orgDeleteHookCall(org, id, progressListener, progressRequestListener);
return call;
}
/**
* Delete a hook
*
* @param org name of the organization (required)
* @param id id of the hook to delete (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void orgDeleteHook(String org, Long id) throws ApiException {
orgDeleteHookWithHttpInfo(org, id);
}
/**
* Delete a hook
*
* @param org name of the organization (required)
* @param id id of the hook to delete (required)
* @return ApiResponse&lt;Void&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> orgDeleteHookWithHttpInfo(String org, Long id) throws ApiException {
com.squareup.okhttp.Call call = orgDeleteHookValidateBeforeCall(org, id, null, null);
return apiClient.execute(call);
}
/**
* Delete a hook (asynchronously)
*
* @param org name of the organization (required)
* @param id id of the hook to delete (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call orgDeleteHookAsync(String org, 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 = orgDeleteHookValidateBeforeCall(org, id, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/**
* Build call for orgDeleteMember
* @param org name of the organization (required)
* @param username username of the user (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call orgDeleteMemberCall(String org, String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/orgs/{org}/members/{username}"
.replaceAll("\\{" + "org" + "\\}", apiClient.escapeString(org.toString()))
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json", "text/plain"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "Token" };
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call orgDeleteMemberValidateBeforeCall(String org, String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'org' is set
if (org == null) {
throw new ApiException("Missing the required parameter 'org' when calling orgDeleteMember(Async)");
}
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException("Missing the required parameter 'username' when calling orgDeleteMember(Async)");
}
com.squareup.okhttp.Call call = orgDeleteMemberCall(org, username, progressListener, progressRequestListener);
return call;
}
/**
* Remove a member from an organization
*
* @param org name of the organization (required)
* @param username username of the user (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void orgDeleteMember(String org, String username) throws ApiException {
orgDeleteMemberWithHttpInfo(org, username);
}
/**
* Remove a member from an organization
*
* @param org name of the organization (required)
* @param username username of the user (required)
* @return ApiResponse&lt;Void&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> orgDeleteMemberWithHttpInfo(String org, String username) throws ApiException {
com.squareup.okhttp.Call call = orgDeleteMemberValidateBeforeCall(org, username, null, null);
return apiClient.execute(call);
}
/**
* Remove a member from an organization (asynchronously)
*
* @param org name of the organization (required)
* @param username username of the user (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call orgDeleteMemberAsync(String org, String username, final ApiCallback<Void> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = orgDeleteMemberValidateBeforeCall(org, username, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/**
* Build call for orgDeleteTeam
* @param id id of the team 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 orgDeleteTeamCall(Long id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/teams/{id}"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "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 orgDeleteTeamValidateBeforeCall(Long id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling orgDeleteTeam(Async)");
}
com.squareup.okhttp.Call call = orgDeleteTeamCall(id, progressListener, progressRequestListener);
return call;
}
/**
* Delete a team
*
* @param id id of the team to delete (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void orgDeleteTeam(Long id) throws ApiException {
orgDeleteTeamWithHttpInfo(id);
}
/**
* Delete a team
*
* @param id id of the team to delete (required)
* @return ApiResponse&lt;Void&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> orgDeleteTeamWithHttpInfo(Long id) throws ApiException {
com.squareup.okhttp.Call call = orgDeleteTeamValidateBeforeCall(id, null, null);
return apiClient.execute(call);
}
/**
* Delete a team (asynchronously)
*
* @param id id of the team 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 orgDeleteTeamAsync(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 = orgDeleteTeamValidateBeforeCall(id, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/**
* Build call for orgEdit
* @param org name of the organization 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 orgEditCall(String org, EditOrgOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = body;
// create path and map variables
String localVarPath = "/orgs/{org}"
.replaceAll("\\{" + "org" + "\\}", apiClient.escapeString(org.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 orgEditValidateBeforeCall(String org, EditOrgOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'org' is set
if (org == null) {
throw new ApiException("Missing the required parameter 'org' when calling orgEdit(Async)");
}
com.squareup.okhttp.Call call = orgEditCall(org, body, progressListener, progressRequestListener);
return call;
}
/**
* Edit an organization
*
* @param org name of the organization to edit (required)
* @param body (optional)
* @return Organization
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public Organization orgEdit(String org, EditOrgOption body) throws ApiException {
ApiResponse<Organization> resp = orgEditWithHttpInfo(org, body);
return resp.getData();
}
/**
* Edit an organization
*
* @param org name of the organization to edit (required)
* @param body (optional)
* @return ApiResponse&lt;Organization&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Organization> orgEditWithHttpInfo(String org, EditOrgOption body) throws ApiException {
com.squareup.okhttp.Call call = orgEditValidateBeforeCall(org, body, null, null);
Type localVarReturnType = new TypeToken<Organization>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Edit an organization (asynchronously)
*
* @param org name of the organization 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 orgEditAsync(String org, EditOrgOption body, final ApiCallback<Organization> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = orgEditValidateBeforeCall(org, body, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<Organization>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for orgEditHook
* @param org name of the organization (required)
* @param id id of the hook to update (required)
* @param body (optional)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call orgEditHookCall(String org, Long id, EditHookOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = body;
// create path and map variables
String localVarPath = "/orgs/{org}/hooks/{id}"
.replaceAll("\\{" + "org" + "\\}", apiClient.escapeString(org.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 orgEditHookValidateBeforeCall(String org, Long id, EditHookOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'org' is set
if (org == null) {
throw new ApiException("Missing the required parameter 'org' when calling orgEditHook(Async)");
}
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling orgEditHook(Async)");
}
com.squareup.okhttp.Call call = orgEditHookCall(org, id, body, progressListener, progressRequestListener);
return call;
}
/**
* Update a hook
*
* @param org name of the organization (required)
* @param id id of the hook to update (required)
* @param body (optional)
* @return List&lt;Branch&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public List<Branch> orgEditHook(String org, Long id, EditHookOption body) throws ApiException {
ApiResponse<List<Branch>> resp = orgEditHookWithHttpInfo(org, id, body);
return resp.getData();
}
/**
* Update a hook
*
* @param org name of the organization (required)
* @param id id of the hook to update (required)
* @param body (optional)
* @return ApiResponse&lt;List&lt;Branch&gt;&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<List<Branch>> orgEditHookWithHttpInfo(String org, Long id, EditHookOption body) throws ApiException {
com.squareup.okhttp.Call call = orgEditHookValidateBeforeCall(org, id, body, null, null);
Type localVarReturnType = new TypeToken<List<Branch>>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Update a hook (asynchronously)
*
* @param org name of the organization (required)
* @param id id of the hook to update (required)
* @param body (optional)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call orgEditHookAsync(String org, Long id, EditHookOption body, final ApiCallback<List<Branch>> 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 = orgEditHookValidateBeforeCall(org, id, body, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<List<Branch>>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for orgEditTeam
* @param id id of the team 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 orgEditTeamCall(Integer id, EditTeamOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = body;
// create path and map variables
String localVarPath = "/teams/{id}"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "Token" };
return apiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call orgEditTeamValidateBeforeCall(Integer id, EditTeamOption body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling orgEditTeam(Async)");
}
com.squareup.okhttp.Call call = orgEditTeamCall(id, body, progressListener, progressRequestListener);
return call;
}
/**
* Edit a team
*
* @param id id of the team to edit (required)
* @param body (optional)
* @return Team
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public Team orgEditTeam(Integer id, EditTeamOption body) throws ApiException {
ApiResponse<Team> resp = orgEditTeamWithHttpInfo(id, body);
return resp.getData();
}
/**
* Edit a team
*
* @param id id of the team to edit (required)
* @param body (optional)
* @return ApiResponse&lt;Team&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Team> orgEditTeamWithHttpInfo(Integer id, EditTeamOption body) throws ApiException {
com.squareup.okhttp.Call call = orgEditTeamValidateBeforeCall(id, body, null, null);
Type localVarReturnType = new TypeToken<Team>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Edit a team (asynchronously)
*
* @param id id of the team 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 orgEditTeamAsync(Integer id, EditTeamOption body, final ApiCallback<Team> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = orgEditTeamValidateBeforeCall(id, body, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<Team>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for orgGet
* @param org name of the organization 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 orgGetCall(String org, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/orgs/{org}"
.replaceAll("\\{" + "org" + "\\}", apiClient.escapeString(org.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 orgGetValidateBeforeCall(String org, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'org' is set
if (org == null) {
throw new ApiException("Missing the required parameter 'org' when calling orgGet(Async)");
}
com.squareup.okhttp.Call call = orgGetCall(org, progressListener, progressRequestListener);
return call;
}
/**
* Get an organization
*
* @param org name of the organization to get (required)
* @return Organization
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public Organization orgGet(String org) throws ApiException {
ApiResponse<Organization> resp = orgGetWithHttpInfo(org);
return resp.getData();
}
/**
* Get an organization
*
* @param org name of the organization to get (required)
* @return ApiResponse&lt;Organization&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Organization> orgGetWithHttpInfo(String org) throws ApiException {
com.squareup.okhttp.Call call = orgGetValidateBeforeCall(org, null, null);
Type localVarReturnType = new TypeToken<Organization>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Get an organization (asynchronously)
*
* @param org name of the organization 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 orgGetAsync(String org, final ApiCallback<Organization> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = orgGetValidateBeforeCall(org, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<Organization>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for orgGetHook
* @param org name of the organization (required)
* @param id id of the hook to get (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call orgGetHookCall(String org, Long id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/orgs/{org}/hooks/{id}"
.replaceAll("\\{" + "org" + "\\}", apiClient.escapeString(org.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 orgGetHookValidateBeforeCall(String org, Long id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'org' is set
if (org == null) {
throw new ApiException("Missing the required parameter 'org' when calling orgGetHook(Async)");
}
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling orgGetHook(Async)");
}
com.squareup.okhttp.Call call = orgGetHookCall(org, id, progressListener, progressRequestListener);
return call;
}
/**
* Get a hook
*
* @param org name of the organization (required)
* @param id id of the hook to get (required)
* @return List&lt;Branch&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public List<Branch> orgGetHook(String org, Long id) throws ApiException {
ApiResponse<List<Branch>> resp = orgGetHookWithHttpInfo(org, id);
return resp.getData();
}
/**
* Get a hook
*
* @param org name of the organization (required)
* @param id id of the hook to get (required)
* @return ApiResponse&lt;List&lt;Branch&gt;&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<List<Branch>> orgGetHookWithHttpInfo(String org, Long id) throws ApiException {
com.squareup.okhttp.Call call = orgGetHookValidateBeforeCall(org, id, null, null);
Type localVarReturnType = new TypeToken<List<Branch>>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Get a hook (asynchronously)
*
* @param org name of the organization (required)
* @param id id of the hook to get (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call orgGetHookAsync(String org, Long id, final ApiCallback<List<Branch>> 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 = orgGetHookValidateBeforeCall(org, id, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<List<Branch>>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for orgGetTeam
* @param id id of the team 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 orgGetTeamCall(Long id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/teams/{id}"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json", "text/plain"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "Token" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call orgGetTeamValidateBeforeCall(Long id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling orgGetTeam(Async)");
}
com.squareup.okhttp.Call call = orgGetTeamCall(id, progressListener, progressRequestListener);
return call;
}
/**
* Get a team
*
* @param id id of the team to get (required)
* @return Team
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public Team orgGetTeam(Long id) throws ApiException {
ApiResponse<Team> resp = orgGetTeamWithHttpInfo(id);
return resp.getData();
}
/**
* Get a team
*
* @param id id of the team to get (required)
* @return ApiResponse&lt;Team&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Team> orgGetTeamWithHttpInfo(Long id) throws ApiException {
com.squareup.okhttp.Call call = orgGetTeamValidateBeforeCall(id, null, null);
Type localVarReturnType = new TypeToken<Team>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Get a team (asynchronously)
*
* @param id id of the team 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 orgGetTeamAsync(Long id, final ApiCallback<Team> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = orgGetTeamValidateBeforeCall(id, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<Team>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for orgIsMember
* @param org name of the organization (required)
* @param username username of the user (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call orgIsMemberCall(String org, String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/orgs/{org}/members/{username}"
.replaceAll("\\{" + "org" + "\\}", apiClient.escapeString(org.toString()))
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "text/html"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json", "text/plain"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "Token" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call orgIsMemberValidateBeforeCall(String org, String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'org' is set
if (org == null) {
throw new ApiException("Missing the required parameter 'org' when calling orgIsMember(Async)");
}
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException("Missing the required parameter 'username' when calling orgIsMember(Async)");
}
com.squareup.okhttp.Call call = orgIsMemberCall(org, username, progressListener, progressRequestListener);
return call;
}
/**
* Check if a user is a member of an organization
*
* @param org name of the organization (required)
* @param username username of the user (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void orgIsMember(String org, String username) throws ApiException {
orgIsMemberWithHttpInfo(org, username);
}
/**
* Check if a user is a member of an organization
*
* @param org name of the organization (required)
* @param username username of the user (required)
* @return ApiResponse&lt;Void&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> orgIsMemberWithHttpInfo(String org, String username) throws ApiException {
com.squareup.okhttp.Call call = orgIsMemberValidateBeforeCall(org, username, null, null);
return apiClient.execute(call);
}
/**
* Check if a user is a member of an organization (asynchronously)
*
* @param org name of the organization (required)
* @param username username of the user (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call orgIsMemberAsync(String org, String username, final ApiCallback<Void> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = orgIsMemberValidateBeforeCall(org, username, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/**
* Build call for orgIsPublicMember
* @param org name of the organization (required)
* @param username username of the user (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call orgIsPublicMemberCall(String org, String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/orgs/{org}/public_members/{username}"
.replaceAll("\\{" + "org" + "\\}", apiClient.escapeString(org.toString()))
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "text/html"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json", "text/plain"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "Token" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call orgIsPublicMemberValidateBeforeCall(String org, String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'org' is set
if (org == null) {
throw new ApiException("Missing the required parameter 'org' when calling orgIsPublicMember(Async)");
}
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException("Missing the required parameter 'username' when calling orgIsPublicMember(Async)");
}
com.squareup.okhttp.Call call = orgIsPublicMemberCall(org, username, progressListener, progressRequestListener);
return call;
}
/**
* Check if a user is a public member of an organization
*
* @param org name of the organization (required)
* @param username username of the user (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void orgIsPublicMember(String org, String username) throws ApiException {
orgIsPublicMemberWithHttpInfo(org, username);
}
/**
* Check if a user is a public member of an organization
*
* @param org name of the organization (required)
* @param username username of the user (required)
* @return ApiResponse&lt;Void&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> orgIsPublicMemberWithHttpInfo(String org, String username) throws ApiException {
com.squareup.okhttp.Call call = orgIsPublicMemberValidateBeforeCall(org, username, null, null);
return apiClient.execute(call);
}
/**
* Check if a user is a public member of an organization (asynchronously)
*
* @param org name of the organization (required)
* @param username username of the user (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call orgIsPublicMemberAsync(String org, String username, final ApiCallback<Void> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = orgIsPublicMemberValidateBeforeCall(org, username, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/**
* Build call for orgListCurrentUserOrgs
* @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 orgListCurrentUserOrgsCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/user/orgs";
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 orgListCurrentUserOrgsValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
com.squareup.okhttp.Call call = orgListCurrentUserOrgsCall(progressListener, progressRequestListener);
return call;
}
/**
* List the current user&#39;s organizations
*
* @return List&lt;Organization&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public List<Organization> orgListCurrentUserOrgs() throws ApiException {
ApiResponse<List<Organization>> resp = orgListCurrentUserOrgsWithHttpInfo();
return resp.getData();
}
/**
* List the current user&#39;s organizations
*
* @return ApiResponse&lt;List&lt;Organization&gt;&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<List<Organization>> orgListCurrentUserOrgsWithHttpInfo() throws ApiException {
com.squareup.okhttp.Call call = orgListCurrentUserOrgsValidateBeforeCall(null, null);
Type localVarReturnType = new TypeToken<List<Organization>>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* List the current user&#39;s organizations (asynchronously)
*
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call orgListCurrentUserOrgsAsync(final ApiCallback<List<Organization>> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = orgListCurrentUserOrgsValidateBeforeCall(progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<List<Organization>>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for orgListHooks
* @param org name of the organization (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call orgListHooksCall(String org, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/orgs/{org}/hooks"
.replaceAll("\\{" + "org" + "\\}", apiClient.escapeString(org.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 orgListHooksValidateBeforeCall(String org, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'org' is set
if (org == null) {
throw new ApiException("Missing the required parameter 'org' when calling orgListHooks(Async)");
}
com.squareup.okhttp.Call call = orgListHooksCall(org, progressListener, progressRequestListener);
return call;
}
/**
* List an organization&#39;s webhooks
*
* @param org name of the organization (required)
* @return List&lt;Branch&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public List<Branch> orgListHooks(String org) throws ApiException {
ApiResponse<List<Branch>> resp = orgListHooksWithHttpInfo(org);
return resp.getData();
}
/**
* List an organization&#39;s webhooks
*
* @param org name of the organization (required)
* @return ApiResponse&lt;List&lt;Branch&gt;&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<List<Branch>> orgListHooksWithHttpInfo(String org) throws ApiException {
com.squareup.okhttp.Call call = orgListHooksValidateBeforeCall(org, null, null);
Type localVarReturnType = new TypeToken<List<Branch>>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* List an organization&#39;s webhooks (asynchronously)
*
* @param org name of the organization (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call orgListHooksAsync(String org, final ApiCallback<List<Branch>> 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 = orgListHooksValidateBeforeCall(org, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<List<Branch>>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for orgListMembers
* @param org name of the organization (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call orgListMembersCall(String org, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/orgs/{org}/members"
.replaceAll("\\{" + "org" + "\\}", apiClient.escapeString(org.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 orgListMembersValidateBeforeCall(String org, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'org' is set
if (org == null) {
throw new ApiException("Missing the required parameter 'org' when calling orgListMembers(Async)");
}
com.squareup.okhttp.Call call = orgListMembersCall(org, progressListener, progressRequestListener);
return call;
}
/**
* List an organization&#39;s members
*
* @param org name of the organization (required)
* @return List&lt;User&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public List<User> orgListMembers(String org) throws ApiException {
ApiResponse<List<User>> resp = orgListMembersWithHttpInfo(org);
return resp.getData();
}
/**
* List an organization&#39;s members
*
* @param org name of the organization (required)
* @return ApiResponse&lt;List&lt;User&gt;&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<List<User>> orgListMembersWithHttpInfo(String org) throws ApiException {
com.squareup.okhttp.Call call = orgListMembersValidateBeforeCall(org, null, null);
Type localVarReturnType = new TypeToken<List<User>>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* List an organization&#39;s members (asynchronously)
*
* @param org name of the organization (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call orgListMembersAsync(String org, final ApiCallback<List<User>> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = orgListMembersValidateBeforeCall(org, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<List<User>>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for orgListPublicMembers
* @param org name of the organization (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call orgListPublicMembersCall(String org, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/orgs/{org}/public_members"
.replaceAll("\\{" + "org" + "\\}", apiClient.escapeString(org.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 orgListPublicMembersValidateBeforeCall(String org, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'org' is set
if (org == null) {
throw new ApiException("Missing the required parameter 'org' when calling orgListPublicMembers(Async)");
}
com.squareup.okhttp.Call call = orgListPublicMembersCall(org, progressListener, progressRequestListener);
return call;
}
/**
* List an organization&#39;s public members
*
* @param org name of the organization (required)
* @return List&lt;User&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public List<User> orgListPublicMembers(String org) throws ApiException {
ApiResponse<List<User>> resp = orgListPublicMembersWithHttpInfo(org);
return resp.getData();
}
/**
* List an organization&#39;s public members
*
* @param org name of the organization (required)
* @return ApiResponse&lt;List&lt;User&gt;&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<List<User>> orgListPublicMembersWithHttpInfo(String org) throws ApiException {
com.squareup.okhttp.Call call = orgListPublicMembersValidateBeforeCall(org, null, null);
Type localVarReturnType = new TypeToken<List<User>>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* List an organization&#39;s public members (asynchronously)
*
* @param org name of the organization (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call orgListPublicMembersAsync(String org, final ApiCallback<List<User>> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = orgListPublicMembersValidateBeforeCall(org, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<List<User>>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for orgListRepos
* @param org name of the organization (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call orgListReposCall(String org, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/orgs/{org}/repos"
.replaceAll("\\{" + "org" + "\\}", apiClient.escapeString(org.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 orgListReposValidateBeforeCall(String org, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'org' is set
if (org == null) {
throw new ApiException("Missing the required parameter 'org' when calling orgListRepos(Async)");
}
com.squareup.okhttp.Call call = orgListReposCall(org, progressListener, progressRequestListener);
return call;
}
/**
* List an organization&#39;s repos
*
* @param org name of the organization (required)
* @return List&lt;Repository&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public List<Repository> orgListRepos(String org) throws ApiException {
ApiResponse<List<Repository>> resp = orgListReposWithHttpInfo(org);
return resp.getData();
}
/**
* List an organization&#39;s repos
*
* @param org name of the organization (required)
* @return ApiResponse&lt;List&lt;Repository&gt;&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<List<Repository>> orgListReposWithHttpInfo(String org) throws ApiException {
com.squareup.okhttp.Call call = orgListReposValidateBeforeCall(org, null, null);
Type localVarReturnType = new TypeToken<List<Repository>>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* List an organization&#39;s repos (asynchronously)
*
* @param org name of the organization (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call orgListReposAsync(String org, final ApiCallback<List<Repository>> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = orgListReposValidateBeforeCall(org, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<List<Repository>>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for orgListTeamMembers
* @param id id of the team (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 orgListTeamMembersCall(Long id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/teams/{id}/members"
.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 orgListTeamMembersValidateBeforeCall(Long id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling orgListTeamMembers(Async)");
}
com.squareup.okhttp.Call call = orgListTeamMembersCall(id, progressListener, progressRequestListener);
return call;
}
/**
* List a team&#39;s members
*
* @param id id of the team (required)
* @return List&lt;User&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public List<User> orgListTeamMembers(Long id) throws ApiException {
ApiResponse<List<User>> resp = orgListTeamMembersWithHttpInfo(id);
return resp.getData();
}
/**
* List a team&#39;s members
*
* @param id id of the team (required)
* @return ApiResponse&lt;List&lt;User&gt;&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<List<User>> orgListTeamMembersWithHttpInfo(Long id) throws ApiException {
com.squareup.okhttp.Call call = orgListTeamMembersValidateBeforeCall(id, null, null);
Type localVarReturnType = new TypeToken<List<User>>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* List a team&#39;s members (asynchronously)
*
* @param id id of the team (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 orgListTeamMembersAsync(Long id, final ApiCallback<List<User>> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = orgListTeamMembersValidateBeforeCall(id, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<List<User>>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for orgListTeamRepos
* @param id id of the team (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 orgListTeamReposCall(Long id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/teams/{id}/repos"
.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 orgListTeamReposValidateBeforeCall(Long id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling orgListTeamRepos(Async)");
}
com.squareup.okhttp.Call call = orgListTeamReposCall(id, progressListener, progressRequestListener);
return call;
}
/**
* List a team&#39;s repos
*
* @param id id of the team (required)
* @return List&lt;Repository&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public List<Repository> orgListTeamRepos(Long id) throws ApiException {
ApiResponse<List<Repository>> resp = orgListTeamReposWithHttpInfo(id);
return resp.getData();
}
/**
* List a team&#39;s repos
*
* @param id id of the team (required)
* @return ApiResponse&lt;List&lt;Repository&gt;&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<List<Repository>> orgListTeamReposWithHttpInfo(Long id) throws ApiException {
com.squareup.okhttp.Call call = orgListTeamReposValidateBeforeCall(id, null, null);
Type localVarReturnType = new TypeToken<List<Repository>>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* List a team&#39;s repos (asynchronously)
*
* @param id id of the team (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 orgListTeamReposAsync(Long id, final ApiCallback<List<Repository>> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = orgListTeamReposValidateBeforeCall(id, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<List<Repository>>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for orgListTeams
* @param org name of the organization (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call orgListTeamsCall(String org, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/orgs/{org}/teams"
.replaceAll("\\{" + "org" + "\\}", apiClient.escapeString(org.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 orgListTeamsValidateBeforeCall(String org, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'org' is set
if (org == null) {
throw new ApiException("Missing the required parameter 'org' when calling orgListTeams(Async)");
}
com.squareup.okhttp.Call call = orgListTeamsCall(org, progressListener, progressRequestListener);
return call;
}
/**
* List an organization&#39;s teams
*
* @param org name of the organization (required)
* @return List&lt;Team&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public List<Team> orgListTeams(String org) throws ApiException {
ApiResponse<List<Team>> resp = orgListTeamsWithHttpInfo(org);
return resp.getData();
}
/**
* List an organization&#39;s teams
*
* @param org name of the organization (required)
* @return ApiResponse&lt;List&lt;Team&gt;&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<List<Team>> orgListTeamsWithHttpInfo(String org) throws ApiException {
com.squareup.okhttp.Call call = orgListTeamsValidateBeforeCall(org, null, null);
Type localVarReturnType = new TypeToken<List<Team>>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* List an organization&#39;s teams (asynchronously)
*
* @param org name of the organization (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call orgListTeamsAsync(String org, final ApiCallback<List<Team>> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = orgListTeamsValidateBeforeCall(org, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<List<Team>>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for orgListUserOrgs
* @param username username of user (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call orgListUserOrgsCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/user/{username}/orgs"
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json", "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 orgListUserOrgsValidateBeforeCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException("Missing the required parameter 'username' when calling orgListUserOrgs(Async)");
}
com.squareup.okhttp.Call call = orgListUserOrgsCall(username, progressListener, progressRequestListener);
return call;
}
/**
* List a user&#39;s organizations
*
* @param username username of user (required)
* @return List&lt;Organization&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public List<Organization> orgListUserOrgs(String username) throws ApiException {
ApiResponse<List<Organization>> resp = orgListUserOrgsWithHttpInfo(username);
return resp.getData();
}
/**
* List a user&#39;s organizations
*
* @param username username of user (required)
* @return ApiResponse&lt;List&lt;Organization&gt;&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<List<Organization>> orgListUserOrgsWithHttpInfo(String username) throws ApiException {
com.squareup.okhttp.Call call = orgListUserOrgsValidateBeforeCall(username, null, null);
Type localVarReturnType = new TypeToken<List<Organization>>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* List a user&#39;s organizations (asynchronously)
*
* @param username username of user (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call orgListUserOrgsAsync(String username, final ApiCallback<List<Organization>> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = orgListUserOrgsValidateBeforeCall(username, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<List<Organization>>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for orgPublicizeMember
* @param org name of the organization (required)
* @param username username of the user (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call orgPublicizeMemberCall(String org, String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/orgs/{org}/public_members/{username}"
.replaceAll("\\{" + "org" + "\\}", apiClient.escapeString(org.toString()))
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json", "text/plain"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "Token" };
return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call orgPublicizeMemberValidateBeforeCall(String org, String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'org' is set
if (org == null) {
throw new ApiException("Missing the required parameter 'org' when calling orgPublicizeMember(Async)");
}
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException("Missing the required parameter 'username' when calling orgPublicizeMember(Async)");
}
com.squareup.okhttp.Call call = orgPublicizeMemberCall(org, username, progressListener, progressRequestListener);
return call;
}
/**
* Publicize a user&#39;s membership
*
* @param org name of the organization (required)
* @param username username of the user (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void orgPublicizeMember(String org, String username) throws ApiException {
orgPublicizeMemberWithHttpInfo(org, username);
}
/**
* Publicize a user&#39;s membership
*
* @param org name of the organization (required)
* @param username username of the user (required)
* @return ApiResponse&lt;Void&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> orgPublicizeMemberWithHttpInfo(String org, String username) throws ApiException {
com.squareup.okhttp.Call call = orgPublicizeMemberValidateBeforeCall(org, username, null, null);
return apiClient.execute(call);
}
/**
* Publicize a user&#39;s membership (asynchronously)
*
* @param org name of the organization (required)
* @param username username of the user (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call orgPublicizeMemberAsync(String org, String username, final ApiCallback<Void> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = orgPublicizeMemberValidateBeforeCall(org, username, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/**
* Build call for orgRemoveTeamMember
* @param id id of the team (required)
* @param username username of the user 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 orgRemoveTeamMemberCall(Long id, String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/teams/{id}/members/{username}"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json", "text/plain"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "AccessToken", "AuthorizationHeaderToken", "BasicAuth", "SudoHeader", "SudoParam", "Token" };
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call orgRemoveTeamMemberValidateBeforeCall(Long id, String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling orgRemoveTeamMember(Async)");
}
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException("Missing the required parameter 'username' when calling orgRemoveTeamMember(Async)");
}
com.squareup.okhttp.Call call = orgRemoveTeamMemberCall(id, username, progressListener, progressRequestListener);
return call;
}
/**
* Remove a team member
*
* @param id id of the team (required)
* @param username username of the user to remove (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void orgRemoveTeamMember(Long id, String username) throws ApiException {
orgRemoveTeamMemberWithHttpInfo(id, username);
}
/**
* Remove a team member
*
* @param id id of the team (required)
* @param username username of the user to remove (required)
* @return ApiResponse&lt;Void&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> orgRemoveTeamMemberWithHttpInfo(Long id, String username) throws ApiException {
com.squareup.okhttp.Call call = orgRemoveTeamMemberValidateBeforeCall(id, username, null, null);
return apiClient.execute(call);
}
/**
* Remove a team member (asynchronously)
*
* @param id id of the team (required)
* @param username username of the user 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 orgRemoveTeamMemberAsync(Long id, String username, final ApiCallback<Void> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = orgRemoveTeamMemberValidateBeforeCall(id, username, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/**
* Build call for orgRemoveTeamRepository
* @param id id of the team (required)
* @param org organization that owns the repo to remove (required)
* @param repo name of the repo 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 orgRemoveTeamRepositoryCall(Long id, String org, String repo, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/teams/{id}/repos/{org}/{repo}"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
.replaceAll("\\{" + "org" + "\\}", apiClient.escapeString(org.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, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call orgRemoveTeamRepositoryValidateBeforeCall(Long id, String org, String repo, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling orgRemoveTeamRepository(Async)");
}
// verify the required parameter 'org' is set
if (org == null) {
throw new ApiException("Missing the required parameter 'org' when calling orgRemoveTeamRepository(Async)");
}
// verify the required parameter 'repo' is set
if (repo == null) {
throw new ApiException("Missing the required parameter 'repo' when calling orgRemoveTeamRepository(Async)");
}
com.squareup.okhttp.Call call = orgRemoveTeamRepositoryCall(id, org, repo, progressListener, progressRequestListener);
return call;
}
/**
* Remove a repository from a team
* This does not delete the repository, it only removes the repository from the team.
* @param id id of the team (required)
* @param org organization that owns the repo to remove (required)
* @param repo name of the repo to remove (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void orgRemoveTeamRepository(Long id, String org, String repo) throws ApiException {
orgRemoveTeamRepositoryWithHttpInfo(id, org, repo);
}
/**
* Remove a repository from a team
* This does not delete the repository, it only removes the repository from the team.
* @param id id of the team (required)
* @param org organization that owns the repo to remove (required)
* @param repo name of the repo to remove (required)
* @return ApiResponse&lt;Void&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> orgRemoveTeamRepositoryWithHttpInfo(Long id, String org, String repo) throws ApiException {
com.squareup.okhttp.Call call = orgRemoveTeamRepositoryValidateBeforeCall(id, org, repo, null, null);
return apiClient.execute(call);
}
/**
* Remove a repository from a team (asynchronously)
* This does not delete the repository, it only removes the repository from the team.
* @param id id of the team (required)
* @param org organization that owns the repo to remove (required)
* @param repo name of the repo 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 orgRemoveTeamRepositoryAsync(Long id, String org, String repo, final ApiCallback<Void> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = orgRemoveTeamRepositoryValidateBeforeCall(id, org, repo, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
}