|
| 1 | +/* |
| 2 | + * STACKIT IaaS API |
| 3 | + * This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. |
| 4 | + * |
| 5 | + * The version of the OpenAPI document: 1 |
| 6 | + * Contact: stackit-iaas@mail.schwarz |
| 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 | + |
| 13 | +package cloud.stackit.sdk.iaas.v1api; |
| 14 | + |
| 15 | +import cloud.stackit.sdk.core.exception.ApiException; |
| 16 | +import java.util.List; |
| 17 | +import java.util.Map; |
| 18 | + |
| 19 | +/** |
| 20 | + * Callback for asynchronous API call. |
| 21 | + * |
| 22 | + * @param <T> The return type |
| 23 | + */ |
| 24 | +public interface ApiCallback<T> { |
| 25 | + /** |
| 26 | + * This is called when the API call fails. |
| 27 | + * |
| 28 | + * @param e The exception causing the failure |
| 29 | + * @param statusCode Status code of the response if available, otherwise it would be 0 |
| 30 | + * @param responseHeaders Headers of the response if available, otherwise it would be null |
| 31 | + */ |
| 32 | + void onFailure(ApiException e, int statusCode, Map<String, List<String>> responseHeaders); |
| 33 | + |
| 34 | + /** |
| 35 | + * This is called when the API call succeeded. |
| 36 | + * |
| 37 | + * @param result The result deserialized from response |
| 38 | + * @param statusCode Status code of the response |
| 39 | + * @param responseHeaders Headers of the response |
| 40 | + */ |
| 41 | + void onSuccess(T result, int statusCode, Map<String, List<String>> responseHeaders); |
| 42 | + |
| 43 | + /** |
| 44 | + * This is called when the API upload processing. |
| 45 | + * |
| 46 | + * @param bytesWritten bytes Written |
| 47 | + * @param contentLength content length of request body |
| 48 | + * @param done write end |
| 49 | + */ |
| 50 | + void onUploadProgress(long bytesWritten, long contentLength, boolean done); |
| 51 | + |
| 52 | + /** |
| 53 | + * This is called when the API download processing. |
| 54 | + * |
| 55 | + * @param bytesRead bytes Read |
| 56 | + * @param contentLength content length of the response |
| 57 | + * @param done Read end |
| 58 | + */ |
| 59 | + void onDownloadProgress(long bytesRead, long contentLength, boolean done); |
| 60 | +} |
0 commit comments