|
28 | 28 |
|
29 | 29 |
|
30 | 30 | import pl.wtx.woocommerce.api.client.model.ApiError;
|
| 31 | +import pl.wtx.woocommerce.api.client.model.BatchCustomers200Response; |
| 32 | +import pl.wtx.woocommerce.api.client.model.BatchCustomersRequest; |
31 | 33 | import pl.wtx.woocommerce.api.client.model.Customer;
|
32 | 34 |
|
33 | 35 | import java.lang.reflect.Type;
|
@@ -73,6 +75,128 @@ public void setCustomBaseUrl(String customBaseUrl) {
|
73 | 75 | this.localCustomBaseUrl = customBaseUrl;
|
74 | 76 | }
|
75 | 77 |
|
| 78 | + /** |
| 79 | + * Build call for batchCustomers |
| 80 | + * @param batchCustomersRequest Batch create, update, and delete customers (optional) |
| 81 | + * @param _callback Callback for upload/download progress |
| 82 | + * @return Call to execute |
| 83 | + * @throws ApiException If fail to serialize the request body object |
| 84 | + * @http.response.details |
| 85 | + <table border="1"> |
| 86 | + <caption>Response Details</caption> |
| 87 | + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| 88 | + <tr><td> 200 </td><td> Batch operation results </td><td> - </td></tr> |
| 89 | + </table> |
| 90 | + */ |
| 91 | + public okhttp3.Call batchCustomersCall(@javax.annotation.Nullable BatchCustomersRequest batchCustomersRequest, final ApiCallback _callback) throws ApiException { |
| 92 | + String basePath = null; |
| 93 | + // Operation Servers |
| 94 | + String[] localBasePaths = new String[] { }; |
| 95 | + |
| 96 | + // Determine Base Path to Use |
| 97 | + if (localCustomBaseUrl != null){ |
| 98 | + basePath = localCustomBaseUrl; |
| 99 | + } else if ( localBasePaths.length > 0 ) { |
| 100 | + basePath = localBasePaths[localHostIndex]; |
| 101 | + } else { |
| 102 | + basePath = null; |
| 103 | + } |
| 104 | + |
| 105 | + Object localVarPostBody = batchCustomersRequest; |
| 106 | + |
| 107 | + // create path and map variables |
| 108 | + String localVarPath = "/customers/batch"; |
| 109 | + |
| 110 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 111 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 112 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 113 | + Map<String, String> localVarCookieParams = new HashMap<String, String>(); |
| 114 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 115 | + |
| 116 | + final String[] localVarAccepts = { |
| 117 | + "application/json" |
| 118 | + }; |
| 119 | + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); |
| 120 | + if (localVarAccept != null) { |
| 121 | + localVarHeaderParams.put("Accept", localVarAccept); |
| 122 | + } |
| 123 | + |
| 124 | + final String[] localVarContentTypes = { |
| 125 | + "application/json" |
| 126 | + }; |
| 127 | + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); |
| 128 | + if (localVarContentType != null) { |
| 129 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 130 | + } |
| 131 | + |
| 132 | + String[] localVarAuthNames = new String[] { "basicAuth" }; |
| 133 | + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); |
| 134 | + } |
| 135 | + |
| 136 | + @SuppressWarnings("rawtypes") |
| 137 | + private okhttp3.Call batchCustomersValidateBeforeCall(@javax.annotation.Nullable BatchCustomersRequest batchCustomersRequest, final ApiCallback _callback) throws ApiException { |
| 138 | + return batchCustomersCall(batchCustomersRequest, _callback); |
| 139 | + |
| 140 | + } |
| 141 | + |
| 142 | + /** |
| 143 | + * Batch create, update, and delete customers |
| 144 | + * |
| 145 | + * @param batchCustomersRequest Batch create, update, and delete customers (optional) |
| 146 | + * @return BatchCustomers200Response |
| 147 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 148 | + * @http.response.details |
| 149 | + <table border="1"> |
| 150 | + <caption>Response Details</caption> |
| 151 | + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| 152 | + <tr><td> 200 </td><td> Batch operation results </td><td> - </td></tr> |
| 153 | + </table> |
| 154 | + */ |
| 155 | + public BatchCustomers200Response batchCustomers(@javax.annotation.Nullable BatchCustomersRequest batchCustomersRequest) throws ApiException { |
| 156 | + ApiResponse<BatchCustomers200Response> localVarResp = batchCustomersWithHttpInfo(batchCustomersRequest); |
| 157 | + return localVarResp.getData(); |
| 158 | + } |
| 159 | + |
| 160 | + /** |
| 161 | + * Batch create, update, and delete customers |
| 162 | + * |
| 163 | + * @param batchCustomersRequest Batch create, update, and delete customers (optional) |
| 164 | + * @return ApiResponse<BatchCustomers200Response> |
| 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 border="1"> |
| 168 | + <caption>Response Details</caption> |
| 169 | + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| 170 | + <tr><td> 200 </td><td> Batch operation results </td><td> - </td></tr> |
| 171 | + </table> |
| 172 | + */ |
| 173 | + public ApiResponse<BatchCustomers200Response> batchCustomersWithHttpInfo(@javax.annotation.Nullable BatchCustomersRequest batchCustomersRequest) throws ApiException { |
| 174 | + okhttp3.Call localVarCall = batchCustomersValidateBeforeCall(batchCustomersRequest, null); |
| 175 | + Type localVarReturnType = new TypeToken<BatchCustomers200Response>(){}.getType(); |
| 176 | + return localVarApiClient.execute(localVarCall, localVarReturnType); |
| 177 | + } |
| 178 | + |
| 179 | + /** |
| 180 | + * Batch create, update, and delete customers (asynchronously) |
| 181 | + * |
| 182 | + * @param batchCustomersRequest Batch create, update, and delete customers (optional) |
| 183 | + * @param _callback The callback to be executed when the API call finishes |
| 184 | + * @return The request call |
| 185 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 186 | + * @http.response.details |
| 187 | + <table border="1"> |
| 188 | + <caption>Response Details</caption> |
| 189 | + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| 190 | + <tr><td> 200 </td><td> Batch operation results </td><td> - </td></tr> |
| 191 | + </table> |
| 192 | + */ |
| 193 | + public okhttp3.Call batchCustomersAsync(@javax.annotation.Nullable BatchCustomersRequest batchCustomersRequest, final ApiCallback<BatchCustomers200Response> _callback) throws ApiException { |
| 194 | + |
| 195 | + okhttp3.Call localVarCall = batchCustomersValidateBeforeCall(batchCustomersRequest, _callback); |
| 196 | + Type localVarReturnType = new TypeToken<BatchCustomers200Response>(){}.getType(); |
| 197 | + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); |
| 198 | + return localVarCall; |
| 199 | + } |
76 | 200 | /**
|
77 | 201 | * Build call for createCustomer
|
78 | 202 | * @param customer Customer object with data to create. (required)
|
|
0 commit comments