AdGetV2Api.java 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  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.AdGetV2Filtering;
  21. import com.bytedance.ads.model.AdGetV2Response;
  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 AdGetV2Api {
  28. private ApiClient localVarApiClient;
  29. private int localHostIndex;
  30. private String localCustomBaseUrl;
  31. public AdGetV2Api() {
  32. this(Configuration.getDefaultApiClient());
  33. }
  34. public AdGetV2Api(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 openApi2AdGetGet
  57. * @param advertiserId (optional)
  58. * @param fields (optional)
  59. * @param filtering (optional)
  60. * @param page (optional, default to 1)
  61. * @param pageSize (optional, default to 10)
  62. * @param _callback Callback for upload/download progress
  63. * @return Call to execute
  64. * @throws ApiException If fail to serialize the request body object
  65. * @http.response.details
  66. <table summary="Response Details" border="1">
  67. <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
  68. <tr><td> 200 </td><td> OK </td><td> - </td></tr>
  69. </table>
  70. */
  71. public okhttp3.Call openApi2AdGetGetCall(Long advertiserId, List<String> fields, AdGetV2Filtering filtering, Long page, Long pageSize, final ApiCallback _callback) throws ApiException {
  72. String basePath = null;
  73. // Operation Servers
  74. String[] localBasePaths = new String[] { };
  75. // Determine Base Path to Use
  76. if (localCustomBaseUrl != null){
  77. basePath = localCustomBaseUrl;
  78. } else if ( localBasePaths.length > 0 ) {
  79. basePath = localBasePaths[localHostIndex];
  80. } else {
  81. basePath = null;
  82. }
  83. Object localVarPostBody = null;
  84. // create path and map variables
  85. String localVarPath = "/open_api/2/ad/get/";
  86. List<Pair> localVarQueryParams = new ArrayList<Pair>();
  87. List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
  88. Map<String, String> localVarHeaderParams = new HashMap<String, String>();
  89. Map<String, String> localVarCookieParams = new HashMap<String, String>();
  90. Map<String, Object> localVarFormParams = new HashMap<String, Object>();
  91. if (advertiserId != null) {
  92. localVarQueryParams.addAll(localVarApiClient.parameterToPair("advertiser_id", advertiserId));
  93. }
  94. if (fields != null) {
  95. localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "fields", fields));
  96. }
  97. if (filtering != null) {
  98. localVarQueryParams.addAll(localVarApiClient.parameterToPair("filtering", filtering));
  99. }
  100. if (page != null) {
  101. localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
  102. }
  103. if (pageSize != null) {
  104. localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize));
  105. }
  106. final String[] localVarAccepts = {
  107. "application/json"
  108. };
  109. final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
  110. if (localVarAccept != null) {
  111. localVarHeaderParams.put("Accept", localVarAccept);
  112. }
  113. final String[] localVarContentTypes = {
  114. };
  115. final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
  116. if (localVarContentType != null) {
  117. localVarHeaderParams.put("Content-Type", localVarContentType);
  118. }
  119. String[] localVarAuthNames = new String[] { "ApiKeyAuth" };
  120. return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
  121. }
  122. @SuppressWarnings("rawtypes")
  123. private okhttp3.Call openApi2AdGetGetValidateBeforeCall(Long advertiserId, List<String> fields, AdGetV2Filtering filtering, Long page, Long pageSize, final ApiCallback _callback) throws ApiException {
  124. return openApi2AdGetGetCall(advertiserId, fields, filtering, page, pageSize, _callback);
  125. }
  126. /**
  127. *
  128. *
  129. * @param advertiserId (optional)
  130. * @param fields (optional)
  131. * @param filtering (optional)
  132. * @param page (optional, default to 1)
  133. * @param pageSize (optional, default to 10)
  134. * @return AdGetV2Response
  135. * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
  136. * @http.response.details
  137. <table summary="Response Details" border="1">
  138. <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
  139. <tr><td> 200 </td><td> OK </td><td> - </td></tr>
  140. </table>
  141. */
  142. public AdGetV2Response openApi2AdGetGet(Long advertiserId, List<String> fields, AdGetV2Filtering filtering, Long page, Long pageSize) throws ApiException {
  143. ApiResponse<AdGetV2Response> localVarResp = openApi2AdGetGetWithHttpInfo(advertiserId, fields, filtering, page, pageSize);
  144. return localVarResp.getData();
  145. }
  146. /**
  147. *
  148. *
  149. * @param advertiserId (optional)
  150. * @param fields (optional)
  151. * @param filtering (optional)
  152. * @param page (optional, default to 1)
  153. * @param pageSize (optional, default to 10)
  154. * @return ApiResponse&lt;AdGetV2Response&gt;
  155. * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
  156. * @http.response.details
  157. <table summary="Response Details" border="1">
  158. <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
  159. <tr><td> 200 </td><td> OK </td><td> - </td></tr>
  160. </table>
  161. */
  162. public ApiResponse<AdGetV2Response> openApi2AdGetGetWithHttpInfo(Long advertiserId, List<String> fields, AdGetV2Filtering filtering, Long page, Long pageSize) throws ApiException {
  163. okhttp3.Call localVarCall = openApi2AdGetGetValidateBeforeCall(advertiserId, fields, filtering, page, pageSize, null);
  164. Type localVarReturnType = new TypeToken<AdGetV2Response>(){}.getType();
  165. return localVarApiClient.execute(localVarCall, localVarReturnType);
  166. }
  167. /**
  168. * (asynchronously)
  169. *
  170. * @param advertiserId (optional)
  171. * @param fields (optional)
  172. * @param filtering (optional)
  173. * @param page (optional, default to 1)
  174. * @param pageSize (optional, default to 10)
  175. * @param _callback The callback to be executed when the API call finishes
  176. * @return The request call
  177. * @throws ApiException If fail to process the API call, e.g. serializing the request body object
  178. * @http.response.details
  179. <table summary="Response Details" border="1">
  180. <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
  181. <tr><td> 200 </td><td> OK </td><td> - </td></tr>
  182. </table>
  183. */
  184. public okhttp3.Call openApi2AdGetGetAsync(Long advertiserId, List<String> fields, AdGetV2Filtering filtering, Long page, Long pageSize, final ApiCallback<AdGetV2Response> _callback) throws ApiException {
  185. okhttp3.Call localVarCall = openApi2AdGetGetValidateBeforeCall(advertiserId, fields, filtering, page, pageSize, _callback);
  186. Type localVarReturnType = new TypeToken<AdGetV2Response>(){}.getType();
  187. localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
  188. return localVarCall;
  189. }
  190. }