Skip to content

Commit f801801

Browse files
author
BitsAdmin
committed
Merge branch 'ark-Java-2024-01-01-online-987-2025_02_21_16_08_12' into 'integration_2025-02-27_769125074178'
feat: [development task] ark-987-Java (1042910) See merge request iaasng/volcengine-java-sdk!389
2 parents c8d5b74 + 85ff4ed commit f801801

File tree

3 files changed

+453
-0
lines changed

3 files changed

+453
-0
lines changed

volcengine-java-sdk-ark/src/main/java/com/volcengine/ark/ArkApi.java

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
import com.volcengine.ark.model.DeleteEndpointResponse;
3838
import com.volcengine.ark.model.GetApiKeyRequest;
3939
import com.volcengine.ark.model.GetApiKeyResponse;
40+
import com.volcengine.ark.model.GetEndpointCertificateRequest;
41+
import com.volcengine.ark.model.GetEndpointCertificateResponse;
4042
import com.volcengine.ark.model.GetEndpointRequest;
4143
import com.volcengine.ark.model.GetEndpointResponse;
4244
import com.volcengine.ark.model.GetModelCustomizationJobRequest;
@@ -817,6 +819,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
817819
apiClient.executeAsync(call, localVarReturnType, callback);
818820
return call;
819821
}
822+
/**
823+
* Build call for getEndpointCertificate
824+
* @param body (required)
825+
* @param progressListener Progress listener
826+
* @param progressRequestListener Progress request listener
827+
* @return Call to execute
828+
* @throws ApiException If fail to serialize the request body object
829+
*/
830+
public com.squareup.okhttp.Call getEndpointCertificateCall(GetEndpointCertificateRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
831+
Object localVarPostBody = body;
832+
833+
// create path and map variables
834+
String localVarPath = "/GetEndpointCertificate/2024-01-01/ark/post/application_json/";
835+
836+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
837+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
838+
839+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
840+
841+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
842+
843+
final String[] localVarAccepts = {
844+
"application/json"
845+
};
846+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
847+
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
848+
849+
final String[] localVarContentTypes = {
850+
"text/plain"
851+
};
852+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
853+
localVarHeaderParams.put("Content-Type", localVarContentType);
854+
855+
if(progressListener != null) {
856+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
857+
@Override
858+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
859+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
860+
return originalResponse.newBuilder()
861+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
862+
.build();
863+
}
864+
});
865+
}
866+
867+
String[] localVarAuthNames = new String[] { "volcengineSign" };
868+
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
869+
}
870+
871+
@SuppressWarnings("rawtypes")
872+
private com.squareup.okhttp.Call getEndpointCertificateValidateBeforeCall(GetEndpointCertificateRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
873+
// verify the required parameter 'body' is set
874+
if (body == null) {
875+
throw new ApiException("Missing the required parameter 'body' when calling getEndpointCertificate(Async)");
876+
}
877+
878+
com.squareup.okhttp.Call call = getEndpointCertificateCall(body, progressListener, progressRequestListener);
879+
return call;
880+
881+
882+
883+
884+
885+
}
886+
887+
/**
888+
*
889+
*
890+
* @param body (required)
891+
* @return GetEndpointCertificateResponse
892+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
893+
*/
894+
public GetEndpointCertificateResponse getEndpointCertificate(GetEndpointCertificateRequest body) throws ApiException {
895+
ApiResponse<GetEndpointCertificateResponse> resp = getEndpointCertificateWithHttpInfo(body);
896+
return resp.getData();
897+
}
898+
899+
/**
900+
*
901+
*
902+
* @param body (required)
903+
* @return ApiResponse&lt;GetEndpointCertificateResponse&gt;
904+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
905+
*/
906+
public ApiResponse<GetEndpointCertificateResponse> getEndpointCertificateWithHttpInfo( @NotNull GetEndpointCertificateRequest body) throws ApiException {
907+
com.squareup.okhttp.Call call = getEndpointCertificateValidateBeforeCall(body, null, null);
908+
Type localVarReturnType = new TypeToken<GetEndpointCertificateResponse>(){}.getType();
909+
return apiClient.execute(call, localVarReturnType);
910+
}
911+
912+
/**
913+
* (asynchronously)
914+
*
915+
* @param body (required)
916+
* @param callback The callback to be executed when the API call finishes
917+
* @return The request call
918+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
919+
*/
920+
public com.squareup.okhttp.Call getEndpointCertificateAsync(GetEndpointCertificateRequest body, final ApiCallback<GetEndpointCertificateResponse> callback) throws ApiException {
921+
922+
ProgressResponseBody.ProgressListener progressListener = null;
923+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
924+
925+
if (callback != null) {
926+
progressListener = new ProgressResponseBody.ProgressListener() {
927+
@Override
928+
public void update(long bytesRead, long contentLength, boolean done) {
929+
callback.onDownloadProgress(bytesRead, contentLength, done);
930+
}
931+
};
932+
933+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
934+
@Override
935+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
936+
callback.onUploadProgress(bytesWritten, contentLength, done);
937+
}
938+
};
939+
}
940+
941+
com.squareup.okhttp.Call call = getEndpointCertificateValidateBeforeCall(body, progressListener, progressRequestListener);
942+
Type localVarReturnType = new TypeToken<GetEndpointCertificateResponse>(){}.getType();
943+
apiClient.executeAsync(call, localVarReturnType, callback);
944+
return call;
945+
}
820946
/**
821947
* Build call for getModelCustomizationJob
822948
* @param body (required)
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
/*
2+
* ark
3+
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
4+
*
5+
* OpenAPI spec version: common-version
6+
*
7+
*
8+
* NOTE: This class is auto generated by the swagger code generator program.
9+
* https://github.com/swagger-api/swagger-codegen.git
10+
* Do not edit the class manually.
11+
*/
12+
13+
package com.volcengine.ark.model;
14+
15+
import java.util.Objects;
16+
import java.util.Arrays;
17+
import com.google.gson.TypeAdapter;
18+
import com.google.gson.annotations.JsonAdapter;
19+
import com.google.gson.annotations.SerializedName;
20+
import com.google.gson.stream.JsonReader;
21+
import com.google.gson.stream.JsonWriter;
22+
import io.swagger.v3.oas.annotations.media.Schema;
23+
import java.io.IOException;
24+
import javax.validation.constraints.*;
25+
import javax.validation.Valid;
26+
/**
27+
* GetEndpointCertificateRequest
28+
*/
29+
30+
31+
32+
public class GetEndpointCertificateRequest {
33+
@SerializedName("Id")
34+
private String id = null;
35+
36+
public GetEndpointCertificateRequest id(String id) {
37+
this.id = id;
38+
return this;
39+
}
40+
41+
/**
42+
* Get id
43+
* @return id
44+
**/
45+
@NotNull
46+
@Schema(required = true, description = "")
47+
public String getId() {
48+
return id;
49+
}
50+
51+
public void setId(String id) {
52+
this.id = id;
53+
}
54+
55+
56+
@Override
57+
public boolean equals(java.lang.Object o) {
58+
if (this == o) {
59+
return true;
60+
}
61+
if (o == null || getClass() != o.getClass()) {
62+
return false;
63+
}
64+
GetEndpointCertificateRequest getEndpointCertificateRequest = (GetEndpointCertificateRequest) o;
65+
return Objects.equals(this.id, getEndpointCertificateRequest.id);
66+
}
67+
68+
@Override
69+
public int hashCode() {
70+
return Objects.hash(id);
71+
}
72+
73+
74+
@Override
75+
public String toString() {
76+
StringBuilder sb = new StringBuilder();
77+
sb.append("class GetEndpointCertificateRequest {\n");
78+
79+
sb.append(" id: ").append(toIndentedString(id)).append("\n");
80+
sb.append("}");
81+
return sb.toString();
82+
}
83+
84+
/**
85+
* Convert the given object to string with each line indented by 4 spaces
86+
* (except the first line).
87+
*/
88+
private String toIndentedString(java.lang.Object o) {
89+
if (o == null) {
90+
return "null";
91+
}
92+
return o.toString().replace("\n", "\n ");
93+
}
94+
95+
}

0 commit comments

Comments
 (0)