|
51 | 51 | import com.volcengine.cdn.model.DeleteSharedConfigResponse; |
52 | 52 | import com.volcengine.cdn.model.DeleteUsageReportRequest; |
53 | 53 | import com.volcengine.cdn.model.DeleteUsageReportResponse; |
| 54 | +import com.volcengine.cdn.model.DescribeBillingDetailRequest; |
| 55 | +import com.volcengine.cdn.model.DescribeBillingDetailResponse; |
54 | 56 | import com.volcengine.cdn.model.DescribeCdnAccessLogRequest; |
55 | 57 | import com.volcengine.cdn.model.DescribeCdnAccessLogResponse; |
56 | 58 | import com.volcengine.cdn.model.DescribeCdnConfigRequest; |
@@ -1645,6 +1647,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don |
1645 | 1647 | apiClient.executeAsync(call, localVarReturnType, callback); |
1646 | 1648 | return call; |
1647 | 1649 | } |
| 1650 | + /** |
| 1651 | + * Build call for describeBillingDetail |
| 1652 | + * @param body (required) |
| 1653 | + * @param progressListener Progress listener |
| 1654 | + * @param progressRequestListener Progress request listener |
| 1655 | + * @return Call to execute |
| 1656 | + * @throws ApiException If fail to serialize the request body object |
| 1657 | + */ |
| 1658 | + public com.squareup.okhttp.Call describeBillingDetailCall(DescribeBillingDetailRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 1659 | + Object localVarPostBody = body; |
| 1660 | + |
| 1661 | + // create path and map variables |
| 1662 | + String localVarPath = "/DescribeBillingDetail/2021-03-01/cdn/post/application_json/"; |
| 1663 | + |
| 1664 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 1665 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 1666 | + |
| 1667 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 1668 | + |
| 1669 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 1670 | + |
| 1671 | + final String[] localVarAccepts = { |
| 1672 | + "application/json" |
| 1673 | + }; |
| 1674 | + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
| 1675 | + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); |
| 1676 | + |
| 1677 | + final String[] localVarContentTypes = { |
| 1678 | + "text/plain" |
| 1679 | + }; |
| 1680 | + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
| 1681 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 1682 | + |
| 1683 | + if(progressListener != null) { |
| 1684 | + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { |
| 1685 | + @Override |
| 1686 | + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { |
| 1687 | + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); |
| 1688 | + return originalResponse.newBuilder() |
| 1689 | + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) |
| 1690 | + .build(); |
| 1691 | + } |
| 1692 | + }); |
| 1693 | + } |
| 1694 | + |
| 1695 | + String[] localVarAuthNames = new String[] { "volcengineSign" }; |
| 1696 | + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); |
| 1697 | + } |
| 1698 | + |
| 1699 | + @SuppressWarnings("rawtypes") |
| 1700 | + private com.squareup.okhttp.Call describeBillingDetailValidateBeforeCall(DescribeBillingDetailRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 1701 | + // verify the required parameter 'body' is set |
| 1702 | + if (body == null) { |
| 1703 | + throw new ApiException("Missing the required parameter 'body' when calling describeBillingDetail(Async)"); |
| 1704 | + } |
| 1705 | + |
| 1706 | + com.squareup.okhttp.Call call = describeBillingDetailCall(body, progressListener, progressRequestListener); |
| 1707 | + return call; |
| 1708 | + |
| 1709 | + |
| 1710 | + |
| 1711 | + |
| 1712 | + |
| 1713 | + } |
| 1714 | + |
| 1715 | + /** |
| 1716 | + * |
| 1717 | + * |
| 1718 | + * @param body (required) |
| 1719 | + * @return DescribeBillingDetailResponse |
| 1720 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 1721 | + */ |
| 1722 | + public DescribeBillingDetailResponse describeBillingDetail(DescribeBillingDetailRequest body) throws ApiException { |
| 1723 | + ApiResponse<DescribeBillingDetailResponse> resp = describeBillingDetailWithHttpInfo(body); |
| 1724 | + return resp.getData(); |
| 1725 | + } |
| 1726 | + |
| 1727 | + /** |
| 1728 | + * |
| 1729 | + * |
| 1730 | + * @param body (required) |
| 1731 | + * @return ApiResponse<DescribeBillingDetailResponse> |
| 1732 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 1733 | + */ |
| 1734 | + public ApiResponse<DescribeBillingDetailResponse> describeBillingDetailWithHttpInfo( @NotNull DescribeBillingDetailRequest body) throws ApiException { |
| 1735 | + com.squareup.okhttp.Call call = describeBillingDetailValidateBeforeCall(body, null, null); |
| 1736 | + Type localVarReturnType = new TypeToken<DescribeBillingDetailResponse>(){}.getType(); |
| 1737 | + return apiClient.execute(call, localVarReturnType); |
| 1738 | + } |
| 1739 | + |
| 1740 | + /** |
| 1741 | + * (asynchronously) |
| 1742 | + * |
| 1743 | + * @param body (required) |
| 1744 | + * @param callback The callback to be executed when the API call finishes |
| 1745 | + * @return The request call |
| 1746 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 1747 | + */ |
| 1748 | + public com.squareup.okhttp.Call describeBillingDetailAsync(DescribeBillingDetailRequest body, final ApiCallback<DescribeBillingDetailResponse> callback) throws ApiException { |
| 1749 | + |
| 1750 | + ProgressResponseBody.ProgressListener progressListener = null; |
| 1751 | + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; |
| 1752 | + |
| 1753 | + if (callback != null) { |
| 1754 | + progressListener = new ProgressResponseBody.ProgressListener() { |
| 1755 | + @Override |
| 1756 | + public void update(long bytesRead, long contentLength, boolean done) { |
| 1757 | + callback.onDownloadProgress(bytesRead, contentLength, done); |
| 1758 | + } |
| 1759 | + }; |
| 1760 | + |
| 1761 | + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { |
| 1762 | + @Override |
| 1763 | + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { |
| 1764 | + callback.onUploadProgress(bytesWritten, contentLength, done); |
| 1765 | + } |
| 1766 | + }; |
| 1767 | + } |
| 1768 | + |
| 1769 | + com.squareup.okhttp.Call call = describeBillingDetailValidateBeforeCall(body, progressListener, progressRequestListener); |
| 1770 | + Type localVarReturnType = new TypeToken<DescribeBillingDetailResponse>(){}.getType(); |
| 1771 | + apiClient.executeAsync(call, localVarReturnType, callback); |
| 1772 | + return call; |
| 1773 | + } |
1648 | 1774 | /** |
1649 | 1775 | * Build call for describeCdnAccessLog |
1650 | 1776 | * @param body (required) |
|
0 commit comments