-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'nta-Java-2024-07-30-online-670-2024_10_12_11_46_45' int…
…o 'integration_2024-10-17_473379051010' feat: [development task] nta-670-Java (810322) See merge request iaasng/volcengine-java-sdk!268
- Loading branch information
Showing
8 changed files
with
825 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>volcengine-java-sdk</artifactId> | ||
<groupId>com.volcengine</groupId> | ||
<version>0.1.132</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>volcengine-java-sdk-nta</artifactId> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.volcengine</groupId> | ||
<artifactId>volcengine-java-sdk-core</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-source-plugin</artifactId> | ||
<configuration> | ||
<excludes> | ||
<exclude>com/volcengine/nta/examples/**</exclude> | ||
</excludes> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<configuration> | ||
<excludes> | ||
<exclude>com/volcengine/nta/examples/**</exclude> | ||
</excludes> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
308 changes: 308 additions & 0 deletions
308
volcengine-java-sdk-nta/src/main/java/com/volcengine/nta/NtaApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,308 @@ | ||
/* | ||
* nta | ||
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) | ||
* | ||
* OpenAPI spec version: common-version | ||
* | ||
* | ||
* 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 com.volcengine.nta; | ||
|
||
import com.volcengine.ApiCallback; | ||
import com.volcengine.ApiClient; | ||
import com.volcengine.ApiException; | ||
import com.volcengine.ApiResponse; | ||
import com.volcengine.Configuration; | ||
import com.volcengine.Pair; | ||
import com.volcengine.ProgressRequestBody; | ||
import com.volcengine.ProgressResponseBody; | ||
|
||
import com.google.gson.reflect.TypeToken; | ||
|
||
import java.io.IOException; | ||
|
||
import javax.validation.constraints.*; | ||
|
||
import com.volcengine.nta.model.CreateFileDetectionRequest; | ||
import com.volcengine.nta.model.CreateFileDetectionResponse; | ||
import com.volcengine.nta.model.GetFileDetectionRequest; | ||
import com.volcengine.nta.model.GetFileDetectionResponse; | ||
|
||
import java.lang.reflect.Type; | ||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class NtaApi { | ||
private ApiClient apiClient; | ||
|
||
public NtaApi() { | ||
this(Configuration.getDefaultApiClient()); | ||
} | ||
|
||
public NtaApi(ApiClient apiClient) { | ||
this.apiClient = apiClient; | ||
} | ||
|
||
public ApiClient getApiClient() { | ||
return apiClient; | ||
} | ||
|
||
public void setApiClient(ApiClient apiClient) { | ||
this.apiClient = apiClient; | ||
} | ||
|
||
/** | ||
* Build call for createFileDetection | ||
* @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 createFileDetectionCall(CreateFileDetectionRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { | ||
Object localVarPostBody = body; | ||
|
||
// create path and map variables | ||
String localVarPath = "/CreateFileDetection/2024-07-30/nta/post/application_json/"; | ||
|
||
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 = { | ||
"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[] { "volcengineSign" }; | ||
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); | ||
} | ||
|
||
@SuppressWarnings("rawtypes") | ||
private com.squareup.okhttp.Call createFileDetectionValidateBeforeCall(CreateFileDetectionRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { | ||
// verify the required parameter 'body' is set | ||
if (body == null) { | ||
throw new ApiException("Missing the required parameter 'body' when calling createFileDetection(Async)"); | ||
} | ||
|
||
com.squareup.okhttp.Call call = createFileDetectionCall(body, progressListener, progressRequestListener); | ||
return call; | ||
|
||
|
||
|
||
|
||
|
||
} | ||
|
||
/** | ||
* | ||
* | ||
* @param body (required) | ||
* @return CreateFileDetectionResponse | ||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body | ||
*/ | ||
public CreateFileDetectionResponse createFileDetection(CreateFileDetectionRequest body) throws ApiException { | ||
ApiResponse<CreateFileDetectionResponse> resp = createFileDetectionWithHttpInfo(body); | ||
return resp.getData(); | ||
} | ||
|
||
/** | ||
* | ||
* | ||
* @param body (required) | ||
* @return ApiResponse<CreateFileDetectionResponse> | ||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body | ||
*/ | ||
public ApiResponse<CreateFileDetectionResponse> createFileDetectionWithHttpInfo( @NotNull CreateFileDetectionRequest body) throws ApiException { | ||
com.squareup.okhttp.Call call = createFileDetectionValidateBeforeCall(body, null, null); | ||
Type localVarReturnType = new TypeToken<CreateFileDetectionResponse>(){}.getType(); | ||
return apiClient.execute(call, localVarReturnType); | ||
} | ||
|
||
/** | ||
* (asynchronously) | ||
* | ||
* @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 createFileDetectionAsync(CreateFileDetectionRequest body, final ApiCallback<CreateFileDetectionResponse> 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 = createFileDetectionValidateBeforeCall(body, progressListener, progressRequestListener); | ||
Type localVarReturnType = new TypeToken<CreateFileDetectionResponse>(){}.getType(); | ||
apiClient.executeAsync(call, localVarReturnType, callback); | ||
return call; | ||
} | ||
/** | ||
* Build call for getFileDetection | ||
* @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 getFileDetectionCall(GetFileDetectionRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { | ||
Object localVarPostBody = body; | ||
|
||
// create path and map variables | ||
String localVarPath = "/GetFileDetection/2024-07-30/nta/post/application_json/"; | ||
|
||
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 = { | ||
"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[] { "volcengineSign" }; | ||
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); | ||
} | ||
|
||
@SuppressWarnings("rawtypes") | ||
private com.squareup.okhttp.Call getFileDetectionValidateBeforeCall(GetFileDetectionRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { | ||
// verify the required parameter 'body' is set | ||
if (body == null) { | ||
throw new ApiException("Missing the required parameter 'body' when calling getFileDetection(Async)"); | ||
} | ||
|
||
com.squareup.okhttp.Call call = getFileDetectionCall(body, progressListener, progressRequestListener); | ||
return call; | ||
|
||
|
||
|
||
|
||
|
||
} | ||
|
||
/** | ||
* | ||
* | ||
* @param body (required) | ||
* @return GetFileDetectionResponse | ||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body | ||
*/ | ||
public GetFileDetectionResponse getFileDetection(GetFileDetectionRequest body) throws ApiException { | ||
ApiResponse<GetFileDetectionResponse> resp = getFileDetectionWithHttpInfo(body); | ||
return resp.getData(); | ||
} | ||
|
||
/** | ||
* | ||
* | ||
* @param body (required) | ||
* @return ApiResponse<GetFileDetectionResponse> | ||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body | ||
*/ | ||
public ApiResponse<GetFileDetectionResponse> getFileDetectionWithHttpInfo( @NotNull GetFileDetectionRequest body) throws ApiException { | ||
com.squareup.okhttp.Call call = getFileDetectionValidateBeforeCall(body, null, null); | ||
Type localVarReturnType = new TypeToken<GetFileDetectionResponse>(){}.getType(); | ||
return apiClient.execute(call, localVarReturnType); | ||
} | ||
|
||
/** | ||
* (asynchronously) | ||
* | ||
* @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 getFileDetectionAsync(GetFileDetectionRequest body, final ApiCallback<GetFileDetectionResponse> 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 = getFileDetectionValidateBeforeCall(body, progressListener, progressRequestListener); | ||
Type localVarReturnType = new TypeToken<GetFileDetectionResponse>(){}.getType(); | ||
apiClient.executeAsync(call, localVarReturnType, callback); | ||
return call; | ||
} | ||
} |
Oops, something went wrong.