AdvertiserFundDailyStatV2Api.java 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. /*
  2. * Oceanengine Open Api
  3. * 巨量引擎开放平台 Open Api
  4. *
  5. * The version of the OpenAPI document: 1.1.19
  6. *
  7. *
  8. * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
  9. * https://openapi-generator.tech
  10. * Do not edit the class manually.
  11. */
  12. package com.bytedance.ads.api;
  13. import com.bytedance.ads.ApiCallback;
  14. import com.bytedance.ads.ApiClient;
  15. import com.bytedance.ads.ApiException;
  16. import com.bytedance.ads.ApiResponse;
  17. import com.bytedance.ads.Configuration;
  18. import com.bytedance.ads.Pair;
  19. import com.google.gson.reflect.TypeToken;
  20. import com.bytedance.ads.model.AdvertiserFundDailyStatV2AccountType;
  21. import com.bytedance.ads.model.AdvertiserFundDailyStatV2Response;
  22. import java.lang.reflect.Type;
  23. import java.util.ArrayList;
  24. import java.util.HashMap;
  25. import java.util.List;
  26. import java.util.Map;
  27. public class AdvertiserFundDailyStatV2Api {
  28. private ApiClient localVarApiClient;
  29. private int localHostIndex;
  30. private String localCustomBaseUrl;
  31. public AdvertiserFundDailyStatV2Api() {
  32. this(Configuration.getDefaultApiClient());
  33. }
  34. public AdvertiserFundDailyStatV2Api(ApiClient apiClient) {
  35. this.localVarApiClient = apiClient;
  36. }
  37. public ApiClient getApiClient() {
  38. return localVarApiClient;
  39. }
  40. public void setApiClient(ApiClient apiClient) {
  41. this.localVarApiClient = apiClient;
  42. }
  43. public int getHostIndex() {
  44. return localHostIndex;
  45. }
  46. public void setHostIndex(int hostIndex) {
  47. this.localHostIndex = hostIndex;
  48. }
  49. public String getCustomBaseUrl() {
  50. return localCustomBaseUrl;
  51. }
  52. public void setCustomBaseUrl(String customBaseUrl) {
  53. this.localCustomBaseUrl = customBaseUrl;
  54. }
  55. /**
  56. * Build call for openApi2AdvertiserFundDailyStatGet
  57. * @param advertiserId (required)
  58. * @param startDate (optional)
  59. * @param endDate (optional)
  60. * @param page (optional, default to 1)
  61. * @param pageSize (optional, default to 10)
  62. * @param accountType (optional)
  63. * @param _callback Callback for upload/download progress
  64. * @return Call to execute
  65. * @throws ApiException If fail to serialize the request body object
  66. * @http.response.details
  67. <table summary="Response Details" border="1">
  68. <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
  69. <tr><td> 200 </td><td> OK </td><td> - </td></tr>
  70. </table>
  71. */
  72. public okhttp3.Call openApi2AdvertiserFundDailyStatGetCall(Long advertiserId, String startDate, String endDate, Long page, Long pageSize, AdvertiserFundDailyStatV2AccountType accountType, final ApiCallback _callback) throws ApiException {
  73. String basePath = null;
  74. // Operation Servers
  75. String[] localBasePaths = new String[] { };
  76. // Determine Base Path to Use
  77. if (localCustomBaseUrl != null){
  78. basePath = localCustomBaseUrl;
  79. } else if ( localBasePaths.length > 0 ) {
  80. basePath = localBasePaths[localHostIndex];
  81. } else {
  82. basePath = null;
  83. }
  84. Object localVarPostBody = null;
  85. // create path and map variables
  86. String localVarPath = "/open_api/2/advertiser/fund/daily_stat/";
  87. List<Pair> localVarQueryParams = new ArrayList<Pair>();
  88. List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
  89. Map<String, String> localVarHeaderParams = new HashMap<String, String>();
  90. Map<String, String> localVarCookieParams = new HashMap<String, String>();
  91. Map<String, Object> localVarFormParams = new HashMap<String, Object>();
  92. if (advertiserId != null) {
  93. localVarQueryParams.addAll(localVarApiClient.parameterToPair("advertiser_id", advertiserId));
  94. }
  95. if (startDate != null) {
  96. localVarQueryParams.addAll(localVarApiClient.parameterToPair("start_date", startDate));
  97. }
  98. if (endDate != null) {
  99. localVarQueryParams.addAll(localVarApiClient.parameterToPair("end_date", endDate));
  100. }
  101. if (page != null) {
  102. localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
  103. }
  104. if (pageSize != null) {
  105. localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize));
  106. }
  107. if (accountType != null) {
  108. localVarQueryParams.addAll(localVarApiClient.parameterToPair("account_type", accountType));
  109. }
  110. final String[] localVarAccepts = {
  111. "application/json"
  112. };
  113. final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
  114. if (localVarAccept != null) {
  115. localVarHeaderParams.put("Accept", localVarAccept);
  116. }
  117. final String[] localVarContentTypes = {
  118. };
  119. final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
  120. if (localVarContentType != null) {
  121. localVarHeaderParams.put("Content-Type", localVarContentType);
  122. }
  123. String[] localVarAuthNames = new String[] { "ApiKeyAuth" };
  124. return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
  125. }
  126. @SuppressWarnings("rawtypes")
  127. private okhttp3.Call openApi2AdvertiserFundDailyStatGetValidateBeforeCall(Long advertiserId, String startDate, String endDate, Long page, Long pageSize, AdvertiserFundDailyStatV2AccountType accountType, final ApiCallback _callback) throws ApiException {
  128. // verify the required parameter 'advertiserId' is set
  129. if (advertiserId == null) {
  130. throw new ApiException("Missing the required parameter 'advertiserId' when calling openApi2AdvertiserFundDailyStatGet(Async)");
  131. }
  132. return openApi2AdvertiserFundDailyStatGetCall(advertiserId, startDate, endDate, page, pageSize, accountType, _callback);
  133. }
  134. /**
  135. *
  136. *
  137. * @param advertiserId (required)
  138. * @param startDate (optional)
  139. * @param endDate (optional)
  140. * @param page (optional, default to 1)
  141. * @param pageSize (optional, default to 10)
  142. * @param accountType (optional)
  143. * @return AdvertiserFundDailyStatV2Response
  144. * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
  145. * @http.response.details
  146. <table summary="Response Details" border="1">
  147. <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
  148. <tr><td> 200 </td><td> OK </td><td> - </td></tr>
  149. </table>
  150. */
  151. public AdvertiserFundDailyStatV2Response openApi2AdvertiserFundDailyStatGet(Long advertiserId, String startDate, String endDate, Long page, Long pageSize, AdvertiserFundDailyStatV2AccountType accountType) throws ApiException {
  152. ApiResponse<AdvertiserFundDailyStatV2Response> localVarResp = openApi2AdvertiserFundDailyStatGetWithHttpInfo(advertiserId, startDate, endDate, page, pageSize, accountType);
  153. return localVarResp.getData();
  154. }
  155. /**
  156. *
  157. *
  158. * @param advertiserId (required)
  159. * @param startDate (optional)
  160. * @param endDate (optional)
  161. * @param page (optional, default to 1)
  162. * @param pageSize (optional, default to 10)
  163. * @param accountType (optional)
  164. * @return ApiResponse&lt;AdvertiserFundDailyStatV2Response&gt;
  165. * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
  166. * @http.response.details
  167. <table summary="Response Details" border="1">
  168. <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
  169. <tr><td> 200 </td><td> OK </td><td> - </td></tr>
  170. </table>
  171. */
  172. public ApiResponse<AdvertiserFundDailyStatV2Response> openApi2AdvertiserFundDailyStatGetWithHttpInfo(Long advertiserId, String startDate, String endDate, Long page, Long pageSize, AdvertiserFundDailyStatV2AccountType accountType) throws ApiException {
  173. okhttp3.Call localVarCall = openApi2AdvertiserFundDailyStatGetValidateBeforeCall(advertiserId, startDate, endDate, page, pageSize, accountType, null);
  174. Type localVarReturnType = new TypeToken<AdvertiserFundDailyStatV2Response>(){}.getType();
  175. return localVarApiClient.execute(localVarCall, localVarReturnType);
  176. }
  177. /**
  178. * (asynchronously)
  179. *
  180. * @param advertiserId (required)
  181. * @param startDate (optional)
  182. * @param endDate (optional)
  183. * @param page (optional, default to 1)
  184. * @param pageSize (optional, default to 10)
  185. * @param accountType (optional)
  186. * @param _callback The callback to be executed when the API call finishes
  187. * @return The request call
  188. * @throws ApiException If fail to process the API call, e.g. serializing the request body object
  189. * @http.response.details
  190. <table summary="Response Details" border="1">
  191. <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
  192. <tr><td> 200 </td><td> OK </td><td> - </td></tr>
  193. </table>
  194. */
  195. public okhttp3.Call openApi2AdvertiserFundDailyStatGetAsync(Long advertiserId, String startDate, String endDate, Long page, Long pageSize, AdvertiserFundDailyStatV2AccountType accountType, final ApiCallback<AdvertiserFundDailyStatV2Response> _callback) throws ApiException {
  196. okhttp3.Call localVarCall = openApi2AdvertiserFundDailyStatGetValidateBeforeCall(advertiserId, startDate, endDate, page, pageSize, accountType, _callback);
  197. Type localVarReturnType = new TypeToken<AdvertiserFundDailyStatV2Response>(){}.getType();
  198. localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
  199. return localVarCall;
  200. }
  201. }