Skip to content

Commit 3d9f328

Browse files
author
BitsAdmin
committed
Merge branch 'vedbm-Java-2022-01-01-online-597-2024_07_25_17_33_44' into 'integration_2024-07-25_331539261442'
feat: [development task] vefaas-597-Java (727954) See merge request iaasng/volcengine-java-sdk!230
2 parents 1cac077 + 56dff4e commit 3d9f328

18 files changed

+1841
-161
lines changed

volcengine-java-sdk-vedbm/src/main/java/com/volcengine/vedbm/VedbmApi.java

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
import com.volcengine.vedbm.model.DeleteDatabaseResponse;
5252
import com.volcengine.vedbm.model.DescribeDBAccountsRequest;
5353
import com.volcengine.vedbm.model.DescribeDBAccountsResponse;
54+
import com.volcengine.vedbm.model.DescribeDBEndpointRequest;
55+
import com.volcengine.vedbm.model.DescribeDBEndpointResponse;
5456
import com.volcengine.vedbm.model.DescribeDBInstanceDetailRequest;
5557
import com.volcengine.vedbm.model.DescribeDBInstanceDetailResponse;
5658
import com.volcengine.vedbm.model.DescribeDBInstancesRequest;
@@ -1589,6 +1591,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
15891591
apiClient.executeAsync(call, localVarReturnType, callback);
15901592
return call;
15911593
}
1594+
/**
1595+
* Build call for describeDBEndpoint
1596+
* @param body (required)
1597+
* @param progressListener Progress listener
1598+
* @param progressRequestListener Progress request listener
1599+
* @return Call to execute
1600+
* @throws ApiException If fail to serialize the request body object
1601+
*/
1602+
public com.squareup.okhttp.Call describeDBEndpointCall(DescribeDBEndpointRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
1603+
Object localVarPostBody = body;
1604+
1605+
// create path and map variables
1606+
String localVarPath = "/DescribeDBEndpoint/2022-01-01/vedbm/post/application_json/";
1607+
1608+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
1609+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
1610+
1611+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
1612+
1613+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
1614+
1615+
final String[] localVarAccepts = {
1616+
"application/json"
1617+
};
1618+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
1619+
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
1620+
1621+
final String[] localVarContentTypes = {
1622+
"text/plain"
1623+
};
1624+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
1625+
localVarHeaderParams.put("Content-Type", localVarContentType);
1626+
1627+
if(progressListener != null) {
1628+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
1629+
@Override
1630+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
1631+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
1632+
return originalResponse.newBuilder()
1633+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
1634+
.build();
1635+
}
1636+
});
1637+
}
1638+
1639+
String[] localVarAuthNames = new String[] { "volcengineSign" };
1640+
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
1641+
}
1642+
1643+
@SuppressWarnings("rawtypes")
1644+
private com.squareup.okhttp.Call describeDBEndpointValidateBeforeCall(DescribeDBEndpointRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
1645+
// verify the required parameter 'body' is set
1646+
if (body == null) {
1647+
throw new ApiException("Missing the required parameter 'body' when calling describeDBEndpoint(Async)");
1648+
}
1649+
1650+
com.squareup.okhttp.Call call = describeDBEndpointCall(body, progressListener, progressRequestListener);
1651+
return call;
1652+
1653+
1654+
1655+
1656+
1657+
}
1658+
1659+
/**
1660+
*
1661+
*
1662+
* @param body (required)
1663+
* @return DescribeDBEndpointResponse
1664+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
1665+
*/
1666+
public DescribeDBEndpointResponse describeDBEndpoint(DescribeDBEndpointRequest body) throws ApiException {
1667+
ApiResponse<DescribeDBEndpointResponse> resp = describeDBEndpointWithHttpInfo(body);
1668+
return resp.getData();
1669+
}
1670+
1671+
/**
1672+
*
1673+
*
1674+
* @param body (required)
1675+
* @return ApiResponse&lt;DescribeDBEndpointResponse&gt;
1676+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
1677+
*/
1678+
public ApiResponse<DescribeDBEndpointResponse> describeDBEndpointWithHttpInfo( @NotNull DescribeDBEndpointRequest body) throws ApiException {
1679+
com.squareup.okhttp.Call call = describeDBEndpointValidateBeforeCall(body, null, null);
1680+
Type localVarReturnType = new TypeToken<DescribeDBEndpointResponse>(){}.getType();
1681+
return apiClient.execute(call, localVarReturnType);
1682+
}
1683+
1684+
/**
1685+
* (asynchronously)
1686+
*
1687+
* @param body (required)
1688+
* @param callback The callback to be executed when the API call finishes
1689+
* @return The request call
1690+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
1691+
*/
1692+
public com.squareup.okhttp.Call describeDBEndpointAsync(DescribeDBEndpointRequest body, final ApiCallback<DescribeDBEndpointResponse> callback) throws ApiException {
1693+
1694+
ProgressResponseBody.ProgressListener progressListener = null;
1695+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
1696+
1697+
if (callback != null) {
1698+
progressListener = new ProgressResponseBody.ProgressListener() {
1699+
@Override
1700+
public void update(long bytesRead, long contentLength, boolean done) {
1701+
callback.onDownloadProgress(bytesRead, contentLength, done);
1702+
}
1703+
};
1704+
1705+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
1706+
@Override
1707+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
1708+
callback.onUploadProgress(bytesWritten, contentLength, done);
1709+
}
1710+
};
1711+
}
1712+
1713+
com.squareup.okhttp.Call call = describeDBEndpointValidateBeforeCall(body, progressListener, progressRequestListener);
1714+
Type localVarReturnType = new TypeToken<DescribeDBEndpointResponse>(){}.getType();
1715+
apiClient.executeAsync(call, localVarReturnType, callback);
1716+
return call;
1717+
}
15921718
/**
15931719
* Build call for describeDBInstanceDetail
15941720
* @param body (required)

0 commit comments

Comments
 (0)