Skip to content

Commit 16a4472

Browse files
author
BitsAdmin
committed
Merge branch 'billing-Java-2022-01-01-online-1454-2025_08_14_11_59_00' into 'integration_2025-08-14_1031759586050'
feat: [development task] billing-1454-Java (1552589) See merge request iaasng/volcengine-java-sdk!606
2 parents dc09332 + b14c7c9 commit 16a4472

File tree

8 files changed

+2013
-0
lines changed

8 files changed

+2013
-0
lines changed

volcengine-java-sdk-billing/src/main/java/com/volcengine/billing/BillingApi.java

Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@
5757
import com.volcengine.billing.model.ListBillOverviewByProdResponse;
5858
import com.volcengine.billing.model.ListBillRequest;
5959
import com.volcengine.billing.model.ListBillResponse;
60+
import com.volcengine.billing.model.ListCouponUsageRecordsRequest;
61+
import com.volcengine.billing.model.ListCouponUsageRecordsResponse;
62+
import com.volcengine.billing.model.ListCouponsRequest;
63+
import com.volcengine.billing.model.ListCouponsResponse;
6064
import com.volcengine.billing.model.ListFinancialRelationRequest;
6165
import com.volcengine.billing.model.ListFinancialRelationResponse;
6266
import com.volcengine.billing.model.ListInvitationRequest;
@@ -1975,6 +1979,254 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
19751979
apiClient.executeAsync(call, localVarReturnType, callback);
19761980
return call;
19771981
}
1982+
/**
1983+
* Build call for listCouponUsageRecords
1984+
* @param body (required)
1985+
* @param progressListener Progress listener
1986+
* @param progressRequestListener Progress request listener
1987+
* @return Call to execute
1988+
* @throws ApiException If fail to serialize the request body object
1989+
*/
1990+
public com.squareup.okhttp.Call listCouponUsageRecordsCall(ListCouponUsageRecordsRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
1991+
Object localVarPostBody = body;
1992+
1993+
// create path and map variables
1994+
String localVarPath = "/ListCouponUsageRecords/2022-01-01/billing/post/application_json/";
1995+
1996+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
1997+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
1998+
1999+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
2000+
2001+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
2002+
2003+
final String[] localVarAccepts = {
2004+
"application/json"
2005+
};
2006+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
2007+
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
2008+
2009+
final String[] localVarContentTypes = {
2010+
"text/plain"
2011+
};
2012+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
2013+
localVarHeaderParams.put("Content-Type", localVarContentType);
2014+
2015+
if(progressListener != null) {
2016+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
2017+
@Override
2018+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
2019+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
2020+
return originalResponse.newBuilder()
2021+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
2022+
.build();
2023+
}
2024+
});
2025+
}
2026+
2027+
String[] localVarAuthNames = new String[] { "volcengineSign" };
2028+
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
2029+
}
2030+
2031+
@SuppressWarnings("rawtypes")
2032+
private com.squareup.okhttp.Call listCouponUsageRecordsValidateBeforeCall(ListCouponUsageRecordsRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
2033+
// verify the required parameter 'body' is set
2034+
if (body == null) {
2035+
throw new ApiException("Missing the required parameter 'body' when calling listCouponUsageRecords(Async)");
2036+
}
2037+
2038+
com.squareup.okhttp.Call call = listCouponUsageRecordsCall(body, progressListener, progressRequestListener);
2039+
return call;
2040+
2041+
2042+
2043+
2044+
2045+
}
2046+
2047+
/**
2048+
*
2049+
*
2050+
* @param body (required)
2051+
* @return ListCouponUsageRecordsResponse
2052+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
2053+
*/
2054+
public ListCouponUsageRecordsResponse listCouponUsageRecords(ListCouponUsageRecordsRequest body) throws ApiException {
2055+
ApiResponse<ListCouponUsageRecordsResponse> resp = listCouponUsageRecordsWithHttpInfo(body);
2056+
return resp.getData();
2057+
}
2058+
2059+
/**
2060+
*
2061+
*
2062+
* @param body (required)
2063+
* @return ApiResponse&lt;ListCouponUsageRecordsResponse&gt;
2064+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
2065+
*/
2066+
public ApiResponse<ListCouponUsageRecordsResponse> listCouponUsageRecordsWithHttpInfo( @NotNull ListCouponUsageRecordsRequest body) throws ApiException {
2067+
com.squareup.okhttp.Call call = listCouponUsageRecordsValidateBeforeCall(body, null, null);
2068+
Type localVarReturnType = new TypeToken<ListCouponUsageRecordsResponse>(){}.getType();
2069+
return apiClient.execute(call, localVarReturnType);
2070+
}
2071+
2072+
/**
2073+
* (asynchronously)
2074+
*
2075+
* @param body (required)
2076+
* @param callback The callback to be executed when the API call finishes
2077+
* @return The request call
2078+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
2079+
*/
2080+
public com.squareup.okhttp.Call listCouponUsageRecordsAsync(ListCouponUsageRecordsRequest body, final ApiCallback<ListCouponUsageRecordsResponse> callback) throws ApiException {
2081+
2082+
ProgressResponseBody.ProgressListener progressListener = null;
2083+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
2084+
2085+
if (callback != null) {
2086+
progressListener = new ProgressResponseBody.ProgressListener() {
2087+
@Override
2088+
public void update(long bytesRead, long contentLength, boolean done) {
2089+
callback.onDownloadProgress(bytesRead, contentLength, done);
2090+
}
2091+
};
2092+
2093+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
2094+
@Override
2095+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
2096+
callback.onUploadProgress(bytesWritten, contentLength, done);
2097+
}
2098+
};
2099+
}
2100+
2101+
com.squareup.okhttp.Call call = listCouponUsageRecordsValidateBeforeCall(body, progressListener, progressRequestListener);
2102+
Type localVarReturnType = new TypeToken<ListCouponUsageRecordsResponse>(){}.getType();
2103+
apiClient.executeAsync(call, localVarReturnType, callback);
2104+
return call;
2105+
}
2106+
/**
2107+
* Build call for listCoupons
2108+
* @param body (required)
2109+
* @param progressListener Progress listener
2110+
* @param progressRequestListener Progress request listener
2111+
* @return Call to execute
2112+
* @throws ApiException If fail to serialize the request body object
2113+
*/
2114+
public com.squareup.okhttp.Call listCouponsCall(ListCouponsRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
2115+
Object localVarPostBody = body;
2116+
2117+
// create path and map variables
2118+
String localVarPath = "/ListCoupons/2022-01-01/billing/post/application_json/";
2119+
2120+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
2121+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
2122+
2123+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
2124+
2125+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
2126+
2127+
final String[] localVarAccepts = {
2128+
"application/json"
2129+
};
2130+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
2131+
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
2132+
2133+
final String[] localVarContentTypes = {
2134+
"text/plain"
2135+
};
2136+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
2137+
localVarHeaderParams.put("Content-Type", localVarContentType);
2138+
2139+
if(progressListener != null) {
2140+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
2141+
@Override
2142+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
2143+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
2144+
return originalResponse.newBuilder()
2145+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
2146+
.build();
2147+
}
2148+
});
2149+
}
2150+
2151+
String[] localVarAuthNames = new String[] { "volcengineSign" };
2152+
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
2153+
}
2154+
2155+
@SuppressWarnings("rawtypes")
2156+
private com.squareup.okhttp.Call listCouponsValidateBeforeCall(ListCouponsRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
2157+
// verify the required parameter 'body' is set
2158+
if (body == null) {
2159+
throw new ApiException("Missing the required parameter 'body' when calling listCoupons(Async)");
2160+
}
2161+
2162+
com.squareup.okhttp.Call call = listCouponsCall(body, progressListener, progressRequestListener);
2163+
return call;
2164+
2165+
2166+
2167+
2168+
2169+
}
2170+
2171+
/**
2172+
*
2173+
*
2174+
* @param body (required)
2175+
* @return ListCouponsResponse
2176+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
2177+
*/
2178+
public ListCouponsResponse listCoupons(ListCouponsRequest body) throws ApiException {
2179+
ApiResponse<ListCouponsResponse> resp = listCouponsWithHttpInfo(body);
2180+
return resp.getData();
2181+
}
2182+
2183+
/**
2184+
*
2185+
*
2186+
* @param body (required)
2187+
* @return ApiResponse&lt;ListCouponsResponse&gt;
2188+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
2189+
*/
2190+
public ApiResponse<ListCouponsResponse> listCouponsWithHttpInfo( @NotNull ListCouponsRequest body) throws ApiException {
2191+
com.squareup.okhttp.Call call = listCouponsValidateBeforeCall(body, null, null);
2192+
Type localVarReturnType = new TypeToken<ListCouponsResponse>(){}.getType();
2193+
return apiClient.execute(call, localVarReturnType);
2194+
}
2195+
2196+
/**
2197+
* (asynchronously)
2198+
*
2199+
* @param body (required)
2200+
* @param callback The callback to be executed when the API call finishes
2201+
* @return The request call
2202+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
2203+
*/
2204+
public com.squareup.okhttp.Call listCouponsAsync(ListCouponsRequest body, final ApiCallback<ListCouponsResponse> callback) throws ApiException {
2205+
2206+
ProgressResponseBody.ProgressListener progressListener = null;
2207+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
2208+
2209+
if (callback != null) {
2210+
progressListener = new ProgressResponseBody.ProgressListener() {
2211+
@Override
2212+
public void update(long bytesRead, long contentLength, boolean done) {
2213+
callback.onDownloadProgress(bytesRead, contentLength, done);
2214+
}
2215+
};
2216+
2217+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
2218+
@Override
2219+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
2220+
callback.onUploadProgress(bytesWritten, contentLength, done);
2221+
}
2222+
};
2223+
}
2224+
2225+
com.squareup.okhttp.Call call = listCouponsValidateBeforeCall(body, progressListener, progressRequestListener);
2226+
Type localVarReturnType = new TypeToken<ListCouponsResponse>(){}.getType();
2227+
apiClient.executeAsync(call, localVarReturnType, callback);
2228+
return call;
2229+
}
19782230
/**
19792231
* Build call for listFinancialRelation
19802232
* @param body (required)

0 commit comments

Comments
 (0)