Skip to content

Commit

Permalink
Merge branch 'nta-Java-2024-07-30-online-670-2024_10_12_11_46_45' int…
Browse files Browse the repository at this point in the history
…o 'integration_2024-10-17_473379051010'

feat: [development task] nta-670-Java (810322)

See merge request iaasng/volcengine-java-sdk!268
  • Loading branch information
BitsAdmin committed Oct 17, 2024
2 parents ca590c8 + aa0935c commit 7e66d3e
Show file tree
Hide file tree
Showing 8 changed files with 825 additions and 0 deletions.
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -247,5 +247,6 @@
<module>volcengine-java-sdk-transitrouter</module>
<module>volcengine-java-sdk-sts</module>
<module>volcengine-java-sdk-kms</module>
<module>volcengine-java-sdk-nta</module>
</modules>
</project>
6 changes: 6 additions & 0 deletions volcengine-java-sdk-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,12 @@
<optional>false</optional>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.volcengine</groupId>
<artifactId>volcengine-java-sdk-nta</artifactId>
<optional>false</optional>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
40 changes: 40 additions & 0 deletions volcengine-java-sdk-nta/pom.xml
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 volcengine-java-sdk-nta/src/main/java/com/volcengine/nta/NtaApi.java
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&lt;CreateFileDetectionResponse&gt;
* @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&lt;GetFileDetectionResponse&gt;
* @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;
}
}
Loading

0 comments on commit 7e66d3e

Please sign in to comment.