Skip to content

Commit 96e1a9c

Browse files
author
BitsAdmin
committed
Merge branch 'kms-Java-2021-02-18-online-771-2024_11_14_11_36_34' into 'integration_2024-11-14_582008940034'
feat: [development task] kms-771-Java (852005) See merge request iaasng/volcengine-java-sdk!289
2 parents 12c4dae + 2943308 commit 96e1a9c

File tree

6 files changed

+818
-4
lines changed

6 files changed

+818
-4
lines changed

volcengine-java-sdk-kms/src/main/java/com/volcengine/kms/KmsApi.java

Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@
8585
import com.volcengine.kms.model.EncryptResponse;
8686
import com.volcengine.kms.model.GenerateDataKeyRequest;
8787
import com.volcengine.kms.model.GenerateDataKeyResponse;
88+
import com.volcengine.kms.model.GenerateMacRequest;
89+
import com.volcengine.kms.model.GenerateMacResponse;
8890
import com.volcengine.kms.model.GetParametersForImportRequest;
8991
import com.volcengine.kms.model.GetParametersForImportResponse;
9092
import com.volcengine.kms.model.GetPublicKeyRequest;
@@ -115,6 +117,8 @@
115117
import com.volcengine.kms.model.UpdateSecretResponse;
116118
import com.volcengine.kms.model.UpdateSecretRotationPolicyRequest;
117119
import com.volcengine.kms.model.UpdateSecretRotationPolicyResponse;
120+
import com.volcengine.kms.model.VerifyMacRequest;
121+
import com.volcengine.kms.model.VerifyMacResponse;
118122

119123
import java.lang.reflect.Type;
120124
import java.util.ArrayList;
@@ -3737,6 +3741,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
37373741
apiClient.executeAsync(call, localVarReturnType, callback);
37383742
return call;
37393743
}
3744+
/**
3745+
* Build call for generateMac
3746+
* @param body (required)
3747+
* @param progressListener Progress listener
3748+
* @param progressRequestListener Progress request listener
3749+
* @return Call to execute
3750+
* @throws ApiException If fail to serialize the request body object
3751+
*/
3752+
public com.squareup.okhttp.Call generateMacCall(GenerateMacRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
3753+
Object localVarPostBody = body;
3754+
3755+
// create path and map variables
3756+
String localVarPath = "/GenerateMac/2021-02-18/kms/post/application_json/";
3757+
3758+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
3759+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
3760+
3761+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
3762+
3763+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
3764+
3765+
final String[] localVarAccepts = {
3766+
"application/json"
3767+
};
3768+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
3769+
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
3770+
3771+
final String[] localVarContentTypes = {
3772+
"text/plain"
3773+
};
3774+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
3775+
localVarHeaderParams.put("Content-Type", localVarContentType);
3776+
3777+
if(progressListener != null) {
3778+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
3779+
@Override
3780+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
3781+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
3782+
return originalResponse.newBuilder()
3783+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
3784+
.build();
3785+
}
3786+
});
3787+
}
3788+
3789+
String[] localVarAuthNames = new String[] { "volcengineSign" };
3790+
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
3791+
}
3792+
3793+
@SuppressWarnings("rawtypes")
3794+
private com.squareup.okhttp.Call generateMacValidateBeforeCall(GenerateMacRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
3795+
// verify the required parameter 'body' is set
3796+
if (body == null) {
3797+
throw new ApiException("Missing the required parameter 'body' when calling generateMac(Async)");
3798+
}
3799+
3800+
com.squareup.okhttp.Call call = generateMacCall(body, progressListener, progressRequestListener);
3801+
return call;
3802+
3803+
3804+
3805+
3806+
3807+
}
3808+
3809+
/**
3810+
*
3811+
*
3812+
* @param body (required)
3813+
* @return GenerateMacResponse
3814+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
3815+
*/
3816+
public GenerateMacResponse generateMac(GenerateMacRequest body) throws ApiException {
3817+
ApiResponse<GenerateMacResponse> resp = generateMacWithHttpInfo(body);
3818+
return resp.getData();
3819+
}
3820+
3821+
/**
3822+
*
3823+
*
3824+
* @param body (required)
3825+
* @return ApiResponse&lt;GenerateMacResponse&gt;
3826+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
3827+
*/
3828+
public ApiResponse<GenerateMacResponse> generateMacWithHttpInfo( @NotNull GenerateMacRequest body) throws ApiException {
3829+
com.squareup.okhttp.Call call = generateMacValidateBeforeCall(body, null, null);
3830+
Type localVarReturnType = new TypeToken<GenerateMacResponse>(){}.getType();
3831+
return apiClient.execute(call, localVarReturnType);
3832+
}
3833+
3834+
/**
3835+
* (asynchronously)
3836+
*
3837+
* @param body (required)
3838+
* @param callback The callback to be executed when the API call finishes
3839+
* @return The request call
3840+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
3841+
*/
3842+
public com.squareup.okhttp.Call generateMacAsync(GenerateMacRequest body, final ApiCallback<GenerateMacResponse> callback) throws ApiException {
3843+
3844+
ProgressResponseBody.ProgressListener progressListener = null;
3845+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
3846+
3847+
if (callback != null) {
3848+
progressListener = new ProgressResponseBody.ProgressListener() {
3849+
@Override
3850+
public void update(long bytesRead, long contentLength, boolean done) {
3851+
callback.onDownloadProgress(bytesRead, contentLength, done);
3852+
}
3853+
};
3854+
3855+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
3856+
@Override
3857+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
3858+
callback.onUploadProgress(bytesWritten, contentLength, done);
3859+
}
3860+
};
3861+
}
3862+
3863+
com.squareup.okhttp.Call call = generateMacValidateBeforeCall(body, progressListener, progressRequestListener);
3864+
Type localVarReturnType = new TypeToken<GenerateMacResponse>(){}.getType();
3865+
apiClient.executeAsync(call, localVarReturnType, callback);
3866+
return call;
3867+
}
37403868
/**
37413869
* Build call for getParametersForImport
37423870
* @param body (required)
@@ -5597,4 +5725,128 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
55975725
apiClient.executeAsync(call, localVarReturnType, callback);
55985726
return call;
55995727
}
5728+
/**
5729+
* Build call for verifyMac
5730+
* @param body (required)
5731+
* @param progressListener Progress listener
5732+
* @param progressRequestListener Progress request listener
5733+
* @return Call to execute
5734+
* @throws ApiException If fail to serialize the request body object
5735+
*/
5736+
public com.squareup.okhttp.Call verifyMacCall(VerifyMacRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
5737+
Object localVarPostBody = body;
5738+
5739+
// create path and map variables
5740+
String localVarPath = "/VerifyMac/2021-02-18/kms/post/application_json/";
5741+
5742+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
5743+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
5744+
5745+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
5746+
5747+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
5748+
5749+
final String[] localVarAccepts = {
5750+
"application/json"
5751+
};
5752+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
5753+
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
5754+
5755+
final String[] localVarContentTypes = {
5756+
"text/plain"
5757+
};
5758+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
5759+
localVarHeaderParams.put("Content-Type", localVarContentType);
5760+
5761+
if(progressListener != null) {
5762+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
5763+
@Override
5764+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
5765+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
5766+
return originalResponse.newBuilder()
5767+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
5768+
.build();
5769+
}
5770+
});
5771+
}
5772+
5773+
String[] localVarAuthNames = new String[] { "volcengineSign" };
5774+
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
5775+
}
5776+
5777+
@SuppressWarnings("rawtypes")
5778+
private com.squareup.okhttp.Call verifyMacValidateBeforeCall(VerifyMacRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
5779+
// verify the required parameter 'body' is set
5780+
if (body == null) {
5781+
throw new ApiException("Missing the required parameter 'body' when calling verifyMac(Async)");
5782+
}
5783+
5784+
com.squareup.okhttp.Call call = verifyMacCall(body, progressListener, progressRequestListener);
5785+
return call;
5786+
5787+
5788+
5789+
5790+
5791+
}
5792+
5793+
/**
5794+
*
5795+
*
5796+
* @param body (required)
5797+
* @return VerifyMacResponse
5798+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
5799+
*/
5800+
public VerifyMacResponse verifyMac(VerifyMacRequest body) throws ApiException {
5801+
ApiResponse<VerifyMacResponse> resp = verifyMacWithHttpInfo(body);
5802+
return resp.getData();
5803+
}
5804+
5805+
/**
5806+
*
5807+
*
5808+
* @param body (required)
5809+
* @return ApiResponse&lt;VerifyMacResponse&gt;
5810+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
5811+
*/
5812+
public ApiResponse<VerifyMacResponse> verifyMacWithHttpInfo( @NotNull VerifyMacRequest body) throws ApiException {
5813+
com.squareup.okhttp.Call call = verifyMacValidateBeforeCall(body, null, null);
5814+
Type localVarReturnType = new TypeToken<VerifyMacResponse>(){}.getType();
5815+
return apiClient.execute(call, localVarReturnType);
5816+
}
5817+
5818+
/**
5819+
* (asynchronously)
5820+
*
5821+
* @param body (required)
5822+
* @param callback The callback to be executed when the API call finishes
5823+
* @return The request call
5824+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
5825+
*/
5826+
public com.squareup.okhttp.Call verifyMacAsync(VerifyMacRequest body, final ApiCallback<VerifyMacResponse> callback) throws ApiException {
5827+
5828+
ProgressResponseBody.ProgressListener progressListener = null;
5829+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
5830+
5831+
if (callback != null) {
5832+
progressListener = new ProgressResponseBody.ProgressListener() {
5833+
@Override
5834+
public void update(long bytesRead, long contentLength, boolean done) {
5835+
callback.onDownloadProgress(bytesRead, contentLength, done);
5836+
}
5837+
};
5838+
5839+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
5840+
@Override
5841+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
5842+
callback.onUploadProgress(bytesWritten, contentLength, done);
5843+
}
5844+
};
5845+
}
5846+
5847+
com.squareup.okhttp.Call call = verifyMacValidateBeforeCall(body, progressListener, progressRequestListener);
5848+
Type localVarReturnType = new TypeToken<VerifyMacResponse>(){}.getType();
5849+
apiClient.executeAsync(call, localVarReturnType, callback);
5850+
return call;
5851+
}
56005852
}

0 commit comments

Comments
 (0)