|
45 | 45 | import com.volcengine.filenas.model.CreatePreSignedUrlResponse; |
46 | 46 | import com.volcengine.filenas.model.CreateSnapshotRequest; |
47 | 47 | import com.volcengine.filenas.model.CreateSnapshotResponse; |
| 48 | +import com.volcengine.filenas.model.DeleteDataFlowRequest; |
| 49 | +import com.volcengine.filenas.model.DeleteDataFlowResponse; |
48 | 50 | import com.volcengine.filenas.model.DeleteDataFlowTaskRequest; |
49 | 51 | import com.volcengine.filenas.model.DeleteDataFlowTaskResponse; |
50 | 52 | import com.volcengine.filenas.model.DeleteFileSystemRequest; |
@@ -1243,6 +1245,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don |
1243 | 1245 | apiClient.executeAsync(call, localVarReturnType, callback); |
1244 | 1246 | return call; |
1245 | 1247 | } |
| 1248 | + /** |
| 1249 | + * Build call for deleteDataFlow |
| 1250 | + * @param body (required) |
| 1251 | + * @param progressListener Progress listener |
| 1252 | + * @param progressRequestListener Progress request listener |
| 1253 | + * @return Call to execute |
| 1254 | + * @throws ApiException If fail to serialize the request body object |
| 1255 | + */ |
| 1256 | + public com.squareup.okhttp.Call deleteDataFlowCall(DeleteDataFlowRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 1257 | + Object localVarPostBody = body; |
| 1258 | + |
| 1259 | + // create path and map variables |
| 1260 | + String localVarPath = "/DeleteDataFlow/2022-01-01/filenas/post/application_json/"; |
| 1261 | + |
| 1262 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 1263 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 1264 | + |
| 1265 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 1266 | + |
| 1267 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 1268 | + |
| 1269 | + final String[] localVarAccepts = { |
| 1270 | + "application/json" |
| 1271 | + }; |
| 1272 | + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
| 1273 | + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); |
| 1274 | + |
| 1275 | + final String[] localVarContentTypes = { |
| 1276 | + "text/plain" |
| 1277 | + }; |
| 1278 | + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
| 1279 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 1280 | + |
| 1281 | + if(progressListener != null) { |
| 1282 | + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { |
| 1283 | + @Override |
| 1284 | + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { |
| 1285 | + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); |
| 1286 | + return originalResponse.newBuilder() |
| 1287 | + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) |
| 1288 | + .build(); |
| 1289 | + } |
| 1290 | + }); |
| 1291 | + } |
| 1292 | + |
| 1293 | + String[] localVarAuthNames = new String[] { "volcengineSign" }; |
| 1294 | + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); |
| 1295 | + } |
| 1296 | + |
| 1297 | + @SuppressWarnings("rawtypes") |
| 1298 | + private com.squareup.okhttp.Call deleteDataFlowValidateBeforeCall(DeleteDataFlowRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 1299 | + // verify the required parameter 'body' is set |
| 1300 | + if (body == null) { |
| 1301 | + throw new ApiException("Missing the required parameter 'body' when calling deleteDataFlow(Async)"); |
| 1302 | + } |
| 1303 | + |
| 1304 | + com.squareup.okhttp.Call call = deleteDataFlowCall(body, progressListener, progressRequestListener); |
| 1305 | + return call; |
| 1306 | + |
| 1307 | + |
| 1308 | + |
| 1309 | + |
| 1310 | + |
| 1311 | + } |
| 1312 | + |
| 1313 | + /** |
| 1314 | + * |
| 1315 | + * |
| 1316 | + * @param body (required) |
| 1317 | + * @return DeleteDataFlowResponse |
| 1318 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 1319 | + */ |
| 1320 | + public DeleteDataFlowResponse deleteDataFlow(DeleteDataFlowRequest body) throws ApiException { |
| 1321 | + ApiResponse<DeleteDataFlowResponse> resp = deleteDataFlowWithHttpInfo(body); |
| 1322 | + return resp.getData(); |
| 1323 | + } |
| 1324 | + |
| 1325 | + /** |
| 1326 | + * |
| 1327 | + * |
| 1328 | + * @param body (required) |
| 1329 | + * @return ApiResponse<DeleteDataFlowResponse> |
| 1330 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 1331 | + */ |
| 1332 | + public ApiResponse<DeleteDataFlowResponse> deleteDataFlowWithHttpInfo( @NotNull DeleteDataFlowRequest body) throws ApiException { |
| 1333 | + com.squareup.okhttp.Call call = deleteDataFlowValidateBeforeCall(body, null, null); |
| 1334 | + Type localVarReturnType = new TypeToken<DeleteDataFlowResponse>(){}.getType(); |
| 1335 | + return apiClient.execute(call, localVarReturnType); |
| 1336 | + } |
| 1337 | + |
| 1338 | + /** |
| 1339 | + * (asynchronously) |
| 1340 | + * |
| 1341 | + * @param body (required) |
| 1342 | + * @param callback The callback to be executed when the API call finishes |
| 1343 | + * @return The request call |
| 1344 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 1345 | + */ |
| 1346 | + public com.squareup.okhttp.Call deleteDataFlowAsync(DeleteDataFlowRequest body, final ApiCallback<DeleteDataFlowResponse> callback) throws ApiException { |
| 1347 | + |
| 1348 | + ProgressResponseBody.ProgressListener progressListener = null; |
| 1349 | + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; |
| 1350 | + |
| 1351 | + if (callback != null) { |
| 1352 | + progressListener = new ProgressResponseBody.ProgressListener() { |
| 1353 | + @Override |
| 1354 | + public void update(long bytesRead, long contentLength, boolean done) { |
| 1355 | + callback.onDownloadProgress(bytesRead, contentLength, done); |
| 1356 | + } |
| 1357 | + }; |
| 1358 | + |
| 1359 | + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { |
| 1360 | + @Override |
| 1361 | + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { |
| 1362 | + callback.onUploadProgress(bytesWritten, contentLength, done); |
| 1363 | + } |
| 1364 | + }; |
| 1365 | + } |
| 1366 | + |
| 1367 | + com.squareup.okhttp.Call call = deleteDataFlowValidateBeforeCall(body, progressListener, progressRequestListener); |
| 1368 | + Type localVarReturnType = new TypeToken<DeleteDataFlowResponse>(){}.getType(); |
| 1369 | + apiClient.executeAsync(call, localVarReturnType, callback); |
| 1370 | + return call; |
| 1371 | + } |
1246 | 1372 | /** |
1247 | 1373 | * Build call for deleteDataFlowTask |
1248 | 1374 | * @param body (required) |
|
0 commit comments