@@ -8038,6 +8038,278 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
8038
8038
apiClient.executeAsync(call, localVarReturnType, callback);
8039
8039
return call;
8040
8040
}
8041
+ /**
8042
+ * Build call for clearLeveling
8043
+ * @param request ClearLeveling request with main agrs
8044
+ * @param progressListener Progress listener
8045
+ * @param progressRequestListener Progress request listener
8046
+ * @return Call to execute
8047
+ * @throws ApiException If fail to serialize the request body object
8048
+ */
8049
+ private com.squareup.okhttp.Call clearLevelingCall(ClearLevelingRequest request, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
8050
+ Object localVarPostBody = request.gettaskUids();
8051
+
8052
+ // create path and map variables
8053
+ String localVarPath = "/tasks/{name}/resourceLevel"
8054
+ .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(request.getname().toString()));
8055
+
8056
+ List<Pair> localVarQueryParams = new ArrayList<Pair>();
8057
+ List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
8058
+ localVarPath = addParameterToQuery(localVarQueryParams, localVarPath, "fileName", request.getfileName());
8059
+ localVarPath = addParameterToQuery(localVarQueryParams, localVarPath, "folder", request.getfolder());
8060
+ localVarPath = addParameterToQuery(localVarQueryParams, localVarPath, "storage", request.getstorage());
8061
+
8062
+ Map<String, String> localVarHeaderParams = new HashMap<String, String>();
8063
+
8064
+ Map<String, Object> localVarFormParams = new LinkedHashMap<String, Object>();
8065
+
8066
+ final String[] localVarAccepts = {
8067
+ "application/json"
8068
+ };
8069
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
8070
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
8071
+
8072
+ final String[] localVarContentTypes = {
8073
+ "application/json"
8074
+ };
8075
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
8076
+ localVarHeaderParams.put("Content-Type", localVarContentType);
8077
+
8078
+ if (progressListener != null) {
8079
+ apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
8080
+ @Override
8081
+ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
8082
+ com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
8083
+ return originalResponse.newBuilder()
8084
+ .body(new ProgressResponseBody(originalResponse.body(), progressListener))
8085
+ .build();
8086
+ }
8087
+ });
8088
+ }
8089
+
8090
+ String[] localVarAuthNames = new String[] { "JWT" };
8091
+ return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
8092
+ }
8093
+
8094
+ @SuppressWarnings("rawtypes")
8095
+ private com.squareup.okhttp.Call clearLevelingValidateBeforeCall(ClearLevelingRequest request, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
8096
+
8097
+ // verify the required parameter 'name' is set
8098
+ if (request.getname() == null) {
8099
+ throw new ApiException(BadRequest, "Missing the required parameter 'name' when calling clearLeveling");
8100
+ }
8101
+
8102
+
8103
+ com.squareup.okhttp.Call call = clearLevelingCall(request, progressListener, progressRequestListener);
8104
+ return call;
8105
+
8106
+ }
8107
+
8108
+ /**
8109
+ * Clears leveling delays that was previously added to the project during resource leveling. If request body is empty, all leveling delays will be cleared.
8110
+ *
8111
+ * request ClearLeveling request with main agrs
8112
+ * @return AsposeResponse
8113
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
8114
+ */
8115
+ public AsposeResponse clearLeveling(ClearLevelingRequest request) throws ApiException {
8116
+ try {
8117
+ ApiResponse<AsposeResponse> resp = clearLevelingWithHttpInfo(request);
8118
+ return resp.getData();
8119
+ }
8120
+ catch (ApiException ex) {
8121
+ if (ex.getCode() == NotAuth) {
8122
+ apiClient.requestToken();
8123
+ ApiResponse<AsposeResponse> resp = clearLevelingWithHttpInfo(request);
8124
+ return resp.getData();
8125
+ }
8126
+ throw ex;
8127
+ }
8128
+ }
8129
+
8130
+ /**
8131
+ * Clears leveling delays that was previously added to the project during resource leveling. If request body is empty, all leveling delays will be cleared.
8132
+ *
8133
+ * @param request ClearLeveling request with main agrs
8134
+ * @return ApiResponse<AsposeResponse>
8135
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
8136
+ */
8137
+ private ApiResponse<AsposeResponse> clearLevelingWithHttpInfo(ClearLevelingRequest request) throws ApiException {
8138
+ com.squareup.okhttp.Call call = clearLevelingValidateBeforeCall(request, null, null);
8139
+ Type localVarReturnType = new TypeToken<AsposeResponse>() { }.getType();
8140
+ return apiClient.execute(call, localVarReturnType);
8141
+ }
8142
+
8143
+ /**
8144
+ * Clears leveling delays that was previously added to the project during resource leveling. If request body is empty, all leveling delays will be cleared. (asynchronously)
8145
+ *
8146
+ * @param request ClearLeveling request with main agrs
8147
+ * @param callback The callback to be executed when the API call finishes
8148
+ * @return The request call
8149
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
8150
+ */
8151
+ public com.squareup.okhttp.Call clearLevelingAsync(ClearLevelingRequest request, final ApiCallback<AsposeResponse> callback) throws ApiException {
8152
+
8153
+ ProgressResponseBody.ProgressListener progressListener = null;
8154
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
8155
+
8156
+ if (callback != null) {
8157
+ progressListener = new ProgressResponseBody.ProgressListener() {
8158
+ @Override
8159
+ public void update(long bytesRead, long contentLength, boolean done) {
8160
+ callback.onDownloadProgress(bytesRead, contentLength, done);
8161
+ }
8162
+ };
8163
+
8164
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
8165
+ @Override
8166
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
8167
+ callback.onUploadProgress(bytesWritten, contentLength, done);
8168
+ }
8169
+ };
8170
+ }
8171
+
8172
+ com.squareup.okhttp.Call call = clearLevelingValidateBeforeCall(request, progressListener, progressRequestListener);
8173
+ Type localVarReturnType = new TypeToken<AsposeResponse>() { }.getType();
8174
+ apiClient.executeAsync(call, localVarReturnType, callback);
8175
+ return call;
8176
+ }
8177
+ /**
8178
+ * Build call for levelTasks
8179
+ * @param request LevelTasks request with main agrs
8180
+ * @param progressListener Progress listener
8181
+ * @param progressRequestListener Progress request listener
8182
+ * @return Call to execute
8183
+ * @throws ApiException If fail to serialize the request body object
8184
+ */
8185
+ private com.squareup.okhttp.Call levelTasksCall(LevelTasksRequest request, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
8186
+ Object localVarPostBody = request.getoptions();
8187
+
8188
+ // create path and map variables
8189
+ String localVarPath = "/tasks/{name}/resourceLevel"
8190
+ .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(request.getname().toString()));
8191
+
8192
+ List<Pair> localVarQueryParams = new ArrayList<Pair>();
8193
+ List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
8194
+ localVarPath = addParameterToQuery(localVarQueryParams, localVarPath, "fileName", request.getfileName());
8195
+ localVarPath = addParameterToQuery(localVarQueryParams, localVarPath, "folder", request.getfolder());
8196
+ localVarPath = addParameterToQuery(localVarQueryParams, localVarPath, "storage", request.getstorage());
8197
+
8198
+ Map<String, String> localVarHeaderParams = new HashMap<String, String>();
8199
+
8200
+ Map<String, Object> localVarFormParams = new LinkedHashMap<String, Object>();
8201
+
8202
+ final String[] localVarAccepts = {
8203
+ "application/json"
8204
+ };
8205
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
8206
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
8207
+
8208
+ final String[] localVarContentTypes = {
8209
+ "application/json"
8210
+ };
8211
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
8212
+ localVarHeaderParams.put("Content-Type", localVarContentType);
8213
+
8214
+ if (progressListener != null) {
8215
+ apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
8216
+ @Override
8217
+ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
8218
+ com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
8219
+ return originalResponse.newBuilder()
8220
+ .body(new ProgressResponseBody(originalResponse.body(), progressListener))
8221
+ .build();
8222
+ }
8223
+ });
8224
+ }
8225
+
8226
+ String[] localVarAuthNames = new String[] { "JWT" };
8227
+ return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
8228
+ }
8229
+
8230
+ @SuppressWarnings("rawtypes")
8231
+ private com.squareup.okhttp.Call levelTasksValidateBeforeCall(LevelTasksRequest request, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
8232
+
8233
+ // verify the required parameter 'name' is set
8234
+ if (request.getname() == null) {
8235
+ throw new ApiException(BadRequest, "Missing the required parameter 'name' when calling levelTasks");
8236
+ }
8237
+
8238
+
8239
+ com.squareup.okhttp.Call call = levelTasksCall(request, progressListener, progressRequestListener);
8240
+ return call;
8241
+
8242
+ }
8243
+
8244
+ /**
8245
+ * Levels tasks for project’s resources. If request body is empty, all project's resources with default leveling options will be leveled.
8246
+ *
8247
+ * request LevelTasks request with main agrs
8248
+ * @return LevelingResponse
8249
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
8250
+ */
8251
+ public LevelingResponse levelTasks(LevelTasksRequest request) throws ApiException {
8252
+ try {
8253
+ ApiResponse<LevelingResponse> resp = levelTasksWithHttpInfo(request);
8254
+ return resp.getData();
8255
+ }
8256
+ catch (ApiException ex) {
8257
+ if (ex.getCode() == NotAuth) {
8258
+ apiClient.requestToken();
8259
+ ApiResponse<LevelingResponse> resp = levelTasksWithHttpInfo(request);
8260
+ return resp.getData();
8261
+ }
8262
+ throw ex;
8263
+ }
8264
+ }
8265
+
8266
+ /**
8267
+ * Levels tasks for project’s resources. If request body is empty, all project's resources with default leveling options will be leveled.
8268
+ *
8269
+ * @param request LevelTasks request with main agrs
8270
+ * @return ApiResponse<LevelingResponse>
8271
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
8272
+ */
8273
+ private ApiResponse<LevelingResponse> levelTasksWithHttpInfo(LevelTasksRequest request) throws ApiException {
8274
+ com.squareup.okhttp.Call call = levelTasksValidateBeforeCall(request, null, null);
8275
+ Type localVarReturnType = new TypeToken<LevelingResponse>() { }.getType();
8276
+ return apiClient.execute(call, localVarReturnType);
8277
+ }
8278
+
8279
+ /**
8280
+ * Levels tasks for project’s resources. If request body is empty, all project's resources with default leveling options will be leveled. (asynchronously)
8281
+ *
8282
+ * @param request LevelTasks request with main agrs
8283
+ * @param callback The callback to be executed when the API call finishes
8284
+ * @return The request call
8285
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
8286
+ */
8287
+ public com.squareup.okhttp.Call levelTasksAsync(LevelTasksRequest request, final ApiCallback<LevelingResponse> callback) throws ApiException {
8288
+
8289
+ ProgressResponseBody.ProgressListener progressListener = null;
8290
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
8291
+
8292
+ if (callback != null) {
8293
+ progressListener = new ProgressResponseBody.ProgressListener() {
8294
+ @Override
8295
+ public void update(long bytesRead, long contentLength, boolean done) {
8296
+ callback.onDownloadProgress(bytesRead, contentLength, done);
8297
+ }
8298
+ };
8299
+
8300
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
8301
+ @Override
8302
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
8303
+ callback.onUploadProgress(bytesWritten, contentLength, done);
8304
+ }
8305
+ };
8306
+ }
8307
+
8308
+ com.squareup.okhttp.Call call = levelTasksValidateBeforeCall(request, progressListener, progressRequestListener);
8309
+ Type localVarReturnType = new TypeToken<LevelingResponse>() { }.getType();
8310
+ apiClient.executeAsync(call, localVarReturnType, callback);
8311
+ return call;
8312
+ }
8041
8313
/**
8042
8314
* Build call for deleteResource
8043
8315
* @param request DeleteResource request with main agrs
0 commit comments