|
51 | 51 | import com.volcengine.vedbm.model.DeleteDatabaseResponse; |
52 | 52 | import com.volcengine.vedbm.model.DescribeDBAccountsRequest; |
53 | 53 | import com.volcengine.vedbm.model.DescribeDBAccountsResponse; |
| 54 | +import com.volcengine.vedbm.model.DescribeDBEndpointRequest; |
| 55 | +import com.volcengine.vedbm.model.DescribeDBEndpointResponse; |
54 | 56 | import com.volcengine.vedbm.model.DescribeDBInstanceDetailRequest; |
55 | 57 | import com.volcengine.vedbm.model.DescribeDBInstanceDetailResponse; |
56 | 58 | import com.volcengine.vedbm.model.DescribeDBInstancesRequest; |
@@ -1589,6 +1591,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don |
1589 | 1591 | apiClient.executeAsync(call, localVarReturnType, callback); |
1590 | 1592 | return call; |
1591 | 1593 | } |
| 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<DescribeDBEndpointResponse> |
| 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 | + } |
1592 | 1718 | /** |
1593 | 1719 | * Build call for describeDBInstanceDetail |
1594 | 1720 | * @param body (required) |
|
0 commit comments