Skip to content

Commit 4bca206

Browse files
author
BitsAdmin
committed
Merge branch 'kafka-Java-2022-05-01-online-1146-2025_05_08_14_56_31' into 'integration_2025-05-15_905315453698'
feat: [development task] Kafka-1146-Java (1224791) See merge request iaasng/volcengine-java-sdk!486
2 parents 23bf87d + cefa3d0 commit 4bca206

File tree

8 files changed

+582
-12
lines changed

8 files changed

+582
-12
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,16 @@
7575
```xml
7676

7777
<dependencies>
78-
<dependency>
79-
<groupId>com.volcengine</groupId>
80-
<artifactId>volcengine-java-sdk-vpc</artifactId>
81-
<version>0.2.9</version>
82-
</dependency>
83-
<dependency>
84-
<groupId>com.volcengine</groupId>
85-
<artifactId>volcengine-java-sdk-ecs</artifactId>
86-
<version>0.2.9</version>
87-
</dependency>
78+
<dependency>
79+
<groupId>com.volcengine</groupId>
80+
<artifactId>volcengine-java-sdk-vpc</artifactId>
81+
<version>0.2.9</version>
82+
</dependency>
83+
<dependency>
84+
<groupId>com.volcengine</groupId>
85+
<artifactId>volcengine-java-sdk-ecs</artifactId>
86+
<version>0.2.9</version>
87+
</dependency>
8888
</dependencies>
8989
```
9090

volcengine-java-sdk-kafka/src/main/java/com/volcengine/kafka/KafkaApi.java

Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
import com.volcengine.kafka.model.DeleteGroupResponse;
5656
import com.volcengine.kafka.model.DeleteInstanceRequest;
5757
import com.volcengine.kafka.model.DeleteInstanceResponse;
58+
import com.volcengine.kafka.model.DeletePrivateDomainFromPublicRequest;
59+
import com.volcengine.kafka.model.DeletePrivateDomainFromPublicResponse;
5860
import com.volcengine.kafka.model.DeletePublicAddressRequest;
5961
import com.volcengine.kafka.model.DeletePublicAddressResponse;
6062
import com.volcengine.kafka.model.DeleteTopicRequest;
@@ -117,6 +119,8 @@
117119
import com.volcengine.kafka.model.ModifyUserAuthorityResponse;
118120
import com.volcengine.kafka.model.ModifyUserPasswordRequest;
119121
import com.volcengine.kafka.model.ModifyUserPasswordResponse;
122+
import com.volcengine.kafka.model.PublishPrivateDomainToPublicRequest;
123+
import com.volcengine.kafka.model.PublishPrivateDomainToPublicResponse;
120124
import com.volcengine.kafka.model.QueryMessageByOffsetsRequest;
121125
import com.volcengine.kafka.model.QueryMessageByOffsetsResponse;
122126
import com.volcengine.kafka.model.QueryMessageByTimestampRequest;
@@ -1891,6 +1895,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
18911895
apiClient.executeAsync(call, localVarReturnType, callback);
18921896
return call;
18931897
}
1898+
/**
1899+
* Build call for deletePrivateDomainFromPublic
1900+
* @param body (required)
1901+
* @param progressListener Progress listener
1902+
* @param progressRequestListener Progress request listener
1903+
* @return Call to execute
1904+
* @throws ApiException If fail to serialize the request body object
1905+
*/
1906+
public com.squareup.okhttp.Call deletePrivateDomainFromPublicCall(DeletePrivateDomainFromPublicRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
1907+
Object localVarPostBody = body;
1908+
1909+
// create path and map variables
1910+
String localVarPath = "/DeletePrivateDomainFromPublic/2022-05-01/kafka/post/application_json/";
1911+
1912+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
1913+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
1914+
1915+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
1916+
1917+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
1918+
1919+
final String[] localVarAccepts = {
1920+
"application/json"
1921+
};
1922+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
1923+
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
1924+
1925+
final String[] localVarContentTypes = {
1926+
"text/plain"
1927+
};
1928+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
1929+
localVarHeaderParams.put("Content-Type", localVarContentType);
1930+
1931+
if(progressListener != null) {
1932+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
1933+
@Override
1934+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
1935+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
1936+
return originalResponse.newBuilder()
1937+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
1938+
.build();
1939+
}
1940+
});
1941+
}
1942+
1943+
String[] localVarAuthNames = new String[] { "volcengineSign" };
1944+
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
1945+
}
1946+
1947+
@SuppressWarnings("rawtypes")
1948+
private com.squareup.okhttp.Call deletePrivateDomainFromPublicValidateBeforeCall(DeletePrivateDomainFromPublicRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
1949+
// verify the required parameter 'body' is set
1950+
if (body == null) {
1951+
throw new ApiException("Missing the required parameter 'body' when calling deletePrivateDomainFromPublic(Async)");
1952+
}
1953+
1954+
com.squareup.okhttp.Call call = deletePrivateDomainFromPublicCall(body, progressListener, progressRequestListener);
1955+
return call;
1956+
1957+
1958+
1959+
1960+
1961+
}
1962+
1963+
/**
1964+
*
1965+
*
1966+
* @param body (required)
1967+
* @return DeletePrivateDomainFromPublicResponse
1968+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
1969+
*/
1970+
public DeletePrivateDomainFromPublicResponse deletePrivateDomainFromPublic(DeletePrivateDomainFromPublicRequest body) throws ApiException {
1971+
ApiResponse<DeletePrivateDomainFromPublicResponse> resp = deletePrivateDomainFromPublicWithHttpInfo(body);
1972+
return resp.getData();
1973+
}
1974+
1975+
/**
1976+
*
1977+
*
1978+
* @param body (required)
1979+
* @return ApiResponse&lt;DeletePrivateDomainFromPublicResponse&gt;
1980+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
1981+
*/
1982+
public ApiResponse<DeletePrivateDomainFromPublicResponse> deletePrivateDomainFromPublicWithHttpInfo( @NotNull DeletePrivateDomainFromPublicRequest body) throws ApiException {
1983+
com.squareup.okhttp.Call call = deletePrivateDomainFromPublicValidateBeforeCall(body, null, null);
1984+
Type localVarReturnType = new TypeToken<DeletePrivateDomainFromPublicResponse>(){}.getType();
1985+
return apiClient.execute(call, localVarReturnType);
1986+
}
1987+
1988+
/**
1989+
* (asynchronously)
1990+
*
1991+
* @param body (required)
1992+
* @param callback The callback to be executed when the API call finishes
1993+
* @return The request call
1994+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
1995+
*/
1996+
public com.squareup.okhttp.Call deletePrivateDomainFromPublicAsync(DeletePrivateDomainFromPublicRequest body, final ApiCallback<DeletePrivateDomainFromPublicResponse> callback) throws ApiException {
1997+
1998+
ProgressResponseBody.ProgressListener progressListener = null;
1999+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
2000+
2001+
if (callback != null) {
2002+
progressListener = new ProgressResponseBody.ProgressListener() {
2003+
@Override
2004+
public void update(long bytesRead, long contentLength, boolean done) {
2005+
callback.onDownloadProgress(bytesRead, contentLength, done);
2006+
}
2007+
};
2008+
2009+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
2010+
@Override
2011+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
2012+
callback.onUploadProgress(bytesWritten, contentLength, done);
2013+
}
2014+
};
2015+
}
2016+
2017+
com.squareup.okhttp.Call call = deletePrivateDomainFromPublicValidateBeforeCall(body, progressListener, progressRequestListener);
2018+
Type localVarReturnType = new TypeToken<DeletePrivateDomainFromPublicResponse>(){}.getType();
2019+
apiClient.executeAsync(call, localVarReturnType, callback);
2020+
return call;
2021+
}
18942022
/**
18952023
* Build call for deletePublicAddress
18962024
* @param body (required)
@@ -5735,6 +5863,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
57355863
apiClient.executeAsync(call, localVarReturnType, callback);
57365864
return call;
57375865
}
5866+
/**
5867+
* Build call for publishPrivateDomainToPublic
5868+
* @param body (required)
5869+
* @param progressListener Progress listener
5870+
* @param progressRequestListener Progress request listener
5871+
* @return Call to execute
5872+
* @throws ApiException If fail to serialize the request body object
5873+
*/
5874+
public com.squareup.okhttp.Call publishPrivateDomainToPublicCall(PublishPrivateDomainToPublicRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
5875+
Object localVarPostBody = body;
5876+
5877+
// create path and map variables
5878+
String localVarPath = "/PublishPrivateDomainToPublic/2022-05-01/kafka/post/application_json/";
5879+
5880+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
5881+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
5882+
5883+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
5884+
5885+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
5886+
5887+
final String[] localVarAccepts = {
5888+
"application/json"
5889+
};
5890+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
5891+
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
5892+
5893+
final String[] localVarContentTypes = {
5894+
"text/plain"
5895+
};
5896+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
5897+
localVarHeaderParams.put("Content-Type", localVarContentType);
5898+
5899+
if(progressListener != null) {
5900+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
5901+
@Override
5902+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
5903+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
5904+
return originalResponse.newBuilder()
5905+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
5906+
.build();
5907+
}
5908+
});
5909+
}
5910+
5911+
String[] localVarAuthNames = new String[] { "volcengineSign" };
5912+
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
5913+
}
5914+
5915+
@SuppressWarnings("rawtypes")
5916+
private com.squareup.okhttp.Call publishPrivateDomainToPublicValidateBeforeCall(PublishPrivateDomainToPublicRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
5917+
// verify the required parameter 'body' is set
5918+
if (body == null) {
5919+
throw new ApiException("Missing the required parameter 'body' when calling publishPrivateDomainToPublic(Async)");
5920+
}
5921+
5922+
com.squareup.okhttp.Call call = publishPrivateDomainToPublicCall(body, progressListener, progressRequestListener);
5923+
return call;
5924+
5925+
5926+
5927+
5928+
5929+
}
5930+
5931+
/**
5932+
*
5933+
*
5934+
* @param body (required)
5935+
* @return PublishPrivateDomainToPublicResponse
5936+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
5937+
*/
5938+
public PublishPrivateDomainToPublicResponse publishPrivateDomainToPublic(PublishPrivateDomainToPublicRequest body) throws ApiException {
5939+
ApiResponse<PublishPrivateDomainToPublicResponse> resp = publishPrivateDomainToPublicWithHttpInfo(body);
5940+
return resp.getData();
5941+
}
5942+
5943+
/**
5944+
*
5945+
*
5946+
* @param body (required)
5947+
* @return ApiResponse&lt;PublishPrivateDomainToPublicResponse&gt;
5948+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
5949+
*/
5950+
public ApiResponse<PublishPrivateDomainToPublicResponse> publishPrivateDomainToPublicWithHttpInfo( @NotNull PublishPrivateDomainToPublicRequest body) throws ApiException {
5951+
com.squareup.okhttp.Call call = publishPrivateDomainToPublicValidateBeforeCall(body, null, null);
5952+
Type localVarReturnType = new TypeToken<PublishPrivateDomainToPublicResponse>(){}.getType();
5953+
return apiClient.execute(call, localVarReturnType);
5954+
}
5955+
5956+
/**
5957+
* (asynchronously)
5958+
*
5959+
* @param body (required)
5960+
* @param callback The callback to be executed when the API call finishes
5961+
* @return The request call
5962+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
5963+
*/
5964+
public com.squareup.okhttp.Call publishPrivateDomainToPublicAsync(PublishPrivateDomainToPublicRequest body, final ApiCallback<PublishPrivateDomainToPublicResponse> callback) throws ApiException {
5965+
5966+
ProgressResponseBody.ProgressListener progressListener = null;
5967+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
5968+
5969+
if (callback != null) {
5970+
progressListener = new ProgressResponseBody.ProgressListener() {
5971+
@Override
5972+
public void update(long bytesRead, long contentLength, boolean done) {
5973+
callback.onDownloadProgress(bytesRead, contentLength, done);
5974+
}
5975+
};
5976+
5977+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
5978+
@Override
5979+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
5980+
callback.onUploadProgress(bytesWritten, contentLength, done);
5981+
}
5982+
};
5983+
}
5984+
5985+
com.squareup.okhttp.Call call = publishPrivateDomainToPublicValidateBeforeCall(body, progressListener, progressRequestListener);
5986+
Type localVarReturnType = new TypeToken<PublishPrivateDomainToPublicResponse>(){}.getType();
5987+
apiClient.executeAsync(call, localVarReturnType, callback);
5988+
return call;
5989+
}
57385990
/**
57395991
* Build call for queryMessageByOffsets
57405992
* @param body (required)

0 commit comments

Comments
 (0)