|
107 | 107 | import com.volcengine.vefaas.model.ListSandboxesResponse; |
108 | 108 | import com.volcengine.vefaas.model.ListTriggersRequest; |
109 | 109 | import com.volcengine.vefaas.model.ListTriggersResponse; |
| 110 | +import com.volcengine.vefaas.model.PauseSandboxRequest; |
| 111 | +import com.volcengine.vefaas.model.PauseSandboxResponse; |
110 | 112 | import com.volcengine.vefaas.model.PrecacheSandboxImagesRequest; |
111 | 113 | import com.volcengine.vefaas.model.PrecacheSandboxImagesResponse; |
112 | 114 | import com.volcengine.vefaas.model.QueryUserCrVpcTunnelRequest; |
113 | 115 | import com.volcengine.vefaas.model.QueryUserCrVpcTunnelResponse; |
114 | 116 | import com.volcengine.vefaas.model.ReleaseRequest; |
115 | 117 | import com.volcengine.vefaas.model.ReleaseResponse; |
| 118 | +import com.volcengine.vefaas.model.ResumeSandboxRequest; |
| 119 | +import com.volcengine.vefaas.model.ResumeSandboxResponse; |
116 | 120 | import com.volcengine.vefaas.model.SetSandboxTimeoutRequest; |
117 | 121 | import com.volcengine.vefaas.model.SetSandboxTimeoutResponse; |
118 | 122 | import com.volcengine.vefaas.model.TerminateAsyncTaskRequest; |
@@ -5119,6 +5123,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don |
5119 | 5123 | apiClient.executeAsync(call, localVarReturnType, callback); |
5120 | 5124 | return call; |
5121 | 5125 | } |
| 5126 | + /** |
| 5127 | + * Build call for pauseSandbox |
| 5128 | + * @param body (required) |
| 5129 | + * @param progressListener Progress listener |
| 5130 | + * @param progressRequestListener Progress request listener |
| 5131 | + * @return Call to execute |
| 5132 | + * @throws ApiException If fail to serialize the request body object |
| 5133 | + */ |
| 5134 | + public com.squareup.okhttp.Call pauseSandboxCall(PauseSandboxRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 5135 | + Object localVarPostBody = body; |
| 5136 | + |
| 5137 | + // create path and map variables |
| 5138 | + String localVarPath = "/PauseSandbox/2024-06-06/vefaas/post/application_json/"; |
| 5139 | + |
| 5140 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 5141 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 5142 | + |
| 5143 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 5144 | + |
| 5145 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 5146 | + |
| 5147 | + final String[] localVarAccepts = { |
| 5148 | + "application/json" |
| 5149 | + }; |
| 5150 | + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
| 5151 | + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); |
| 5152 | + |
| 5153 | + final String[] localVarContentTypes = { |
| 5154 | + "text/plain" |
| 5155 | + }; |
| 5156 | + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
| 5157 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 5158 | + |
| 5159 | + if(progressListener != null) { |
| 5160 | + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { |
| 5161 | + @Override |
| 5162 | + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { |
| 5163 | + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); |
| 5164 | + return originalResponse.newBuilder() |
| 5165 | + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) |
| 5166 | + .build(); |
| 5167 | + } |
| 5168 | + }); |
| 5169 | + } |
| 5170 | + |
| 5171 | + String[] localVarAuthNames = new String[] { "volcengineSign" }; |
| 5172 | + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); |
| 5173 | + } |
| 5174 | + |
| 5175 | + @SuppressWarnings("rawtypes") |
| 5176 | + private com.squareup.okhttp.Call pauseSandboxValidateBeforeCall(PauseSandboxRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 5177 | + // verify the required parameter 'body' is set |
| 5178 | + if (body == null) { |
| 5179 | + throw new ApiException("Missing the required parameter 'body' when calling pauseSandbox(Async)"); |
| 5180 | + } |
| 5181 | + |
| 5182 | + com.squareup.okhttp.Call call = pauseSandboxCall(body, progressListener, progressRequestListener); |
| 5183 | + return call; |
| 5184 | + |
| 5185 | + |
| 5186 | + |
| 5187 | + |
| 5188 | + |
| 5189 | + } |
| 5190 | + |
| 5191 | + /** |
| 5192 | + * |
| 5193 | + * |
| 5194 | + * @param body (required) |
| 5195 | + * @return PauseSandboxResponse |
| 5196 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 5197 | + */ |
| 5198 | + public PauseSandboxResponse pauseSandbox(PauseSandboxRequest body) throws ApiException { |
| 5199 | + ApiResponse<PauseSandboxResponse> resp = pauseSandboxWithHttpInfo(body); |
| 5200 | + return resp.getData(); |
| 5201 | + } |
| 5202 | + |
| 5203 | + /** |
| 5204 | + * |
| 5205 | + * |
| 5206 | + * @param body (required) |
| 5207 | + * @return ApiResponse<PauseSandboxResponse> |
| 5208 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 5209 | + */ |
| 5210 | + public ApiResponse<PauseSandboxResponse> pauseSandboxWithHttpInfo( @NotNull PauseSandboxRequest body) throws ApiException { |
| 5211 | + com.squareup.okhttp.Call call = pauseSandboxValidateBeforeCall(body, null, null); |
| 5212 | + Type localVarReturnType = new TypeToken<PauseSandboxResponse>(){}.getType(); |
| 5213 | + return apiClient.execute(call, localVarReturnType); |
| 5214 | + } |
| 5215 | + |
| 5216 | + /** |
| 5217 | + * (asynchronously) |
| 5218 | + * |
| 5219 | + * @param body (required) |
| 5220 | + * @param callback The callback to be executed when the API call finishes |
| 5221 | + * @return The request call |
| 5222 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 5223 | + */ |
| 5224 | + public com.squareup.okhttp.Call pauseSandboxAsync(PauseSandboxRequest body, final ApiCallback<PauseSandboxResponse> callback) throws ApiException { |
| 5225 | + |
| 5226 | + ProgressResponseBody.ProgressListener progressListener = null; |
| 5227 | + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; |
| 5228 | + |
| 5229 | + if (callback != null) { |
| 5230 | + progressListener = new ProgressResponseBody.ProgressListener() { |
| 5231 | + @Override |
| 5232 | + public void update(long bytesRead, long contentLength, boolean done) { |
| 5233 | + callback.onDownloadProgress(bytesRead, contentLength, done); |
| 5234 | + } |
| 5235 | + }; |
| 5236 | + |
| 5237 | + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { |
| 5238 | + @Override |
| 5239 | + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { |
| 5240 | + callback.onUploadProgress(bytesWritten, contentLength, done); |
| 5241 | + } |
| 5242 | + }; |
| 5243 | + } |
| 5244 | + |
| 5245 | + com.squareup.okhttp.Call call = pauseSandboxValidateBeforeCall(body, progressListener, progressRequestListener); |
| 5246 | + Type localVarReturnType = new TypeToken<PauseSandboxResponse>(){}.getType(); |
| 5247 | + apiClient.executeAsync(call, localVarReturnType, callback); |
| 5248 | + return call; |
| 5249 | + } |
5122 | 5250 | /** |
5123 | 5251 | * Build call for precacheSandboxImages |
5124 | 5252 | * @param body (required) |
@@ -5491,6 +5619,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don |
5491 | 5619 | apiClient.executeAsync(call, localVarReturnType, callback); |
5492 | 5620 | return call; |
5493 | 5621 | } |
| 5622 | + /** |
| 5623 | + * Build call for resumeSandbox |
| 5624 | + * @param body (required) |
| 5625 | + * @param progressListener Progress listener |
| 5626 | + * @param progressRequestListener Progress request listener |
| 5627 | + * @return Call to execute |
| 5628 | + * @throws ApiException If fail to serialize the request body object |
| 5629 | + */ |
| 5630 | + public com.squareup.okhttp.Call resumeSandboxCall(ResumeSandboxRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 5631 | + Object localVarPostBody = body; |
| 5632 | + |
| 5633 | + // create path and map variables |
| 5634 | + String localVarPath = "/ResumeSandbox/2024-06-06/vefaas/post/application_json/"; |
| 5635 | + |
| 5636 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 5637 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 5638 | + |
| 5639 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 5640 | + |
| 5641 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 5642 | + |
| 5643 | + final String[] localVarAccepts = { |
| 5644 | + "application/json" |
| 5645 | + }; |
| 5646 | + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
| 5647 | + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); |
| 5648 | + |
| 5649 | + final String[] localVarContentTypes = { |
| 5650 | + "text/plain" |
| 5651 | + }; |
| 5652 | + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
| 5653 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 5654 | + |
| 5655 | + if(progressListener != null) { |
| 5656 | + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { |
| 5657 | + @Override |
| 5658 | + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { |
| 5659 | + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); |
| 5660 | + return originalResponse.newBuilder() |
| 5661 | + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) |
| 5662 | + .build(); |
| 5663 | + } |
| 5664 | + }); |
| 5665 | + } |
| 5666 | + |
| 5667 | + String[] localVarAuthNames = new String[] { "volcengineSign" }; |
| 5668 | + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); |
| 5669 | + } |
| 5670 | + |
| 5671 | + @SuppressWarnings("rawtypes") |
| 5672 | + private com.squareup.okhttp.Call resumeSandboxValidateBeforeCall(ResumeSandboxRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 5673 | + // verify the required parameter 'body' is set |
| 5674 | + if (body == null) { |
| 5675 | + throw new ApiException("Missing the required parameter 'body' when calling resumeSandbox(Async)"); |
| 5676 | + } |
| 5677 | + |
| 5678 | + com.squareup.okhttp.Call call = resumeSandboxCall(body, progressListener, progressRequestListener); |
| 5679 | + return call; |
| 5680 | + |
| 5681 | + |
| 5682 | + |
| 5683 | + |
| 5684 | + |
| 5685 | + } |
| 5686 | + |
| 5687 | + /** |
| 5688 | + * |
| 5689 | + * |
| 5690 | + * @param body (required) |
| 5691 | + * @return ResumeSandboxResponse |
| 5692 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 5693 | + */ |
| 5694 | + public ResumeSandboxResponse resumeSandbox(ResumeSandboxRequest body) throws ApiException { |
| 5695 | + ApiResponse<ResumeSandboxResponse> resp = resumeSandboxWithHttpInfo(body); |
| 5696 | + return resp.getData(); |
| 5697 | + } |
| 5698 | + |
| 5699 | + /** |
| 5700 | + * |
| 5701 | + * |
| 5702 | + * @param body (required) |
| 5703 | + * @return ApiResponse<ResumeSandboxResponse> |
| 5704 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 5705 | + */ |
| 5706 | + public ApiResponse<ResumeSandboxResponse> resumeSandboxWithHttpInfo( @NotNull ResumeSandboxRequest body) throws ApiException { |
| 5707 | + com.squareup.okhttp.Call call = resumeSandboxValidateBeforeCall(body, null, null); |
| 5708 | + Type localVarReturnType = new TypeToken<ResumeSandboxResponse>(){}.getType(); |
| 5709 | + return apiClient.execute(call, localVarReturnType); |
| 5710 | + } |
| 5711 | + |
| 5712 | + /** |
| 5713 | + * (asynchronously) |
| 5714 | + * |
| 5715 | + * @param body (required) |
| 5716 | + * @param callback The callback to be executed when the API call finishes |
| 5717 | + * @return The request call |
| 5718 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 5719 | + */ |
| 5720 | + public com.squareup.okhttp.Call resumeSandboxAsync(ResumeSandboxRequest body, final ApiCallback<ResumeSandboxResponse> callback) throws ApiException { |
| 5721 | + |
| 5722 | + ProgressResponseBody.ProgressListener progressListener = null; |
| 5723 | + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; |
| 5724 | + |
| 5725 | + if (callback != null) { |
| 5726 | + progressListener = new ProgressResponseBody.ProgressListener() { |
| 5727 | + @Override |
| 5728 | + public void update(long bytesRead, long contentLength, boolean done) { |
| 5729 | + callback.onDownloadProgress(bytesRead, contentLength, done); |
| 5730 | + } |
| 5731 | + }; |
| 5732 | + |
| 5733 | + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { |
| 5734 | + @Override |
| 5735 | + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { |
| 5736 | + callback.onUploadProgress(bytesWritten, contentLength, done); |
| 5737 | + } |
| 5738 | + }; |
| 5739 | + } |
| 5740 | + |
| 5741 | + com.squareup.okhttp.Call call = resumeSandboxValidateBeforeCall(body, progressListener, progressRequestListener); |
| 5742 | + Type localVarReturnType = new TypeToken<ResumeSandboxResponse>(){}.getType(); |
| 5743 | + apiClient.executeAsync(call, localVarReturnType, callback); |
| 5744 | + return call; |
| 5745 | + } |
5494 | 5746 | /** |
5495 | 5747 | * Build call for setSandboxTimeout |
5496 | 5748 | * @param body (required) |
|
0 commit comments