AdvertiserInfoV2Api.java 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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.AdvertiserInfoV2Response;
  21. import java.lang.reflect.Type;
  22. import java.util.ArrayList;
  23. import java.util.HashMap;
  24. import java.util.List;
  25. import java.util.Map;
  26. public class AdvertiserInfoV2Api {
  27. private ApiClient localVarApiClient;
  28. private int localHostIndex;
  29. private String localCustomBaseUrl;
  30. public AdvertiserInfoV2Api() {
  31. this(Configuration.getDefaultApiClient());
  32. }
  33. public AdvertiserInfoV2Api(ApiClient apiClient) {
  34. this.localVarApiClient = apiClient;
  35. }
  36. public ApiClient getApiClient() {
  37. return localVarApiClient;
  38. }
  39. public void setApiClient(ApiClient apiClient) {
  40. this.localVarApiClient = apiClient;
  41. }
  42. public int getHostIndex() {
  43. return localHostIndex;
  44. }
  45. public void setHostIndex(int hostIndex) {
  46. this.localHostIndex = hostIndex;
  47. }
  48. public String getCustomBaseUrl() {
  49. return localCustomBaseUrl;
  50. }
  51. public void setCustomBaseUrl(String customBaseUrl) {
  52. this.localCustomBaseUrl = customBaseUrl;
  53. }
  54. /**
  55. * Build call for openApi2AdvertiserInfoGet
  56. * @param advertiserIds (optional)
  57. * @param fields (optional)
  58. * @param _callback Callback for upload/download progress
  59. * @return Call to execute
  60. * @throws ApiException If fail to serialize the request body object
  61. * @http.response.details
  62. <table summary="Response Details" border="1">
  63. <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
  64. <tr><td> 200 </td><td> OK </td><td> - </td></tr>
  65. </table>
  66. */
  67. public okhttp3.Call openApi2AdvertiserInfoGetCall(List<Long> advertiserIds, List<String> fields, final ApiCallback _callback) throws ApiException {
  68. String basePath = null;
  69. // Operation Servers
  70. String[] localBasePaths = new String[] { };
  71. // Determine Base Path to Use
  72. if (localCustomBaseUrl != null){
  73. basePath = localCustomBaseUrl;
  74. } else if ( localBasePaths.length > 0 ) {
  75. basePath = localBasePaths[localHostIndex];
  76. } else {
  77. basePath = null;
  78. }
  79. Object localVarPostBody = null;
  80. // create path and map variables
  81. String localVarPath = "/open_api/2/advertiser/info/";
  82. List<Pair> localVarQueryParams = new ArrayList<Pair>();
  83. List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
  84. Map<String, String> localVarHeaderParams = new HashMap<String, String>();
  85. Map<String, String> localVarCookieParams = new HashMap<String, String>();
  86. Map<String, Object> localVarFormParams = new HashMap<String, Object>();
  87. if (advertiserIds != null) {
  88. localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "advertiser_ids", advertiserIds));
  89. }
  90. if (fields != null) {
  91. localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "fields", fields));
  92. }
  93. final String[] localVarAccepts = {
  94. "application/json"
  95. };
  96. final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
  97. if (localVarAccept != null) {
  98. localVarHeaderParams.put("Accept", localVarAccept);
  99. }
  100. final String[] localVarContentTypes = {
  101. };
  102. final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
  103. if (localVarContentType != null) {
  104. localVarHeaderParams.put("Content-Type", localVarContentType);
  105. }
  106. String[] localVarAuthNames = new String[] { "ApiKeyAuth" };
  107. return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
  108. }
  109. @SuppressWarnings("rawtypes")
  110. private okhttp3.Call openApi2AdvertiserInfoGetValidateBeforeCall(List<Long> advertiserIds, List<String> fields, final ApiCallback _callback) throws ApiException {
  111. return openApi2AdvertiserInfoGetCall(advertiserIds, fields, _callback);
  112. }
  113. /**
  114. *
  115. *
  116. * @param advertiserIds (optional)
  117. * @param fields (optional)
  118. * @return AdvertiserInfoV2Response
  119. * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
  120. * @http.response.details
  121. <table summary="Response Details" border="1">
  122. <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
  123. <tr><td> 200 </td><td> OK </td><td> - </td></tr>
  124. </table>
  125. */
  126. public AdvertiserInfoV2Response openApi2AdvertiserInfoGet(List<Long> advertiserIds, List<String> fields) throws ApiException {
  127. ApiResponse<AdvertiserInfoV2Response> localVarResp = openApi2AdvertiserInfoGetWithHttpInfo(advertiserIds, fields);
  128. return localVarResp.getData();
  129. }
  130. /**
  131. *
  132. *
  133. * @param advertiserIds (optional)
  134. * @param fields (optional)
  135. * @return ApiResponse&lt;AdvertiserInfoV2Response&gt;
  136. * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
  137. * @http.response.details
  138. <table summary="Response Details" border="1">
  139. <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
  140. <tr><td> 200 </td><td> OK </td><td> - </td></tr>
  141. </table>
  142. */
  143. public ApiResponse<AdvertiserInfoV2Response> openApi2AdvertiserInfoGetWithHttpInfo(List<Long> advertiserIds, List<String> fields) throws ApiException {
  144. okhttp3.Call localVarCall = openApi2AdvertiserInfoGetValidateBeforeCall(advertiserIds, fields, null);
  145. Type localVarReturnType = new TypeToken<AdvertiserInfoV2Response>(){}.getType();
  146. return localVarApiClient.execute(localVarCall, localVarReturnType);
  147. }
  148. /**
  149. * (asynchronously)
  150. *
  151. * @param advertiserIds (optional)
  152. * @param fields (optional)
  153. * @param _callback The callback to be executed when the API call finishes
  154. * @return The request call
  155. * @throws ApiException If fail to process the API call, e.g. serializing the request body object
  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 okhttp3.Call openApi2AdvertiserInfoGetAsync(List<Long> advertiserIds, List<String> fields, final ApiCallback<AdvertiserInfoV2Response> _callback) throws ApiException {
  163. okhttp3.Call localVarCall = openApi2AdvertiserInfoGetValidateBeforeCall(advertiserIds, fields, _callback);
  164. Type localVarReturnType = new TypeToken<AdvertiserInfoV2Response>(){}.getType();
  165. localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
  166. return localVarCall;
  167. }
  168. }