diff --git a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/CustomVisionPredictionClient.java b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/CustomVisionPredictionClient.java new file mode 100644 index 000000000000..9f3db2a75cce --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/CustomVisionPredictionClient.java @@ -0,0 +1,945 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.cognitiveservices.vision.customvision.prediction; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.CustomVisionErrorException; +import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.ImagePrediction; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.UUID; +import rx.Observable; + +/** + * The interface for CustomVisionPredictionClient class. + */ +public interface CustomVisionPredictionClient { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + AzureClient getAzureClient(); + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + String userAgent(); + + /** + * Gets . + * + * @return the apiKey value. + */ + String apiKey(); + + /** + * Sets . + * + * @param apiKey the apiKey value. + * @return the service client itself + */ + CustomVisionPredictionClient withApiKey(String apiKey); + + /** + * Gets Supported Cognitive Services endpoints.. + * + * @return the endpoint value. + */ + String endpoint(); + + /** + * Sets Supported Cognitive Services endpoints.. + * + * @param endpoint the endpoint value. + * @return the service client itself + */ + CustomVisionPredictionClient withEndpoint(String endpoint); + + /** + * Gets The preferred language for the response.. + * + * @return the acceptLanguage value. + */ + String acceptLanguage(); + + /** + * Sets The preferred language for the response.. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + CustomVisionPredictionClient withAcceptLanguage(String acceptLanguage); + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @return the longRunningOperationRetryTimeout value. + */ + int longRunningOperationRetryTimeout(); + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + CustomVisionPredictionClient withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout); + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @return the generateClientRequestId value. + */ + boolean generateClientRequestId(); + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + CustomVisionPredictionClient withGenerateClientRequestId(boolean generateClientRequestId); + + /** + * Classify an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + ImagePrediction classifyImageUrl(UUID projectId, String name); + + /** + * Classify an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture classifyImageUrlAsync(UUID projectId, String name, final ServiceCallback serviceCallback); + + /** + * Classify an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable classifyImageUrlAsync(UUID projectId, String name); + + /** + * Classify an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable> classifyImageUrlWithServiceResponseAsync(UUID projectId, String name); + /** + * Classify an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + ImagePrediction classifyImageUrl(UUID projectId, String name, String application, String url); + + /** + * Classify an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture classifyImageUrlAsync(UUID projectId, String name, String application, String url, final ServiceCallback serviceCallback); + + /** + * Classify an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable classifyImageUrlAsync(UUID projectId, String name, String application, String url); + + /** + * Classify an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable> classifyImageUrlWithServiceResponseAsync(UUID projectId, String name, String application, String url); + + /** + * Classify an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + ImagePrediction classifyImage(UUID projectId, String name, byte[] imageData); + + /** + * Classify an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture classifyImageAsync(UUID projectId, String name, byte[] imageData, final ServiceCallback serviceCallback); + + /** + * Classify an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable classifyImageAsync(UUID projectId, String name, byte[] imageData); + + /** + * Classify an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable> classifyImageWithServiceResponseAsync(UUID projectId, String name, byte[] imageData); + /** + * Classify an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + ImagePrediction classifyImage(UUID projectId, String name, byte[] imageData, String application); + + /** + * Classify an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture classifyImageAsync(UUID projectId, String name, byte[] imageData, String application, final ServiceCallback serviceCallback); + + /** + * Classify an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable classifyImageAsync(UUID projectId, String name, byte[] imageData, String application); + + /** + * Classify an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable> classifyImageWithServiceResponseAsync(UUID projectId, String name, byte[] imageData, String application); + + /** + * Classify an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + ImagePrediction classifyImageUrlWithNoStore(UUID projectId, String name); + + /** + * Classify an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture classifyImageUrlWithNoStoreAsync(UUID projectId, String name, final ServiceCallback serviceCallback); + + /** + * Classify an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable classifyImageUrlWithNoStoreAsync(UUID projectId, String name); + + /** + * Classify an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable> classifyImageUrlWithNoStoreWithServiceResponseAsync(UUID projectId, String name); + /** + * Classify an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + ImagePrediction classifyImageUrlWithNoStore(UUID projectId, String name, String application, String url); + + /** + * Classify an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture classifyImageUrlWithNoStoreAsync(UUID projectId, String name, String application, String url, final ServiceCallback serviceCallback); + + /** + * Classify an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable classifyImageUrlWithNoStoreAsync(UUID projectId, String name, String application, String url); + + /** + * Classify an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable> classifyImageUrlWithNoStoreWithServiceResponseAsync(UUID projectId, String name, String application, String url); + + /** + * Classify an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + ImagePrediction classifyImageWithNoStore(UUID projectId, String name, byte[] imageData); + + /** + * Classify an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture classifyImageWithNoStoreAsync(UUID projectId, String name, byte[] imageData, final ServiceCallback serviceCallback); + + /** + * Classify an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable classifyImageWithNoStoreAsync(UUID projectId, String name, byte[] imageData); + + /** + * Classify an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable> classifyImageWithNoStoreWithServiceResponseAsync(UUID projectId, String name, byte[] imageData); + /** + * Classify an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + ImagePrediction classifyImageWithNoStore(UUID projectId, String name, byte[] imageData, String application); + + /** + * Classify an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture classifyImageWithNoStoreAsync(UUID projectId, String name, byte[] imageData, String application, final ServiceCallback serviceCallback); + + /** + * Classify an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable classifyImageWithNoStoreAsync(UUID projectId, String name, byte[] imageData, String application); + + /** + * Classify an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable> classifyImageWithNoStoreWithServiceResponseAsync(UUID projectId, String name, byte[] imageData, String application); + + /** + * Detect objects in an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + ImagePrediction detectImageUrl(UUID projectId, String name); + + /** + * Detect objects in an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture detectImageUrlAsync(UUID projectId, String name, final ServiceCallback serviceCallback); + + /** + * Detect objects in an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable detectImageUrlAsync(UUID projectId, String name); + + /** + * Detect objects in an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable> detectImageUrlWithServiceResponseAsync(UUID projectId, String name); + /** + * Detect objects in an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + ImagePrediction detectImageUrl(UUID projectId, String name, String application, String url); + + /** + * Detect objects in an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture detectImageUrlAsync(UUID projectId, String name, String application, String url, final ServiceCallback serviceCallback); + + /** + * Detect objects in an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable detectImageUrlAsync(UUID projectId, String name, String application, String url); + + /** + * Detect objects in an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable> detectImageUrlWithServiceResponseAsync(UUID projectId, String name, String application, String url); + + /** + * Detect objects in an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + ImagePrediction detectImage(UUID projectId, String name, byte[] imageData); + + /** + * Detect objects in an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture detectImageAsync(UUID projectId, String name, byte[] imageData, final ServiceCallback serviceCallback); + + /** + * Detect objects in an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable detectImageAsync(UUID projectId, String name, byte[] imageData); + + /** + * Detect objects in an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable> detectImageWithServiceResponseAsync(UUID projectId, String name, byte[] imageData); + /** + * Detect objects in an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + ImagePrediction detectImage(UUID projectId, String name, byte[] imageData, String application); + + /** + * Detect objects in an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture detectImageAsync(UUID projectId, String name, byte[] imageData, String application, final ServiceCallback serviceCallback); + + /** + * Detect objects in an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable detectImageAsync(UUID projectId, String name, byte[] imageData, String application); + + /** + * Detect objects in an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable> detectImageWithServiceResponseAsync(UUID projectId, String name, byte[] imageData, String application); + + /** + * Detect objects in an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + ImagePrediction detectImageUrlWithNoStore(UUID projectId, String name); + + /** + * Detect objects in an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture detectImageUrlWithNoStoreAsync(UUID projectId, String name, final ServiceCallback serviceCallback); + + /** + * Detect objects in an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable detectImageUrlWithNoStoreAsync(UUID projectId, String name); + + /** + * Detect objects in an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable> detectImageUrlWithNoStoreWithServiceResponseAsync(UUID projectId, String name); + /** + * Detect objects in an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + ImagePrediction detectImageUrlWithNoStore(UUID projectId, String name, String application, String url); + + /** + * Detect objects in an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture detectImageUrlWithNoStoreAsync(UUID projectId, String name, String application, String url, final ServiceCallback serviceCallback); + + /** + * Detect objects in an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable detectImageUrlWithNoStoreAsync(UUID projectId, String name, String application, String url); + + /** + * Detect objects in an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable> detectImageUrlWithNoStoreWithServiceResponseAsync(UUID projectId, String name, String application, String url); + + /** + * Detect objects in an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + ImagePrediction detectImageWithNoStore(UUID projectId, String name, byte[] imageData); + + /** + * Detect objects in an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture detectImageWithNoStoreAsync(UUID projectId, String name, byte[] imageData, final ServiceCallback serviceCallback); + + /** + * Detect objects in an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable detectImageWithNoStoreAsync(UUID projectId, String name, byte[] imageData); + + /** + * Detect objects in an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable> detectImageWithNoStoreWithServiceResponseAsync(UUID projectId, String name, byte[] imageData); + /** + * Detect objects in an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + ImagePrediction detectImageWithNoStore(UUID projectId, String name, byte[] imageData, String application); + + /** + * Detect objects in an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture detectImageWithNoStoreAsync(UUID projectId, String name, byte[] imageData, String application, final ServiceCallback serviceCallback); + + /** + * Detect objects in an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable detectImageWithNoStoreAsync(UUID projectId, String name, byte[] imageData, String application); + + /** + * Detect objects in an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable> detectImageWithNoStoreWithServiceResponseAsync(UUID projectId, String name, byte[] imageData, String application); + +} diff --git a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/CustomVisionPredictionClientImpl.java b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/CustomVisionPredictionClientImpl.java new file mode 100644 index 000000000000..28d0a4ccaef9 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/CustomVisionPredictionClientImpl.java @@ -0,0 +1,1803 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.cognitiveservices.vision.customvision.prediction.implementation; + +import com.google.common.base.Joiner; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.CustomVisionPredictionClient; +import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.CustomVisionErrorException; +import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.ImagePrediction; +import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.ImageUrl; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.InputStream; +import java.io.IOException; +import java.util.UUID; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Multipart; +import retrofit2.http.Part; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * Initializes a new instance of the CustomVisionPredictionClientImpl class. + */ +public class CustomVisionPredictionClientImpl extends AzureServiceClient implements CustomVisionPredictionClient { + /** The Retrofit service to perform REST calls. */ + private CustomVisionPredictionClientService service; + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** */ + private String apiKey; + + /** + * Gets + * + * @return the apiKey value. + */ + public String apiKey() { + return this.apiKey; + } + + /** + * Sets + * + * @param apiKey the apiKey value. + * @return the service client itself + */ + public CustomVisionPredictionClientImpl withApiKey(String apiKey) { + this.apiKey = apiKey; + return this; + } + + /** Supported Cognitive Services endpoints. */ + private String endpoint; + + /** + * Gets Supported Cognitive Services endpoints. + * + * @return the endpoint value. + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Sets Supported Cognitive Services endpoints. + * + * @param endpoint the endpoint value. + * @return the service client itself + */ + public CustomVisionPredictionClientImpl withEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public CustomVisionPredictionClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public CustomVisionPredictionClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public CustomVisionPredictionClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * Initializes an instance of CustomVisionPredictionClient client. + * + * @param credentials the management credentials for Azure + */ + public CustomVisionPredictionClientImpl(ServiceClientCredentials credentials) { + this("https://{Endpoint}/customvision/v3.0/prediction", credentials); + } + + /** + * Initializes an instance of CustomVisionPredictionClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + private CustomVisionPredictionClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of CustomVisionPredictionClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public CustomVisionPredictionClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.azureClient = new AzureClient(this); + initializeService(); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "CustomVisionPredictionClient", "3.0"); + } + + private void initializeService() { + service = restClient().retrofit().create(CustomVisionPredictionClientService.class); + } + + /** + * The interface defining all the services for CustomVisionPredictionClient to be + * used by Retrofit to perform actually REST calls. + */ + interface CustomVisionPredictionClientService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.prediction.CustomVisionPredictionClient classifyImageUrl" }) + @POST("{projectId}/classify/models/{name}/url") + Observable> classifyImageUrl(@Path("projectId") UUID projectId, @Path("name") String name, @Query("application") String application, @Header("Prediction-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Body ImageUrl imageUrl, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Multipart + @POST("{projectId}/classify/models/{name}/image") + Observable> classifyImage(@Path("projectId") UUID projectId, @Path("name") String name, @Query("application") String application, @Part("imageData") RequestBody imageData, @Header("Prediction-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.prediction.CustomVisionPredictionClient classifyImageUrlWithNoStore" }) + @POST("{projectId}/classify/models/{name}/url/nostore") + Observable> classifyImageUrlWithNoStore(@Path("projectId") UUID projectId, @Path("name") String name, @Query("application") String application, @Header("Prediction-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Body ImageUrl imageUrl, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Multipart + @POST("{projectId}/classify/models/{name}/image/nostore") + Observable> classifyImageWithNoStore(@Path("projectId") UUID projectId, @Path("name") String name, @Query("application") String application, @Part("imageData") RequestBody imageData, @Header("Prediction-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.prediction.CustomVisionPredictionClient detectImageUrl" }) + @POST("{projectId}/detect/models/{name}/url") + Observable> detectImageUrl(@Path("projectId") UUID projectId, @Path("name") String name, @Query("application") String application, @Header("Prediction-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Body ImageUrl imageUrl, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Multipart + @POST("{projectId}/detect/models/{name}/image") + Observable> detectImage(@Path("projectId") UUID projectId, @Path("name") String name, @Query("application") String application, @Part("imageData") RequestBody imageData, @Header("Prediction-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.prediction.CustomVisionPredictionClient detectImageUrlWithNoStore" }) + @POST("{projectId}/detect/models/{name}/url/nostore") + Observable> detectImageUrlWithNoStore(@Path("projectId") UUID projectId, @Path("name") String name, @Query("application") String application, @Header("Prediction-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Body ImageUrl imageUrl, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Multipart + @POST("{projectId}/detect/models/{name}/image/nostore") + Observable> detectImageWithNoStore(@Path("projectId") UUID projectId, @Path("name") String name, @Query("application") String application, @Part("imageData") RequestBody imageData, @Header("Prediction-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + } + + /** + * Classify an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + public ImagePrediction classifyImageUrl(UUID projectId, String name) { + return classifyImageUrlWithServiceResponseAsync(projectId, name).toBlocking().single().body(); + } + + /** + * Classify an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture classifyImageUrlAsync(UUID projectId, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(classifyImageUrlWithServiceResponseAsync(projectId, name), serviceCallback); + } + + /** + * Classify an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable classifyImageUrlAsync(UUID projectId, String name) { + return classifyImageUrlWithServiceResponseAsync(projectId, name).map(new Func1, ImagePrediction>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Classify an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable> classifyImageUrlWithServiceResponseAsync(UUID projectId, String name) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + final String application = null; + final String url = null; + ImageUrl imageUrl = new ImageUrl(); + imageUrl.withUrl(null); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.classifyImageUrl(projectId, name, application, this.apiKey(), this.acceptLanguage(), imageUrl, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = classifyImageUrlDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Classify an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + public ImagePrediction classifyImageUrl(UUID projectId, String name, String application, String url) { + return classifyImageUrlWithServiceResponseAsync(projectId, name, application, url).toBlocking().single().body(); + } + + /** + * Classify an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture classifyImageUrlAsync(UUID projectId, String name, String application, String url, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(classifyImageUrlWithServiceResponseAsync(projectId, name, application, url), serviceCallback); + } + + /** + * Classify an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable classifyImageUrlAsync(UUID projectId, String name, String application, String url) { + return classifyImageUrlWithServiceResponseAsync(projectId, name, application, url).map(new Func1, ImagePrediction>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Classify an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable> classifyImageUrlWithServiceResponseAsync(UUID projectId, String name, String application, String url) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + ImageUrl imageUrl = new ImageUrl(); + imageUrl.withUrl(url); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.classifyImageUrl(projectId, name, application, this.apiKey(), this.acceptLanguage(), imageUrl, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = classifyImageUrlDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse classifyImageUrlDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) + .build(response); + } + + /** + * Classify an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + public ImagePrediction classifyImage(UUID projectId, String name, byte[] imageData) { + return classifyImageWithServiceResponseAsync(projectId, name, imageData).toBlocking().single().body(); + } + + /** + * Classify an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture classifyImageAsync(UUID projectId, String name, byte[] imageData, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(classifyImageWithServiceResponseAsync(projectId, name, imageData), serviceCallback); + } + + /** + * Classify an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable classifyImageAsync(UUID projectId, String name, byte[] imageData) { + return classifyImageWithServiceResponseAsync(projectId, name, imageData).map(new Func1, ImagePrediction>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Classify an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable> classifyImageWithServiceResponseAsync(UUID projectId, String name, byte[] imageData) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (imageData == null) { + throw new IllegalArgumentException("Parameter imageData is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + final String application = null; + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + RequestBody imageDataConverted = RequestBody.create(MediaType.parse("multipart/form-data"), imageData); + return service.classifyImage(projectId, name, application, imageDataConverted, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = classifyImageDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Classify an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + public ImagePrediction classifyImage(UUID projectId, String name, byte[] imageData, String application) { + return classifyImageWithServiceResponseAsync(projectId, name, imageData, application).toBlocking().single().body(); + } + + /** + * Classify an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture classifyImageAsync(UUID projectId, String name, byte[] imageData, String application, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(classifyImageWithServiceResponseAsync(projectId, name, imageData, application), serviceCallback); + } + + /** + * Classify an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable classifyImageAsync(UUID projectId, String name, byte[] imageData, String application) { + return classifyImageWithServiceResponseAsync(projectId, name, imageData, application).map(new Func1, ImagePrediction>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Classify an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable> classifyImageWithServiceResponseAsync(UUID projectId, String name, byte[] imageData, String application) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (imageData == null) { + throw new IllegalArgumentException("Parameter imageData is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + RequestBody imageDataConverted = RequestBody.create(MediaType.parse("multipart/form-data"), imageData); + return service.classifyImage(projectId, name, application, imageDataConverted, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = classifyImageDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse classifyImageDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) + .build(response); + } + + /** + * Classify an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + public ImagePrediction classifyImageUrlWithNoStore(UUID projectId, String name) { + return classifyImageUrlWithNoStoreWithServiceResponseAsync(projectId, name).toBlocking().single().body(); + } + + /** + * Classify an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture classifyImageUrlWithNoStoreAsync(UUID projectId, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(classifyImageUrlWithNoStoreWithServiceResponseAsync(projectId, name), serviceCallback); + } + + /** + * Classify an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable classifyImageUrlWithNoStoreAsync(UUID projectId, String name) { + return classifyImageUrlWithNoStoreWithServiceResponseAsync(projectId, name).map(new Func1, ImagePrediction>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Classify an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable> classifyImageUrlWithNoStoreWithServiceResponseAsync(UUID projectId, String name) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + final String application = null; + final String url = null; + ImageUrl imageUrl = new ImageUrl(); + imageUrl.withUrl(null); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.classifyImageUrlWithNoStore(projectId, name, application, this.apiKey(), this.acceptLanguage(), imageUrl, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = classifyImageUrlWithNoStoreDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Classify an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + public ImagePrediction classifyImageUrlWithNoStore(UUID projectId, String name, String application, String url) { + return classifyImageUrlWithNoStoreWithServiceResponseAsync(projectId, name, application, url).toBlocking().single().body(); + } + + /** + * Classify an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture classifyImageUrlWithNoStoreAsync(UUID projectId, String name, String application, String url, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(classifyImageUrlWithNoStoreWithServiceResponseAsync(projectId, name, application, url), serviceCallback); + } + + /** + * Classify an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable classifyImageUrlWithNoStoreAsync(UUID projectId, String name, String application, String url) { + return classifyImageUrlWithNoStoreWithServiceResponseAsync(projectId, name, application, url).map(new Func1, ImagePrediction>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Classify an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable> classifyImageUrlWithNoStoreWithServiceResponseAsync(UUID projectId, String name, String application, String url) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + ImageUrl imageUrl = new ImageUrl(); + imageUrl.withUrl(url); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.classifyImageUrlWithNoStore(projectId, name, application, this.apiKey(), this.acceptLanguage(), imageUrl, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = classifyImageUrlWithNoStoreDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse classifyImageUrlWithNoStoreDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) + .build(response); + } + + /** + * Classify an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + public ImagePrediction classifyImageWithNoStore(UUID projectId, String name, byte[] imageData) { + return classifyImageWithNoStoreWithServiceResponseAsync(projectId, name, imageData).toBlocking().single().body(); + } + + /** + * Classify an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture classifyImageWithNoStoreAsync(UUID projectId, String name, byte[] imageData, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(classifyImageWithNoStoreWithServiceResponseAsync(projectId, name, imageData), serviceCallback); + } + + /** + * Classify an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable classifyImageWithNoStoreAsync(UUID projectId, String name, byte[] imageData) { + return classifyImageWithNoStoreWithServiceResponseAsync(projectId, name, imageData).map(new Func1, ImagePrediction>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Classify an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable> classifyImageWithNoStoreWithServiceResponseAsync(UUID projectId, String name, byte[] imageData) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (imageData == null) { + throw new IllegalArgumentException("Parameter imageData is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + final String application = null; + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + RequestBody imageDataConverted = RequestBody.create(MediaType.parse("multipart/form-data"), imageData); + return service.classifyImageWithNoStore(projectId, name, application, imageDataConverted, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = classifyImageWithNoStoreDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Classify an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + public ImagePrediction classifyImageWithNoStore(UUID projectId, String name, byte[] imageData, String application) { + return classifyImageWithNoStoreWithServiceResponseAsync(projectId, name, imageData, application).toBlocking().single().body(); + } + + /** + * Classify an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture classifyImageWithNoStoreAsync(UUID projectId, String name, byte[] imageData, String application, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(classifyImageWithNoStoreWithServiceResponseAsync(projectId, name, imageData, application), serviceCallback); + } + + /** + * Classify an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable classifyImageWithNoStoreAsync(UUID projectId, String name, byte[] imageData, String application) { + return classifyImageWithNoStoreWithServiceResponseAsync(projectId, name, imageData, application).map(new Func1, ImagePrediction>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Classify an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable> classifyImageWithNoStoreWithServiceResponseAsync(UUID projectId, String name, byte[] imageData, String application) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (imageData == null) { + throw new IllegalArgumentException("Parameter imageData is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + RequestBody imageDataConverted = RequestBody.create(MediaType.parse("multipart/form-data"), imageData); + return service.classifyImageWithNoStore(projectId, name, application, imageDataConverted, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = classifyImageWithNoStoreDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse classifyImageWithNoStoreDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) + .build(response); + } + + /** + * Detect objects in an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + public ImagePrediction detectImageUrl(UUID projectId, String name) { + return detectImageUrlWithServiceResponseAsync(projectId, name).toBlocking().single().body(); + } + + /** + * Detect objects in an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture detectImageUrlAsync(UUID projectId, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(detectImageUrlWithServiceResponseAsync(projectId, name), serviceCallback); + } + + /** + * Detect objects in an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable detectImageUrlAsync(UUID projectId, String name) { + return detectImageUrlWithServiceResponseAsync(projectId, name).map(new Func1, ImagePrediction>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Detect objects in an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable> detectImageUrlWithServiceResponseAsync(UUID projectId, String name) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + final String application = null; + final String url = null; + ImageUrl imageUrl = new ImageUrl(); + imageUrl.withUrl(null); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.detectImageUrl(projectId, name, application, this.apiKey(), this.acceptLanguage(), imageUrl, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = detectImageUrlDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Detect objects in an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + public ImagePrediction detectImageUrl(UUID projectId, String name, String application, String url) { + return detectImageUrlWithServiceResponseAsync(projectId, name, application, url).toBlocking().single().body(); + } + + /** + * Detect objects in an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture detectImageUrlAsync(UUID projectId, String name, String application, String url, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(detectImageUrlWithServiceResponseAsync(projectId, name, application, url), serviceCallback); + } + + /** + * Detect objects in an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable detectImageUrlAsync(UUID projectId, String name, String application, String url) { + return detectImageUrlWithServiceResponseAsync(projectId, name, application, url).map(new Func1, ImagePrediction>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Detect objects in an image url and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable> detectImageUrlWithServiceResponseAsync(UUID projectId, String name, String application, String url) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + ImageUrl imageUrl = new ImageUrl(); + imageUrl.withUrl(url); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.detectImageUrl(projectId, name, application, this.apiKey(), this.acceptLanguage(), imageUrl, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = detectImageUrlDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse detectImageUrlDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) + .build(response); + } + + /** + * Detect objects in an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + public ImagePrediction detectImage(UUID projectId, String name, byte[] imageData) { + return detectImageWithServiceResponseAsync(projectId, name, imageData).toBlocking().single().body(); + } + + /** + * Detect objects in an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture detectImageAsync(UUID projectId, String name, byte[] imageData, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(detectImageWithServiceResponseAsync(projectId, name, imageData), serviceCallback); + } + + /** + * Detect objects in an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable detectImageAsync(UUID projectId, String name, byte[] imageData) { + return detectImageWithServiceResponseAsync(projectId, name, imageData).map(new Func1, ImagePrediction>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Detect objects in an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable> detectImageWithServiceResponseAsync(UUID projectId, String name, byte[] imageData) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (imageData == null) { + throw new IllegalArgumentException("Parameter imageData is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + final String application = null; + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + RequestBody imageDataConverted = RequestBody.create(MediaType.parse("multipart/form-data"), imageData); + return service.detectImage(projectId, name, application, imageDataConverted, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = detectImageDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Detect objects in an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + public ImagePrediction detectImage(UUID projectId, String name, byte[] imageData, String application) { + return detectImageWithServiceResponseAsync(projectId, name, imageData, application).toBlocking().single().body(); + } + + /** + * Detect objects in an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture detectImageAsync(UUID projectId, String name, byte[] imageData, String application, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(detectImageWithServiceResponseAsync(projectId, name, imageData, application), serviceCallback); + } + + /** + * Detect objects in an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable detectImageAsync(UUID projectId, String name, byte[] imageData, String application) { + return detectImageWithServiceResponseAsync(projectId, name, imageData, application).map(new Func1, ImagePrediction>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Detect objects in an image and saves the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable> detectImageWithServiceResponseAsync(UUID projectId, String name, byte[] imageData, String application) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (imageData == null) { + throw new IllegalArgumentException("Parameter imageData is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + RequestBody imageDataConverted = RequestBody.create(MediaType.parse("multipart/form-data"), imageData); + return service.detectImage(projectId, name, application, imageDataConverted, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = detectImageDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse detectImageDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) + .build(response); + } + + /** + * Detect objects in an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + public ImagePrediction detectImageUrlWithNoStore(UUID projectId, String name) { + return detectImageUrlWithNoStoreWithServiceResponseAsync(projectId, name).toBlocking().single().body(); + } + + /** + * Detect objects in an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture detectImageUrlWithNoStoreAsync(UUID projectId, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(detectImageUrlWithNoStoreWithServiceResponseAsync(projectId, name), serviceCallback); + } + + /** + * Detect objects in an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable detectImageUrlWithNoStoreAsync(UUID projectId, String name) { + return detectImageUrlWithNoStoreWithServiceResponseAsync(projectId, name).map(new Func1, ImagePrediction>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Detect objects in an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable> detectImageUrlWithNoStoreWithServiceResponseAsync(UUID projectId, String name) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + final String application = null; + final String url = null; + ImageUrl imageUrl = new ImageUrl(); + imageUrl.withUrl(null); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.detectImageUrlWithNoStore(projectId, name, application, this.apiKey(), this.acceptLanguage(), imageUrl, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = detectImageUrlWithNoStoreDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Detect objects in an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + public ImagePrediction detectImageUrlWithNoStore(UUID projectId, String name, String application, String url) { + return detectImageUrlWithNoStoreWithServiceResponseAsync(projectId, name, application, url).toBlocking().single().body(); + } + + /** + * Detect objects in an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture detectImageUrlWithNoStoreAsync(UUID projectId, String name, String application, String url, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(detectImageUrlWithNoStoreWithServiceResponseAsync(projectId, name, application, url), serviceCallback); + } + + /** + * Detect objects in an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable detectImageUrlWithNoStoreAsync(UUID projectId, String name, String application, String url) { + return detectImageUrlWithNoStoreWithServiceResponseAsync(projectId, name, application, url).map(new Func1, ImagePrediction>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Detect objects in an image url without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param application Optional. Specifies the name of application using the endpoint. + * @param url Url of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable> detectImageUrlWithNoStoreWithServiceResponseAsync(UUID projectId, String name, String application, String url) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + ImageUrl imageUrl = new ImageUrl(); + imageUrl.withUrl(url); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.detectImageUrlWithNoStore(projectId, name, application, this.apiKey(), this.acceptLanguage(), imageUrl, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = detectImageUrlWithNoStoreDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse detectImageUrlWithNoStoreDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) + .build(response); + } + + /** + * Detect objects in an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + public ImagePrediction detectImageWithNoStore(UUID projectId, String name, byte[] imageData) { + return detectImageWithNoStoreWithServiceResponseAsync(projectId, name, imageData).toBlocking().single().body(); + } + + /** + * Detect objects in an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture detectImageWithNoStoreAsync(UUID projectId, String name, byte[] imageData, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(detectImageWithNoStoreWithServiceResponseAsync(projectId, name, imageData), serviceCallback); + } + + /** + * Detect objects in an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable detectImageWithNoStoreAsync(UUID projectId, String name, byte[] imageData) { + return detectImageWithNoStoreWithServiceResponseAsync(projectId, name, imageData).map(new Func1, ImagePrediction>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Detect objects in an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable> detectImageWithNoStoreWithServiceResponseAsync(UUID projectId, String name, byte[] imageData) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (imageData == null) { + throw new IllegalArgumentException("Parameter imageData is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + final String application = null; + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + RequestBody imageDataConverted = RequestBody.create(MediaType.parse("multipart/form-data"), imageData); + return service.detectImageWithNoStore(projectId, name, application, imageDataConverted, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = detectImageWithNoStoreDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Detect objects in an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CustomVisionErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + public ImagePrediction detectImageWithNoStore(UUID projectId, String name, byte[] imageData, String application) { + return detectImageWithNoStoreWithServiceResponseAsync(projectId, name, imageData, application).toBlocking().single().body(); + } + + /** + * Detect objects in an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture detectImageWithNoStoreAsync(UUID projectId, String name, byte[] imageData, String application, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(detectImageWithNoStoreWithServiceResponseAsync(projectId, name, imageData, application), serviceCallback); + } + + /** + * Detect objects in an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable detectImageWithNoStoreAsync(UUID projectId, String name, byte[] imageData, String application) { + return detectImageWithNoStoreWithServiceResponseAsync(projectId, name, imageData, application).map(new Func1, ImagePrediction>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Detect objects in an image without saving the result. + * + * @param projectId The project id. + * @param name Specifies the name of the model to evaluate against. + The default iteration for the project will be used when not specified. + * @param imageData Binary image data. + * @param application Optional. Specifies the name of application using the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable> detectImageWithNoStoreWithServiceResponseAsync(UUID projectId, String name, byte[] imageData, String application) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (imageData == null) { + throw new IllegalArgumentException("Parameter imageData is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + RequestBody imageDataConverted = RequestBody.create(MediaType.parse("multipart/form-data"), imageData); + return service.detectImageWithNoStore(projectId, name, application, imageDataConverted, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = detectImageWithNoStoreDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse detectImageWithNoStoreDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) + .build(response); + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/package-info.java b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/package-info.java index b57774622496..1b58a050731e 100644 --- a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/package-info.java +++ b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/package-info.java @@ -5,6 +5,6 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * This package contains the implementation classes for PredictionEndpoint. + * This package contains the implementation classes for CustomVisionPredictionClient. */ package com.microsoft.azure.cognitiveservices.vision.customvision.prediction.implementation; diff --git a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/BoundingBox.java b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/BoundingBox.java index 48cce04f1dfa..563ba4ed799f 100644 --- a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/BoundingBox.java +++ b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/BoundingBox.java @@ -11,35 +11,35 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The BoundingBox model. + * Bounding box that defines a region of an image. */ public class BoundingBox { /** - * The left property. + * Coordinate of the left boundary. */ @JsonProperty(value = "left") private double left; /** - * The top property. + * Coordinate of the top boundary. */ @JsonProperty(value = "top") private double top; /** - * The width property. + * Width. */ @JsonProperty(value = "width") private double width; /** - * The height property. + * Height. */ @JsonProperty(value = "height") private double height; /** - * Get the left value. + * Get coordinate of the left boundary. * * @return the left value */ @@ -48,7 +48,7 @@ public double left() { } /** - * Set the left value. + * Set coordinate of the left boundary. * * @param left the left value to set * @return the BoundingBox object itself. @@ -59,7 +59,7 @@ public BoundingBox withLeft(double left) { } /** - * Get the top value. + * Get coordinate of the top boundary. * * @return the top value */ @@ -68,7 +68,7 @@ public double top() { } /** - * Set the top value. + * Set coordinate of the top boundary. * * @param top the top value to set * @return the BoundingBox object itself. @@ -79,7 +79,7 @@ public BoundingBox withTop(double top) { } /** - * Get the width value. + * Get width. * * @return the width value */ @@ -88,7 +88,7 @@ public double width() { } /** - * Set the width value. + * Set width. * * @param width the width value to set * @return the BoundingBox object itself. @@ -99,7 +99,7 @@ public BoundingBox withWidth(double width) { } /** - * Get the height value. + * Get height. * * @return the height value */ @@ -108,7 +108,7 @@ public double height() { } /** - * Set the height value. + * Set height. * * @param height the height value to set * @return the BoundingBox object itself. diff --git a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/CustomVisionError.java b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/CustomVisionError.java new file mode 100644 index 000000000000..3159d194ebfe --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/CustomVisionError.java @@ -0,0 +1,127 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The CustomVisionError model. + */ +public class CustomVisionError { + /** + * Possible values include: 'NoError', 'BadRequest', + * 'BadRequestExceededBatchSize', 'BadRequestNotSupported', + * 'BadRequestInvalidIds', 'BadRequestProjectName', + * 'BadRequestProjectNameNotUnique', 'BadRequestProjectDescription', + * 'BadRequestProjectUnknownDomain', + * 'BadRequestProjectUnknownClassification', + * 'BadRequestProjectUnsupportedDomainTypeChange', + * 'BadRequestIterationName', 'BadRequestIterationNameNotUnique', + * 'BadRequestIterationDescription', 'BadRequestIterationIsNotTrained', + * 'BadRequestWorkspaceCannotBeModified', + * 'BadRequestWorkspaceNotDeletable', 'BadRequestTagName', + * 'BadRequestTagNameNotUnique', 'BadRequestTagDescription', + * 'BadRequestTagType', 'BadRequestMultipleNegativeTag', + * 'BadRequestImageTags', 'BadRequestImageRegions', + * 'BadRequestNegativeAndRegularTagOnSameImage', + * 'BadRequestIterationIsPublished', 'BadRequestInvalidPublishName', + * 'BadRequestSubscriptionApi', 'BadRequestPublishFailed', + * 'BadRequestUnpublishFailed', 'BadRequestExceedProjectLimit', + * 'BadRequestExceedIterationPerProjectLimit', + * 'BadRequestExceedTagPerProjectLimit', + * 'BadRequestExceedTagPerImageLimit', 'BadRequestExceededQuota', + * 'BadRequestCannotMigrateProjectWithName', 'BadRequestNotLimitedTrial', + * 'BadRequestImageBatch', 'BadRequestImageStream', 'BadRequestImageUrl', + * 'BadRequestImageFormat', 'BadRequestImageSizeBytes', + * 'BadRequestImageExceededCount', 'BadRequestTrainingNotNeeded', + * 'BadRequestTrainingValidationFailed', + * 'BadRequestClassificationTrainingValidationFailed', + * 'BadRequestMultiClassClassificationTrainingValidationFailed', + * 'BadRequestMultiLabelClassificationTrainingValidationFailed', + * 'BadRequestDetectionTrainingValidationFailed', + * 'BadRequestTrainingAlreadyInProgress', + * 'BadRequestExportValidationFailed', 'BadRequestExportAlreadyInProgress', + * 'BadRequestPredictionIdsMissing', + * 'BadRequestPredictionIdsExceededCount', + * 'BadRequestPredictionTagsExceededCount', + * 'BadRequestPredictionResultsExceededCount', + * 'BadRequestPredictionInvalidApplicationName', + * 'BadRequestPredictionInvalidQueryParameters', 'BadRequestInvalid', + * 'UnsupportedMediaType', 'Forbidden', 'ForbiddenUser', + * 'ForbiddenUserResource', 'ForbiddenUserSignupDisabled', + * 'ForbiddenUserSignupAllowanceExceeded', 'ForbiddenUserDoesNotExist', + * 'ForbiddenUserDisabled', 'ForbiddenUserInsufficientCapability', + * 'ForbiddenInvalid', 'NotFound', 'NotFoundProject', + * 'NotFoundProjectDefaultIteration', 'NotFoundIteration', + * 'NotFoundIterationPerformance', 'NotFoundTag', 'NotFoundImage', + * 'NotFoundDomain', 'NotFoundApimSubscription', 'NotFoundInvalid', + * 'Conflict', 'ConflictInvalid', 'ErrorUnknown', + * 'ErrorProjectInvalidWorkspace', + * 'ErrorProjectInvalidPipelineConfiguration', 'ErrorProjectInvalidDomain', + * 'ErrorProjectTrainingRequestFailed', 'ErrorProjectExportRequestFailed', + * 'ErrorFeaturizationServiceUnavailable', + * 'ErrorFeaturizationQueueTimeout', 'ErrorFeaturizationInvalidFeaturizer', + * 'ErrorFeaturizationAugmentationUnavailable', + * 'ErrorFeaturizationUnrecognizedJob', + * 'ErrorFeaturizationAugmentationError', 'ErrorExporterInvalidPlatform', + * 'ErrorExporterInvalidFeaturizer', 'ErrorExporterInvalidClassifier', + * 'ErrorPredictionServiceUnavailable', 'ErrorPredictionModelNotFound', + * 'ErrorPredictionModelNotCached', 'ErrorPrediction', + * 'ErrorPredictionStorage', 'ErrorRegionProposal', 'ErrorInvalid'. + */ + @JsonProperty(value = "code", required = true) + private String code; + + /** + * The message property. + */ + @JsonProperty(value = "message", required = true) + private String message; + + /** + * Get possible values include: 'NoError', 'BadRequest', 'BadRequestExceededBatchSize', 'BadRequestNotSupported', 'BadRequestInvalidIds', 'BadRequestProjectName', 'BadRequestProjectNameNotUnique', 'BadRequestProjectDescription', 'BadRequestProjectUnknownDomain', 'BadRequestProjectUnknownClassification', 'BadRequestProjectUnsupportedDomainTypeChange', 'BadRequestIterationName', 'BadRequestIterationNameNotUnique', 'BadRequestIterationDescription', 'BadRequestIterationIsNotTrained', 'BadRequestWorkspaceCannotBeModified', 'BadRequestWorkspaceNotDeletable', 'BadRequestTagName', 'BadRequestTagNameNotUnique', 'BadRequestTagDescription', 'BadRequestTagType', 'BadRequestMultipleNegativeTag', 'BadRequestImageTags', 'BadRequestImageRegions', 'BadRequestNegativeAndRegularTagOnSameImage', 'BadRequestIterationIsPublished', 'BadRequestInvalidPublishName', 'BadRequestSubscriptionApi', 'BadRequestPublishFailed', 'BadRequestUnpublishFailed', 'BadRequestExceedProjectLimit', 'BadRequestExceedIterationPerProjectLimit', 'BadRequestExceedTagPerProjectLimit', 'BadRequestExceedTagPerImageLimit', 'BadRequestExceededQuota', 'BadRequestCannotMigrateProjectWithName', 'BadRequestNotLimitedTrial', 'BadRequestImageBatch', 'BadRequestImageStream', 'BadRequestImageUrl', 'BadRequestImageFormat', 'BadRequestImageSizeBytes', 'BadRequestImageExceededCount', 'BadRequestTrainingNotNeeded', 'BadRequestTrainingValidationFailed', 'BadRequestClassificationTrainingValidationFailed', 'BadRequestMultiClassClassificationTrainingValidationFailed', 'BadRequestMultiLabelClassificationTrainingValidationFailed', 'BadRequestDetectionTrainingValidationFailed', 'BadRequestTrainingAlreadyInProgress', 'BadRequestExportValidationFailed', 'BadRequestExportAlreadyInProgress', 'BadRequestPredictionIdsMissing', 'BadRequestPredictionIdsExceededCount', 'BadRequestPredictionTagsExceededCount', 'BadRequestPredictionResultsExceededCount', 'BadRequestPredictionInvalidApplicationName', 'BadRequestPredictionInvalidQueryParameters', 'BadRequestInvalid', 'UnsupportedMediaType', 'Forbidden', 'ForbiddenUser', 'ForbiddenUserResource', 'ForbiddenUserSignupDisabled', 'ForbiddenUserSignupAllowanceExceeded', 'ForbiddenUserDoesNotExist', 'ForbiddenUserDisabled', 'ForbiddenUserInsufficientCapability', 'ForbiddenInvalid', 'NotFound', 'NotFoundProject', 'NotFoundProjectDefaultIteration', 'NotFoundIteration', 'NotFoundIterationPerformance', 'NotFoundTag', 'NotFoundImage', 'NotFoundDomain', 'NotFoundApimSubscription', 'NotFoundInvalid', 'Conflict', 'ConflictInvalid', 'ErrorUnknown', 'ErrorProjectInvalidWorkspace', 'ErrorProjectInvalidPipelineConfiguration', 'ErrorProjectInvalidDomain', 'ErrorProjectTrainingRequestFailed', 'ErrorProjectExportRequestFailed', 'ErrorFeaturizationServiceUnavailable', 'ErrorFeaturizationQueueTimeout', 'ErrorFeaturizationInvalidFeaturizer', 'ErrorFeaturizationAugmentationUnavailable', 'ErrorFeaturizationUnrecognizedJob', 'ErrorFeaturizationAugmentationError', 'ErrorExporterInvalidPlatform', 'ErrorExporterInvalidFeaturizer', 'ErrorExporterInvalidClassifier', 'ErrorPredictionServiceUnavailable', 'ErrorPredictionModelNotFound', 'ErrorPredictionModelNotCached', 'ErrorPrediction', 'ErrorPredictionStorage', 'ErrorRegionProposal', 'ErrorInvalid'. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set possible values include: 'NoError', 'BadRequest', 'BadRequestExceededBatchSize', 'BadRequestNotSupported', 'BadRequestInvalidIds', 'BadRequestProjectName', 'BadRequestProjectNameNotUnique', 'BadRequestProjectDescription', 'BadRequestProjectUnknownDomain', 'BadRequestProjectUnknownClassification', 'BadRequestProjectUnsupportedDomainTypeChange', 'BadRequestIterationName', 'BadRequestIterationNameNotUnique', 'BadRequestIterationDescription', 'BadRequestIterationIsNotTrained', 'BadRequestWorkspaceCannotBeModified', 'BadRequestWorkspaceNotDeletable', 'BadRequestTagName', 'BadRequestTagNameNotUnique', 'BadRequestTagDescription', 'BadRequestTagType', 'BadRequestMultipleNegativeTag', 'BadRequestImageTags', 'BadRequestImageRegions', 'BadRequestNegativeAndRegularTagOnSameImage', 'BadRequestIterationIsPublished', 'BadRequestInvalidPublishName', 'BadRequestSubscriptionApi', 'BadRequestPublishFailed', 'BadRequestUnpublishFailed', 'BadRequestExceedProjectLimit', 'BadRequestExceedIterationPerProjectLimit', 'BadRequestExceedTagPerProjectLimit', 'BadRequestExceedTagPerImageLimit', 'BadRequestExceededQuota', 'BadRequestCannotMigrateProjectWithName', 'BadRequestNotLimitedTrial', 'BadRequestImageBatch', 'BadRequestImageStream', 'BadRequestImageUrl', 'BadRequestImageFormat', 'BadRequestImageSizeBytes', 'BadRequestImageExceededCount', 'BadRequestTrainingNotNeeded', 'BadRequestTrainingValidationFailed', 'BadRequestClassificationTrainingValidationFailed', 'BadRequestMultiClassClassificationTrainingValidationFailed', 'BadRequestMultiLabelClassificationTrainingValidationFailed', 'BadRequestDetectionTrainingValidationFailed', 'BadRequestTrainingAlreadyInProgress', 'BadRequestExportValidationFailed', 'BadRequestExportAlreadyInProgress', 'BadRequestPredictionIdsMissing', 'BadRequestPredictionIdsExceededCount', 'BadRequestPredictionTagsExceededCount', 'BadRequestPredictionResultsExceededCount', 'BadRequestPredictionInvalidApplicationName', 'BadRequestPredictionInvalidQueryParameters', 'BadRequestInvalid', 'UnsupportedMediaType', 'Forbidden', 'ForbiddenUser', 'ForbiddenUserResource', 'ForbiddenUserSignupDisabled', 'ForbiddenUserSignupAllowanceExceeded', 'ForbiddenUserDoesNotExist', 'ForbiddenUserDisabled', 'ForbiddenUserInsufficientCapability', 'ForbiddenInvalid', 'NotFound', 'NotFoundProject', 'NotFoundProjectDefaultIteration', 'NotFoundIteration', 'NotFoundIterationPerformance', 'NotFoundTag', 'NotFoundImage', 'NotFoundDomain', 'NotFoundApimSubscription', 'NotFoundInvalid', 'Conflict', 'ConflictInvalid', 'ErrorUnknown', 'ErrorProjectInvalidWorkspace', 'ErrorProjectInvalidPipelineConfiguration', 'ErrorProjectInvalidDomain', 'ErrorProjectTrainingRequestFailed', 'ErrorProjectExportRequestFailed', 'ErrorFeaturizationServiceUnavailable', 'ErrorFeaturizationQueueTimeout', 'ErrorFeaturizationInvalidFeaturizer', 'ErrorFeaturizationAugmentationUnavailable', 'ErrorFeaturizationUnrecognizedJob', 'ErrorFeaturizationAugmentationError', 'ErrorExporterInvalidPlatform', 'ErrorExporterInvalidFeaturizer', 'ErrorExporterInvalidClassifier', 'ErrorPredictionServiceUnavailable', 'ErrorPredictionModelNotFound', 'ErrorPredictionModelNotCached', 'ErrorPrediction', 'ErrorPredictionStorage', 'ErrorRegionProposal', 'ErrorInvalid'. + * + * @param code the code value to set + * @return the CustomVisionError object itself. + */ + public CustomVisionError withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the CustomVisionError object itself. + */ + public CustomVisionError withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/CustomVisionErrorException.java b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/CustomVisionErrorException.java new file mode 100644 index 000000000000..83643e572167 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/CustomVisionErrorException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with CustomVisionError information. + */ +public class CustomVisionErrorException extends RestException { + /** + * Initializes a new instance of the CustomVisionErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public CustomVisionErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the CustomVisionErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public CustomVisionErrorException(final String message, final Response response, final CustomVisionError body) { + super(message, response, body); + } + + @Override + public CustomVisionError body() { + return (CustomVisionError) super.body(); + } +} diff --git a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ImagePrediction.java b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ImagePrediction.java index 728d0f28c449..89c0e7ee75ac 100644 --- a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ImagePrediction.java +++ b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ImagePrediction.java @@ -14,41 +14,41 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The ImagePrediction model. + * Result of an image prediction request. */ public class ImagePrediction { /** - * The id property. + * Prediction Id. */ @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private UUID id; /** - * The project property. + * Project Id. */ @JsonProperty(value = "project", access = JsonProperty.Access.WRITE_ONLY) private UUID project; /** - * The iteration property. + * Iteration Id. */ @JsonProperty(value = "iteration", access = JsonProperty.Access.WRITE_ONLY) private UUID iteration; /** - * The created property. + * Date this prediction was created. */ @JsonProperty(value = "created", access = JsonProperty.Access.WRITE_ONLY) private DateTime created; /** - * The predictions property. + * List of predictions. */ @JsonProperty(value = "predictions", access = JsonProperty.Access.WRITE_ONLY) private List predictions; /** - * Get the id value. + * Get prediction Id. * * @return the id value */ @@ -57,7 +57,7 @@ public UUID id() { } /** - * Get the project value. + * Get project Id. * * @return the project value */ @@ -66,7 +66,7 @@ public UUID project() { } /** - * Get the iteration value. + * Get iteration Id. * * @return the iteration value */ @@ -75,7 +75,7 @@ public UUID iteration() { } /** - * Get the created value. + * Get date this prediction was created. * * @return the created value */ @@ -84,7 +84,7 @@ public DateTime created() { } /** - * Get the predictions value. + * Get list of predictions. * * @return the predictions value */ diff --git a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ImageUrl.java b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ImageUrl.java index 079b6e21446e..4c35d90fb0d7 100644 --- a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ImageUrl.java +++ b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ImageUrl.java @@ -11,17 +11,17 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The ImageUrl model. + * Image url. */ public class ImageUrl { /** - * The url property. + * Url of the image. */ @JsonProperty(value = "url") private String url; /** - * Get the url value. + * Get url of the image. * * @return the url value */ @@ -30,7 +30,7 @@ public String url() { } /** - * Set the url value. + * Set url of the image. * * @param url the url value to set * @return the ImageUrl object itself. diff --git a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/Prediction.java b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/Prediction.java index 1735949fc348..b01d12e4a2ba 100644 --- a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/Prediction.java +++ b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/Prediction.java @@ -12,35 +12,35 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The Prediction model. + * Prediction result. */ public class Prediction { /** - * The probability property. + * Probability of the tag. */ @JsonProperty(value = "probability", access = JsonProperty.Access.WRITE_ONLY) private double probability; /** - * The tagId property. + * Id of the predicted tag. */ @JsonProperty(value = "tagId", access = JsonProperty.Access.WRITE_ONLY) private UUID tagId; /** - * The tagName property. + * Name of the predicted tag. */ @JsonProperty(value = "tagName", access = JsonProperty.Access.WRITE_ONLY) private String tagName; /** - * The boundingBox property. + * Bounding box of the prediction. */ @JsonProperty(value = "boundingBox", access = JsonProperty.Access.WRITE_ONLY) private BoundingBox boundingBox; /** - * Get the probability value. + * Get probability of the tag. * * @return the probability value */ @@ -49,7 +49,7 @@ public double probability() { } /** - * Get the tagId value. + * Get id of the predicted tag. * * @return the tagId value */ @@ -58,7 +58,7 @@ public UUID tagId() { } /** - * Get the tagName value. + * Get name of the predicted tag. * * @return the tagName value */ @@ -67,7 +67,7 @@ public String tagName() { } /** - * Get the boundingBox value. + * Get bounding box of the prediction. * * @return the boundingBox value */ diff --git a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/package-info.java b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/package-info.java index 3a76c984fb2a..fa3b8487472b 100644 --- a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/package-info.java +++ b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/package-info.java @@ -5,6 +5,6 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * This package contains the models classes for PredictionEndpoint. + * This package contains the models classes for CustomVisionPredictionClient. */ package com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models; diff --git a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/package-info.java b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/package-info.java index b44683ce86ed..f90bebdd2fef 100644 --- a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/package-info.java +++ b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/package-info.java @@ -5,6 +5,6 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * This package contains the classes for PredictionEndpoint. + * This package contains the classes for CustomVisionPredictionClient. */ package com.microsoft.azure.cognitiveservices.vision.customvision.prediction; diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/CustomVisionTrainingClient.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/CustomVisionTrainingClient.java new file mode 100644 index 000000000000..6e56a033a338 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/CustomVisionTrainingClient.java @@ -0,0 +1,2905 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.cognitiveservices.vision.customvision.training; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.Domain; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.Export; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.Image; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageCreateSummary; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageFileCreateBatch; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageIdCreateBatch; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImagePerformance; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImagePrediction; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageRegionCreateEntry; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageRegionCreateSummary; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageRegionProposal; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageTagCreateEntry; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageTagCreateSummary; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageUrlCreateBatch; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.Iteration; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.IterationPerformance; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.PredictionQueryResult; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.PredictionQueryToken; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.Project; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.Tag; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import java.util.UUID; +import rx.Observable; + +/** + * The interface for CustomVisionTrainingClient class. + */ +public interface CustomVisionTrainingClient { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + AzureClient getAzureClient(); + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + String userAgent(); + + /** + * Gets . + * + * @return the apiKey value. + */ + String apiKey(); + + /** + * Sets . + * + * @param apiKey the apiKey value. + * @return the service client itself + */ + CustomVisionTrainingClient withApiKey(String apiKey); + + /** + * Gets Supported Cognitive Services endpoints. + * + * @return the endpoint value. + */ + String endpoint(); + + /** + * Sets Supported Cognitive Services endpoints. + * + * @param endpoint the endpoint value. + * @return the service client itself + */ + CustomVisionTrainingClient withEndpoint(String endpoint); + + /** + * Gets The preferred language for the response.. + * + * @return the acceptLanguage value. + */ + String acceptLanguage(); + + /** + * Sets The preferred language for the response.. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + CustomVisionTrainingClient withAcceptLanguage(String acceptLanguage); + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @return the longRunningOperationRetryTimeout value. + */ + int longRunningOperationRetryTimeout(); + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + CustomVisionTrainingClient withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout); + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @return the generateClientRequestId value. + */ + boolean generateClientRequestId(); + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + CustomVisionTrainingClient withGenerateClientRequestId(boolean generateClientRequestId); + + /** + * Get a list of the available domains. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Domain> object if successful. + */ + List getDomains(); + + /** + * Get a list of the available domains. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDomainsAsync(final ServiceCallback> serviceCallback); + + /** + * Get a list of the available domains. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Domain> object + */ + Observable> getDomainsAsync(); + + /** + * Get a list of the available domains. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Domain> object + */ + Observable>> getDomainsWithServiceResponseAsync(); + + /** + * Get information about a specific domain. + * + * @param domainId The id of the domain to get information about. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Domain object if successful. + */ + Domain getDomain(UUID domainId); + + /** + * Get information about a specific domain. + * + * @param domainId The id of the domain to get information about. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getDomainAsync(UUID domainId, final ServiceCallback serviceCallback); + + /** + * Get information about a specific domain. + * + * @param domainId The id of the domain to get information about. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Domain object + */ + Observable getDomainAsync(UUID domainId); + + /** + * Get information about a specific domain. + * + * @param domainId The id of the domain to get information about. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Domain object + */ + Observable> getDomainWithServiceResponseAsync(UUID domainId); + + /** + * Gets the number of images tagged with the provided {tagIds}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the int object if successful. + */ + int getTaggedImageCount(UUID projectId); + + /** + * Gets the number of images tagged with the provided {tagIds}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getTaggedImageCountAsync(UUID projectId, final ServiceCallback serviceCallback); + + /** + * Gets the number of images tagged with the provided {tagIds}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the int object + */ + Observable getTaggedImageCountAsync(UUID projectId); + + /** + * Gets the number of images tagged with the provided {tagIds}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the int object + */ + Observable> getTaggedImageCountWithServiceResponseAsync(UUID projectId); + /** + * Gets the number of images tagged with the provided {tagIds}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images to count. Defaults to all tags when null. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the int object if successful. + */ + int getTaggedImageCount(UUID projectId, UUID iterationId, List tagIds); + + /** + * Gets the number of images tagged with the provided {tagIds}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images to count. Defaults to all tags when null. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getTaggedImageCountAsync(UUID projectId, UUID iterationId, List tagIds, final ServiceCallback serviceCallback); + + /** + * Gets the number of images tagged with the provided {tagIds}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images to count. Defaults to all tags when null. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the int object + */ + Observable getTaggedImageCountAsync(UUID projectId, UUID iterationId, List tagIds); + + /** + * Gets the number of images tagged with the provided {tagIds}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images to count. Defaults to all tags when null. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the int object + */ + Observable> getTaggedImageCountWithServiceResponseAsync(UUID projectId, UUID iterationId, List tagIds); + + /** + * Gets the number of untagged images. + * This API returns the images which have no tags for a given project and optionally an iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the int object if successful. + */ + int getUntaggedImageCount(UUID projectId); + + /** + * Gets the number of untagged images. + * This API returns the images which have no tags for a given project and optionally an iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getUntaggedImageCountAsync(UUID projectId, final ServiceCallback serviceCallback); + + /** + * Gets the number of untagged images. + * This API returns the images which have no tags for a given project and optionally an iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the int object + */ + Observable getUntaggedImageCountAsync(UUID projectId); + + /** + * Gets the number of untagged images. + * This API returns the images which have no tags for a given project and optionally an iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the int object + */ + Observable> getUntaggedImageCountWithServiceResponseAsync(UUID projectId); + /** + * Gets the number of untagged images. + * This API returns the images which have no tags for a given project and optionally an iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the int object if successful. + */ + int getUntaggedImageCount(UUID projectId, UUID iterationId); + + /** + * Gets the number of untagged images. + * This API returns the images which have no tags for a given project and optionally an iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getUntaggedImageCountAsync(UUID projectId, UUID iterationId, final ServiceCallback serviceCallback); + + /** + * Gets the number of untagged images. + * This API returns the images which have no tags for a given project and optionally an iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the int object + */ + Observable getUntaggedImageCountAsync(UUID projectId, UUID iterationId); + + /** + * Gets the number of untagged images. + * This API returns the images which have no tags for a given project and optionally an iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the int object + */ + Observable> getUntaggedImageCountWithServiceResponseAsync(UUID projectId, UUID iterationId); + + /** + * Associate a set of images with a set of tags. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageTagCreateSummary object if successful. + */ + ImageTagCreateSummary createImageTags(UUID projectId); + + /** + * Associate a set of images with a set of tags. + * + * @param projectId The project id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture createImageTagsAsync(UUID projectId, final ServiceCallback serviceCallback); + + /** + * Associate a set of images with a set of tags. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageTagCreateSummary object + */ + Observable createImageTagsAsync(UUID projectId); + + /** + * Associate a set of images with a set of tags. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageTagCreateSummary object + */ + Observable> createImageTagsWithServiceResponseAsync(UUID projectId); + /** + * Associate a set of images with a set of tags. + * + * @param projectId The project id. + * @param tags Image Tag entries to include in this batch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageTagCreateSummary object if successful. + */ + ImageTagCreateSummary createImageTags(UUID projectId, List tags); + + /** + * Associate a set of images with a set of tags. + * + * @param projectId The project id. + * @param tags Image Tag entries to include in this batch. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture createImageTagsAsync(UUID projectId, List tags, final ServiceCallback serviceCallback); + + /** + * Associate a set of images with a set of tags. + * + * @param projectId The project id. + * @param tags Image Tag entries to include in this batch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageTagCreateSummary object + */ + Observable createImageTagsAsync(UUID projectId, List tags); + + /** + * Associate a set of images with a set of tags. + * + * @param projectId The project id. + * @param tags Image Tag entries to include in this batch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageTagCreateSummary object + */ + Observable> createImageTagsWithServiceResponseAsync(UUID projectId, List tags); + + /** + * Remove a set of tags from a set of images. + * + * @param projectId The project id. + * @param imageIds Image ids. Limited to 64 images. + * @param tagIds Tags to be deleted from the specified images. Limited to 20 tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void deleteImageTags(UUID projectId, List imageIds, List tagIds); + + /** + * Remove a set of tags from a set of images. + * + * @param projectId The project id. + * @param imageIds Image ids. Limited to 64 images. + * @param tagIds Tags to be deleted from the specified images. Limited to 20 tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteImageTagsAsync(UUID projectId, List imageIds, List tagIds, final ServiceCallback serviceCallback); + + /** + * Remove a set of tags from a set of images. + * + * @param projectId The project id. + * @param imageIds Image ids. Limited to 64 images. + * @param tagIds Tags to be deleted from the specified images. Limited to 20 tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable deleteImageTagsAsync(UUID projectId, List imageIds, List tagIds); + + /** + * Remove a set of tags from a set of images. + * + * @param projectId The project id. + * @param imageIds Image ids. Limited to 64 images. + * @param tagIds Tags to be deleted from the specified images. Limited to 20 tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> deleteImageTagsWithServiceResponseAsync(UUID projectId, List imageIds, List tagIds); + + /** + * Create a set of image regions. + * This API accepts a batch of image regions, and optionally tags, to update existing images with region information. + There is a limit of 64 entries in the batch. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageRegionCreateSummary object if successful. + */ + ImageRegionCreateSummary createImageRegions(UUID projectId); + + /** + * Create a set of image regions. + * This API accepts a batch of image regions, and optionally tags, to update existing images with region information. + There is a limit of 64 entries in the batch. + * + * @param projectId The project id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture createImageRegionsAsync(UUID projectId, final ServiceCallback serviceCallback); + + /** + * Create a set of image regions. + * This API accepts a batch of image regions, and optionally tags, to update existing images with region information. + There is a limit of 64 entries in the batch. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageRegionCreateSummary object + */ + Observable createImageRegionsAsync(UUID projectId); + + /** + * Create a set of image regions. + * This API accepts a batch of image regions, and optionally tags, to update existing images with region information. + There is a limit of 64 entries in the batch. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageRegionCreateSummary object + */ + Observable> createImageRegionsWithServiceResponseAsync(UUID projectId); + /** + * Create a set of image regions. + * This API accepts a batch of image regions, and optionally tags, to update existing images with region information. + There is a limit of 64 entries in the batch. + * + * @param projectId The project id. + * @param regions the List<ImageRegionCreateEntry> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageRegionCreateSummary object if successful. + */ + ImageRegionCreateSummary createImageRegions(UUID projectId, List regions); + + /** + * Create a set of image regions. + * This API accepts a batch of image regions, and optionally tags, to update existing images with region information. + There is a limit of 64 entries in the batch. + * + * @param projectId The project id. + * @param regions the List<ImageRegionCreateEntry> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture createImageRegionsAsync(UUID projectId, List regions, final ServiceCallback serviceCallback); + + /** + * Create a set of image regions. + * This API accepts a batch of image regions, and optionally tags, to update existing images with region information. + There is a limit of 64 entries in the batch. + * + * @param projectId The project id. + * @param regions the List<ImageRegionCreateEntry> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageRegionCreateSummary object + */ + Observable createImageRegionsAsync(UUID projectId, List regions); + + /** + * Create a set of image regions. + * This API accepts a batch of image regions, and optionally tags, to update existing images with region information. + There is a limit of 64 entries in the batch. + * + * @param projectId The project id. + * @param regions the List<ImageRegionCreateEntry> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageRegionCreateSummary object + */ + Observable> createImageRegionsWithServiceResponseAsync(UUID projectId, List regions); + + /** + * Delete a set of image regions. + * + * @param projectId The project id. + * @param regionIds Regions to delete. Limited to 64. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void deleteImageRegions(UUID projectId, List regionIds); + + /** + * Delete a set of image regions. + * + * @param projectId The project id. + * @param regionIds Regions to delete. Limited to 64. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteImageRegionsAsync(UUID projectId, List regionIds, final ServiceCallback serviceCallback); + + /** + * Delete a set of image regions. + * + * @param projectId The project id. + * @param regionIds Regions to delete. Limited to 64. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable deleteImageRegionsAsync(UUID projectId, List regionIds); + + /** + * Delete a set of image regions. + * + * @param projectId The project id. + * @param regionIds Regions to delete. Limited to 64. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> deleteImageRegionsWithServiceResponseAsync(UUID projectId, List regionIds); + + /** + * Get tagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Image> object if successful. + */ + List getTaggedImages(UUID projectId); + + /** + * Get tagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getTaggedImagesAsync(UUID projectId, final ServiceCallback> serviceCallback); + + /** + * Get tagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Image> object + */ + Observable> getTaggedImagesAsync(UUID projectId); + + /** + * Get tagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Image> object + */ + Observable>> getTaggedImagesWithServiceResponseAsync(UUID projectId); + /** + * Get tagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images. Defaults to all tagged images when null. Limited to 20. + * @param orderBy The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest' + * @param take Maximum number of images to return. Defaults to 50, limited to 256. + * @param skip Number of images to skip before beginning the image batch. Defaults to 0. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Image> object if successful. + */ + List getTaggedImages(UUID projectId, UUID iterationId, List tagIds, String orderBy, Integer take, Integer skip); + + /** + * Get tagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images. Defaults to all tagged images when null. Limited to 20. + * @param orderBy The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest' + * @param take Maximum number of images to return. Defaults to 50, limited to 256. + * @param skip Number of images to skip before beginning the image batch. Defaults to 0. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getTaggedImagesAsync(UUID projectId, UUID iterationId, List tagIds, String orderBy, Integer take, Integer skip, final ServiceCallback> serviceCallback); + + /** + * Get tagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images. Defaults to all tagged images when null. Limited to 20. + * @param orderBy The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest' + * @param take Maximum number of images to return. Defaults to 50, limited to 256. + * @param skip Number of images to skip before beginning the image batch. Defaults to 0. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Image> object + */ + Observable> getTaggedImagesAsync(UUID projectId, UUID iterationId, List tagIds, String orderBy, Integer take, Integer skip); + + /** + * Get tagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images. Defaults to all tagged images when null. Limited to 20. + * @param orderBy The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest' + * @param take Maximum number of images to return. Defaults to 50, limited to 256. + * @param skip Number of images to skip before beginning the image batch. Defaults to 0. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Image> object + */ + Observable>> getTaggedImagesWithServiceResponseAsync(UUID projectId, UUID iterationId, List tagIds, String orderBy, Integer take, Integer skip); + + /** + * Get untagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Image> object if successful. + */ + List getUntaggedImages(UUID projectId); + + /** + * Get untagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + * + * @param projectId The project id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getUntaggedImagesAsync(UUID projectId, final ServiceCallback> serviceCallback); + + /** + * Get untagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Image> object + */ + Observable> getUntaggedImagesAsync(UUID projectId); + + /** + * Get untagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Image> object + */ + Observable>> getUntaggedImagesWithServiceResponseAsync(UUID projectId); + /** + * Get untagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param orderBy The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest' + * @param take Maximum number of images to return. Defaults to 50, limited to 256. + * @param skip Number of images to skip before beginning the image batch. Defaults to 0. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Image> object if successful. + */ + List getUntaggedImages(UUID projectId, UUID iterationId, String orderBy, Integer take, Integer skip); + + /** + * Get untagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param orderBy The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest' + * @param take Maximum number of images to return. Defaults to 50, limited to 256. + * @param skip Number of images to skip before beginning the image batch. Defaults to 0. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getUntaggedImagesAsync(UUID projectId, UUID iterationId, String orderBy, Integer take, Integer skip, final ServiceCallback> serviceCallback); + + /** + * Get untagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param orderBy The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest' + * @param take Maximum number of images to return. Defaults to 50, limited to 256. + * @param skip Number of images to skip before beginning the image batch. Defaults to 0. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Image> object + */ + Observable> getUntaggedImagesAsync(UUID projectId, UUID iterationId, String orderBy, Integer take, Integer skip); + + /** + * Get untagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param orderBy The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest' + * @param take Maximum number of images to return. Defaults to 50, limited to 256. + * @param skip Number of images to skip before beginning the image batch. Defaults to 0. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Image> object + */ + Observable>> getUntaggedImagesWithServiceResponseAsync(UUID projectId, UUID iterationId, String orderBy, Integer take, Integer skip); + + /** + * Get images by id for a given project iteration. + * This API will return a set of Images for the specified tags and optionally iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Image> object if successful. + */ + List getImagesByIds(UUID projectId); + + /** + * Get images by id for a given project iteration. + * This API will return a set of Images for the specified tags and optionally iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getImagesByIdsAsync(UUID projectId, final ServiceCallback> serviceCallback); + + /** + * Get images by id for a given project iteration. + * This API will return a set of Images for the specified tags and optionally iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Image> object + */ + Observable> getImagesByIdsAsync(UUID projectId); + + /** + * Get images by id for a given project iteration. + * This API will return a set of Images for the specified tags and optionally iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Image> object + */ + Observable>> getImagesByIdsWithServiceResponseAsync(UUID projectId); + /** + * Get images by id for a given project iteration. + * This API will return a set of Images for the specified tags and optionally iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @param imageIds The list of image ids to retrieve. Limited to 256. + * @param iterationId The iteration id. Defaults to workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Image> object if successful. + */ + List getImagesByIds(UUID projectId, List imageIds, UUID iterationId); + + /** + * Get images by id for a given project iteration. + * This API will return a set of Images for the specified tags and optionally iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @param imageIds The list of image ids to retrieve. Limited to 256. + * @param iterationId The iteration id. Defaults to workspace. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getImagesByIdsAsync(UUID projectId, List imageIds, UUID iterationId, final ServiceCallback> serviceCallback); + + /** + * Get images by id for a given project iteration. + * This API will return a set of Images for the specified tags and optionally iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @param imageIds The list of image ids to retrieve. Limited to 256. + * @param iterationId The iteration id. Defaults to workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Image> object + */ + Observable> getImagesByIdsAsync(UUID projectId, List imageIds, UUID iterationId); + + /** + * Get images by id for a given project iteration. + * This API will return a set of Images for the specified tags and optionally iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @param imageIds The list of image ids to retrieve. Limited to 256. + * @param iterationId The iteration id. Defaults to workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Image> object + */ + Observable>> getImagesByIdsWithServiceResponseAsync(UUID projectId, List imageIds, UUID iterationId); + + /** + * Add the provided images to the set of training images. + * This API accepts body content as multipart/form-data and application/octet-stream. When using multipart + multiple image files can be sent at once, with a maximum of 64 files. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageCreateSummary object if successful. + */ + ImageCreateSummary createImagesFromData(UUID projectId, byte[] imageData); + + /** + * Add the provided images to the set of training images. + * This API accepts body content as multipart/form-data and application/octet-stream. When using multipart + multiple image files can be sent at once, with a maximum of 64 files. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture createImagesFromDataAsync(UUID projectId, byte[] imageData, final ServiceCallback serviceCallback); + + /** + * Add the provided images to the set of training images. + * This API accepts body content as multipart/form-data and application/octet-stream. When using multipart + multiple image files can be sent at once, with a maximum of 64 files. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageCreateSummary object + */ + Observable createImagesFromDataAsync(UUID projectId, byte[] imageData); + + /** + * Add the provided images to the set of training images. + * This API accepts body content as multipart/form-data and application/octet-stream. When using multipart + multiple image files can be sent at once, with a maximum of 64 files. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageCreateSummary object + */ + Observable> createImagesFromDataWithServiceResponseAsync(UUID projectId, byte[] imageData); + /** + * Add the provided images to the set of training images. + * This API accepts body content as multipart/form-data and application/octet-stream. When using multipart + multiple image files can be sent at once, with a maximum of 64 files. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @param tagIds The tags ids with which to tag each image. Limited to 20. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageCreateSummary object if successful. + */ + ImageCreateSummary createImagesFromData(UUID projectId, byte[] imageData, List tagIds); + + /** + * Add the provided images to the set of training images. + * This API accepts body content as multipart/form-data and application/octet-stream. When using multipart + multiple image files can be sent at once, with a maximum of 64 files. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @param tagIds The tags ids with which to tag each image. Limited to 20. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture createImagesFromDataAsync(UUID projectId, byte[] imageData, List tagIds, final ServiceCallback serviceCallback); + + /** + * Add the provided images to the set of training images. + * This API accepts body content as multipart/form-data and application/octet-stream. When using multipart + multiple image files can be sent at once, with a maximum of 64 files. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @param tagIds The tags ids with which to tag each image. Limited to 20. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageCreateSummary object + */ + Observable createImagesFromDataAsync(UUID projectId, byte[] imageData, List tagIds); + + /** + * Add the provided images to the set of training images. + * This API accepts body content as multipart/form-data and application/octet-stream. When using multipart + multiple image files can be sent at once, with a maximum of 64 files. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @param tagIds The tags ids with which to tag each image. Limited to 20. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageCreateSummary object + */ + Observable> createImagesFromDataWithServiceResponseAsync(UUID projectId, byte[] imageData, List tagIds); + + /** + * Delete images from the set of training images. + * + * @param projectId The project id. + * @param imageIds Ids of the images to be deleted. Limited to 256 images per batch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void deleteImages(UUID projectId, List imageIds); + + /** + * Delete images from the set of training images. + * + * @param projectId The project id. + * @param imageIds Ids of the images to be deleted. Limited to 256 images per batch. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteImagesAsync(UUID projectId, List imageIds, final ServiceCallback serviceCallback); + + /** + * Delete images from the set of training images. + * + * @param projectId The project id. + * @param imageIds Ids of the images to be deleted. Limited to 256 images per batch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable deleteImagesAsync(UUID projectId, List imageIds); + + /** + * Delete images from the set of training images. + * + * @param projectId The project id. + * @param imageIds Ids of the images to be deleted. Limited to 256 images per batch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> deleteImagesWithServiceResponseAsync(UUID projectId, List imageIds); + + /** + * Add the provided batch of images to the set of training images. + * This API accepts a batch of files, and optionally tags, to create images. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id. + * @param batch The batch of image files to add. Limited to 64 images and 20 tags per batch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageCreateSummary object if successful. + */ + ImageCreateSummary createImagesFromFiles(UUID projectId, ImageFileCreateBatch batch); + + /** + * Add the provided batch of images to the set of training images. + * This API accepts a batch of files, and optionally tags, to create images. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id. + * @param batch The batch of image files to add. Limited to 64 images and 20 tags per batch. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture createImagesFromFilesAsync(UUID projectId, ImageFileCreateBatch batch, final ServiceCallback serviceCallback); + + /** + * Add the provided batch of images to the set of training images. + * This API accepts a batch of files, and optionally tags, to create images. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id. + * @param batch The batch of image files to add. Limited to 64 images and 20 tags per batch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageCreateSummary object + */ + Observable createImagesFromFilesAsync(UUID projectId, ImageFileCreateBatch batch); + + /** + * Add the provided batch of images to the set of training images. + * This API accepts a batch of files, and optionally tags, to create images. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id. + * @param batch The batch of image files to add. Limited to 64 images and 20 tags per batch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageCreateSummary object + */ + Observable> createImagesFromFilesWithServiceResponseAsync(UUID projectId, ImageFileCreateBatch batch); + + /** + * Add the provided images urls to the set of training images. + * This API accepts a batch of urls, and optionally tags, to create images. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id. + * @param batch Image urls and tag ids. Limited to 64 images and 20 tags per batch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageCreateSummary object if successful. + */ + ImageCreateSummary createImagesFromUrls(UUID projectId, ImageUrlCreateBatch batch); + + /** + * Add the provided images urls to the set of training images. + * This API accepts a batch of urls, and optionally tags, to create images. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id. + * @param batch Image urls and tag ids. Limited to 64 images and 20 tags per batch. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture createImagesFromUrlsAsync(UUID projectId, ImageUrlCreateBatch batch, final ServiceCallback serviceCallback); + + /** + * Add the provided images urls to the set of training images. + * This API accepts a batch of urls, and optionally tags, to create images. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id. + * @param batch Image urls and tag ids. Limited to 64 images and 20 tags per batch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageCreateSummary object + */ + Observable createImagesFromUrlsAsync(UUID projectId, ImageUrlCreateBatch batch); + + /** + * Add the provided images urls to the set of training images. + * This API accepts a batch of urls, and optionally tags, to create images. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id. + * @param batch Image urls and tag ids. Limited to 64 images and 20 tags per batch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageCreateSummary object + */ + Observable> createImagesFromUrlsWithServiceResponseAsync(UUID projectId, ImageUrlCreateBatch batch); + + /** + * Add the specified predicted images to the set of training images. + * This API creates a batch of images from predicted images specified. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id. + * @param batch Image and tag ids. Limited to 64 images and 20 tags per batch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageCreateSummary object if successful. + */ + ImageCreateSummary createImagesFromPredictions(UUID projectId, ImageIdCreateBatch batch); + + /** + * Add the specified predicted images to the set of training images. + * This API creates a batch of images from predicted images specified. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id. + * @param batch Image and tag ids. Limited to 64 images and 20 tags per batch. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture createImagesFromPredictionsAsync(UUID projectId, ImageIdCreateBatch batch, final ServiceCallback serviceCallback); + + /** + * Add the specified predicted images to the set of training images. + * This API creates a batch of images from predicted images specified. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id. + * @param batch Image and tag ids. Limited to 64 images and 20 tags per batch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageCreateSummary object + */ + Observable createImagesFromPredictionsAsync(UUID projectId, ImageIdCreateBatch batch); + + /** + * Add the specified predicted images to the set of training images. + * This API creates a batch of images from predicted images specified. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id. + * @param batch Image and tag ids. Limited to 64 images and 20 tags per batch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageCreateSummary object + */ + Observable> createImagesFromPredictionsWithServiceResponseAsync(UUID projectId, ImageIdCreateBatch batch); + + /** + * Get region proposals for an image. Returns empty array if no proposals are found. + * This API will get region proposals for an image along with confidences for the region. It returns an empty array if no proposals are found. + * + * @param projectId The project id. + * @param imageId The image id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageRegionProposal object if successful. + */ + ImageRegionProposal getImageRegionProposals(UUID projectId, UUID imageId); + + /** + * Get region proposals for an image. Returns empty array if no proposals are found. + * This API will get region proposals for an image along with confidences for the region. It returns an empty array if no proposals are found. + * + * @param projectId The project id. + * @param imageId The image id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getImageRegionProposalsAsync(UUID projectId, UUID imageId, final ServiceCallback serviceCallback); + + /** + * Get region proposals for an image. Returns empty array if no proposals are found. + * This API will get region proposals for an image along with confidences for the region. It returns an empty array if no proposals are found. + * + * @param projectId The project id. + * @param imageId The image id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageRegionProposal object + */ + Observable getImageRegionProposalsAsync(UUID projectId, UUID imageId); + + /** + * Get region proposals for an image. Returns empty array if no proposals are found. + * This API will get region proposals for an image along with confidences for the region. It returns an empty array if no proposals are found. + * + * @param projectId The project id. + * @param imageId The image id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageRegionProposal object + */ + Observable> getImageRegionProposalsWithServiceResponseAsync(UUID projectId, UUID imageId); + + /** + * Delete a set of predicted images and their associated prediction results. + * + * @param projectId The project id. + * @param ids The prediction ids. Limited to 64. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void deletePrediction(UUID projectId, List ids); + + /** + * Delete a set of predicted images and their associated prediction results. + * + * @param projectId The project id. + * @param ids The prediction ids. Limited to 64. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deletePredictionAsync(UUID projectId, List ids, final ServiceCallback serviceCallback); + + /** + * Delete a set of predicted images and their associated prediction results. + * + * @param projectId The project id. + * @param ids The prediction ids. Limited to 64. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable deletePredictionAsync(UUID projectId, List ids); + + /** + * Delete a set of predicted images and their associated prediction results. + * + * @param projectId The project id. + * @param ids The prediction ids. Limited to 64. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> deletePredictionWithServiceResponseAsync(UUID projectId, List ids); + + /** + * Quick test an image url. + * + * @param projectId The project to evaluate against. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + ImagePrediction quickTestImageUrl(UUID projectId); + + /** + * Quick test an image url. + * + * @param projectId The project to evaluate against. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture quickTestImageUrlAsync(UUID projectId, final ServiceCallback serviceCallback); + + /** + * Quick test an image url. + * + * @param projectId The project to evaluate against. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable quickTestImageUrlAsync(UUID projectId); + + /** + * Quick test an image url. + * + * @param projectId The project to evaluate against. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable> quickTestImageUrlWithServiceResponseAsync(UUID projectId); + /** + * Quick test an image url. + * + * @param projectId The project to evaluate against. + * @param iterationId Optional. Specifies the id of a particular iteration to evaluate against. + The default iteration for the project will be used when not specified. + * @param url the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + ImagePrediction quickTestImageUrl(UUID projectId, UUID iterationId, String url); + + /** + * Quick test an image url. + * + * @param projectId The project to evaluate against. + * @param iterationId Optional. Specifies the id of a particular iteration to evaluate against. + The default iteration for the project will be used when not specified. + * @param url the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture quickTestImageUrlAsync(UUID projectId, UUID iterationId, String url, final ServiceCallback serviceCallback); + + /** + * Quick test an image url. + * + * @param projectId The project to evaluate against. + * @param iterationId Optional. Specifies the id of a particular iteration to evaluate against. + The default iteration for the project will be used when not specified. + * @param url the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable quickTestImageUrlAsync(UUID projectId, UUID iterationId, String url); + + /** + * Quick test an image url. + * + * @param projectId The project to evaluate against. + * @param iterationId Optional. Specifies the id of a particular iteration to evaluate against. + The default iteration for the project will be used when not specified. + * @param url the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable> quickTestImageUrlWithServiceResponseAsync(UUID projectId, UUID iterationId, String url); + + /** + * Quick test an image. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + ImagePrediction quickTestImage(UUID projectId, byte[] imageData); + + /** + * Quick test an image. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture quickTestImageAsync(UUID projectId, byte[] imageData, final ServiceCallback serviceCallback); + + /** + * Quick test an image. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable quickTestImageAsync(UUID projectId, byte[] imageData); + + /** + * Quick test an image. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable> quickTestImageWithServiceResponseAsync(UUID projectId, byte[] imageData); + /** + * Quick test an image. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @param iterationId Optional. Specifies the id of a particular iteration to evaluate against. + The default iteration for the project will be used when not specified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + ImagePrediction quickTestImage(UUID projectId, byte[] imageData, UUID iterationId); + + /** + * Quick test an image. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @param iterationId Optional. Specifies the id of a particular iteration to evaluate against. + The default iteration for the project will be used when not specified. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture quickTestImageAsync(UUID projectId, byte[] imageData, UUID iterationId, final ServiceCallback serviceCallback); + + /** + * Quick test an image. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @param iterationId Optional. Specifies the id of a particular iteration to evaluate against. + The default iteration for the project will be used when not specified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable quickTestImageAsync(UUID projectId, byte[] imageData, UUID iterationId); + + /** + * Quick test an image. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @param iterationId Optional. Specifies the id of a particular iteration to evaluate against. + The default iteration for the project will be used when not specified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable> quickTestImageWithServiceResponseAsync(UUID projectId, byte[] imageData, UUID iterationId); + + /** + * Get images that were sent to your prediction endpoint. + * + * @param projectId The project id. + * @param query Parameters used to query the predictions. Limited to combining 2 tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PredictionQueryResult object if successful. + */ + PredictionQueryResult queryPredictions(UUID projectId, PredictionQueryToken query); + + /** + * Get images that were sent to your prediction endpoint. + * + * @param projectId The project id. + * @param query Parameters used to query the predictions. Limited to combining 2 tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture queryPredictionsAsync(UUID projectId, PredictionQueryToken query, final ServiceCallback serviceCallback); + + /** + * Get images that were sent to your prediction endpoint. + * + * @param projectId The project id. + * @param query Parameters used to query the predictions. Limited to combining 2 tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PredictionQueryResult object + */ + Observable queryPredictionsAsync(UUID projectId, PredictionQueryToken query); + + /** + * Get images that were sent to your prediction endpoint. + * + * @param projectId The project id. + * @param query Parameters used to query the predictions. Limited to combining 2 tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PredictionQueryResult object + */ + Observable> queryPredictionsWithServiceResponseAsync(UUID projectId, PredictionQueryToken query); + + /** + * Get detailed performance information about an iteration. + * + * @param projectId The id of the project the iteration belongs to. + * @param iterationId The id of the iteration to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IterationPerformance object if successful. + */ + IterationPerformance getIterationPerformance(UUID projectId, UUID iterationId); + + /** + * Get detailed performance information about an iteration. + * + * @param projectId The id of the project the iteration belongs to. + * @param iterationId The id of the iteration to get. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getIterationPerformanceAsync(UUID projectId, UUID iterationId, final ServiceCallback serviceCallback); + + /** + * Get detailed performance information about an iteration. + * + * @param projectId The id of the project the iteration belongs to. + * @param iterationId The id of the iteration to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IterationPerformance object + */ + Observable getIterationPerformanceAsync(UUID projectId, UUID iterationId); + + /** + * Get detailed performance information about an iteration. + * + * @param projectId The id of the project the iteration belongs to. + * @param iterationId The id of the iteration to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IterationPerformance object + */ + Observable> getIterationPerformanceWithServiceResponseAsync(UUID projectId, UUID iterationId); + /** + * Get detailed performance information about an iteration. + * + * @param projectId The id of the project the iteration belongs to. + * @param iterationId The id of the iteration to get. + * @param threshold The threshold used to determine true predictions. + * @param overlapThreshold If applicable, the bounding box overlap threshold used to determine true predictions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IterationPerformance object if successful. + */ + IterationPerformance getIterationPerformance(UUID projectId, UUID iterationId, Double threshold, Double overlapThreshold); + + /** + * Get detailed performance information about an iteration. + * + * @param projectId The id of the project the iteration belongs to. + * @param iterationId The id of the iteration to get. + * @param threshold The threshold used to determine true predictions. + * @param overlapThreshold If applicable, the bounding box overlap threshold used to determine true predictions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getIterationPerformanceAsync(UUID projectId, UUID iterationId, Double threshold, Double overlapThreshold, final ServiceCallback serviceCallback); + + /** + * Get detailed performance information about an iteration. + * + * @param projectId The id of the project the iteration belongs to. + * @param iterationId The id of the iteration to get. + * @param threshold The threshold used to determine true predictions. + * @param overlapThreshold If applicable, the bounding box overlap threshold used to determine true predictions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IterationPerformance object + */ + Observable getIterationPerformanceAsync(UUID projectId, UUID iterationId, Double threshold, Double overlapThreshold); + + /** + * Get detailed performance information about an iteration. + * + * @param projectId The id of the project the iteration belongs to. + * @param iterationId The id of the iteration to get. + * @param threshold The threshold used to determine true predictions. + * @param overlapThreshold If applicable, the bounding box overlap threshold used to determine true predictions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IterationPerformance object + */ + Observable> getIterationPerformanceWithServiceResponseAsync(UUID projectId, UUID iterationId, Double threshold, Double overlapThreshold); + + /** + * Get image with its prediction for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ImagePerformance> object if successful. + */ + List getImagePerformances(UUID projectId, UUID iterationId); + + /** + * Get image with its prediction for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getImagePerformancesAsync(UUID projectId, UUID iterationId, final ServiceCallback> serviceCallback); + + /** + * Get image with its prediction for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ImagePerformance> object + */ + Observable> getImagePerformancesAsync(UUID projectId, UUID iterationId); + + /** + * Get image with its prediction for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ImagePerformance> object + */ + Observable>> getImagePerformancesWithServiceResponseAsync(UUID projectId, UUID iterationId); + /** + * Get image with its prediction for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images. Defaults to all tagged images when null. Limited to 20. + * @param orderBy The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest' + * @param take Maximum number of images to return. Defaults to 50, limited to 256. + * @param skip Number of images to skip before beginning the image batch. Defaults to 0. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ImagePerformance> object if successful. + */ + List getImagePerformances(UUID projectId, UUID iterationId, List tagIds, String orderBy, Integer take, Integer skip); + + /** + * Get image with its prediction for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images. Defaults to all tagged images when null. Limited to 20. + * @param orderBy The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest' + * @param take Maximum number of images to return. Defaults to 50, limited to 256. + * @param skip Number of images to skip before beginning the image batch. Defaults to 0. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getImagePerformancesAsync(UUID projectId, UUID iterationId, List tagIds, String orderBy, Integer take, Integer skip, final ServiceCallback> serviceCallback); + + /** + * Get image with its prediction for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images. Defaults to all tagged images when null. Limited to 20. + * @param orderBy The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest' + * @param take Maximum number of images to return. Defaults to 50, limited to 256. + * @param skip Number of images to skip before beginning the image batch. Defaults to 0. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ImagePerformance> object + */ + Observable> getImagePerformancesAsync(UUID projectId, UUID iterationId, List tagIds, String orderBy, Integer take, Integer skip); + + /** + * Get image with its prediction for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images. Defaults to all tagged images when null. Limited to 20. + * @param orderBy The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest' + * @param take Maximum number of images to return. Defaults to 50, limited to 256. + * @param skip Number of images to skip before beginning the image batch. Defaults to 0. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ImagePerformance> object + */ + Observable>> getImagePerformancesWithServiceResponseAsync(UUID projectId, UUID iterationId, List tagIds, String orderBy, Integer take, Integer skip); + + /** + * Gets the number of images tagged with the provided {tagIds} that have prediction results from + training for the provided iteration {iterationId}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the int object if successful. + */ + int getImagePerformanceCount(UUID projectId, UUID iterationId); + + /** + * Gets the number of images tagged with the provided {tagIds} that have prediction results from + training for the provided iteration {iterationId}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getImagePerformanceCountAsync(UUID projectId, UUID iterationId, final ServiceCallback serviceCallback); + + /** + * Gets the number of images tagged with the provided {tagIds} that have prediction results from + training for the provided iteration {iterationId}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the int object + */ + Observable getImagePerformanceCountAsync(UUID projectId, UUID iterationId); + + /** + * Gets the number of images tagged with the provided {tagIds} that have prediction results from + training for the provided iteration {iterationId}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the int object + */ + Observable> getImagePerformanceCountWithServiceResponseAsync(UUID projectId, UUID iterationId); + /** + * Gets the number of images tagged with the provided {tagIds} that have prediction results from + training for the provided iteration {iterationId}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images to count. Defaults to all tags when null. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the int object if successful. + */ + int getImagePerformanceCount(UUID projectId, UUID iterationId, List tagIds); + + /** + * Gets the number of images tagged with the provided {tagIds} that have prediction results from + training for the provided iteration {iterationId}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images to count. Defaults to all tags when null. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getImagePerformanceCountAsync(UUID projectId, UUID iterationId, List tagIds, final ServiceCallback serviceCallback); + + /** + * Gets the number of images tagged with the provided {tagIds} that have prediction results from + training for the provided iteration {iterationId}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images to count. Defaults to all tags when null. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the int object + */ + Observable getImagePerformanceCountAsync(UUID projectId, UUID iterationId, List tagIds); + + /** + * Gets the number of images tagged with the provided {tagIds} that have prediction results from + training for the provided iteration {iterationId}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images to count. Defaults to all tags when null. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the int object + */ + Observable> getImagePerformanceCountWithServiceResponseAsync(UUID projectId, UUID iterationId, List tagIds); + + /** + * Get your projects. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Project> object if successful. + */ + List getProjects(); + + /** + * Get your projects. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getProjectsAsync(final ServiceCallback> serviceCallback); + + /** + * Get your projects. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Project> object + */ + Observable> getProjectsAsync(); + + /** + * Get your projects. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Project> object + */ + Observable>> getProjectsWithServiceResponseAsync(); + + /** + * Create a project. + * + * @param name Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Project object if successful. + */ + Project createProject(String name); + + /** + * Create a project. + * + * @param name Name of the project. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture createProjectAsync(String name, final ServiceCallback serviceCallback); + + /** + * Create a project. + * + * @param name Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Project object + */ + Observable createProjectAsync(String name); + + /** + * Create a project. + * + * @param name Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Project object + */ + Observable> createProjectWithServiceResponseAsync(String name); + /** + * Create a project. + * + * @param name Name of the project. + * @param description The description of the project. + * @param domainId The id of the domain to use for this project. Defaults to General. + * @param classificationType The type of classifier to create for this project. Possible values include: 'Multiclass', 'Multilabel' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Project object if successful. + */ + Project createProject(String name, String description, UUID domainId, String classificationType); + + /** + * Create a project. + * + * @param name Name of the project. + * @param description The description of the project. + * @param domainId The id of the domain to use for this project. Defaults to General. + * @param classificationType The type of classifier to create for this project. Possible values include: 'Multiclass', 'Multilabel' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture createProjectAsync(String name, String description, UUID domainId, String classificationType, final ServiceCallback serviceCallback); + + /** + * Create a project. + * + * @param name Name of the project. + * @param description The description of the project. + * @param domainId The id of the domain to use for this project. Defaults to General. + * @param classificationType The type of classifier to create for this project. Possible values include: 'Multiclass', 'Multilabel' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Project object + */ + Observable createProjectAsync(String name, String description, UUID domainId, String classificationType); + + /** + * Create a project. + * + * @param name Name of the project. + * @param description The description of the project. + * @param domainId The id of the domain to use for this project. Defaults to General. + * @param classificationType The type of classifier to create for this project. Possible values include: 'Multiclass', 'Multilabel' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Project object + */ + Observable> createProjectWithServiceResponseAsync(String name, String description, UUID domainId, String classificationType); + + /** + * Get a specific project. + * + * @param projectId The id of the project to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Project object if successful. + */ + Project getProject(UUID projectId); + + /** + * Get a specific project. + * + * @param projectId The id of the project to get. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getProjectAsync(UUID projectId, final ServiceCallback serviceCallback); + + /** + * Get a specific project. + * + * @param projectId The id of the project to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Project object + */ + Observable getProjectAsync(UUID projectId); + + /** + * Get a specific project. + * + * @param projectId The id of the project to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Project object + */ + Observable> getProjectWithServiceResponseAsync(UUID projectId); + + /** + * Delete a specific project. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void deleteProject(UUID projectId); + + /** + * Delete a specific project. + * + * @param projectId The project id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteProjectAsync(UUID projectId, final ServiceCallback serviceCallback); + + /** + * Delete a specific project. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable deleteProjectAsync(UUID projectId); + + /** + * Delete a specific project. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> deleteProjectWithServiceResponseAsync(UUID projectId); + + /** + * Update a specific project. + * + * @param projectId The id of the project to update. + * @param updatedProject The updated project model. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Project object if successful. + */ + Project updateProject(UUID projectId, Project updatedProject); + + /** + * Update a specific project. + * + * @param projectId The id of the project to update. + * @param updatedProject The updated project model. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture updateProjectAsync(UUID projectId, Project updatedProject, final ServiceCallback serviceCallback); + + /** + * Update a specific project. + * + * @param projectId The id of the project to update. + * @param updatedProject The updated project model. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Project object + */ + Observable updateProjectAsync(UUID projectId, Project updatedProject); + + /** + * Update a specific project. + * + * @param projectId The id of the project to update. + * @param updatedProject The updated project model. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Project object + */ + Observable> updateProjectWithServiceResponseAsync(UUID projectId, Project updatedProject); + + /** + * Get iterations for the project. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Iteration> object if successful. + */ + List getIterations(UUID projectId); + + /** + * Get iterations for the project. + * + * @param projectId The project id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getIterationsAsync(UUID projectId, final ServiceCallback> serviceCallback); + + /** + * Get iterations for the project. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Iteration> object + */ + Observable> getIterationsAsync(UUID projectId); + + /** + * Get iterations for the project. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Iteration> object + */ + Observable>> getIterationsWithServiceResponseAsync(UUID projectId); + + /** + * Get a specific iteration. + * + * @param projectId The id of the project the iteration belongs to. + * @param iterationId The id of the iteration to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Iteration object if successful. + */ + Iteration getIteration(UUID projectId, UUID iterationId); + + /** + * Get a specific iteration. + * + * @param projectId The id of the project the iteration belongs to. + * @param iterationId The id of the iteration to get. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getIterationAsync(UUID projectId, UUID iterationId, final ServiceCallback serviceCallback); + + /** + * Get a specific iteration. + * + * @param projectId The id of the project the iteration belongs to. + * @param iterationId The id of the iteration to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Iteration object + */ + Observable getIterationAsync(UUID projectId, UUID iterationId); + + /** + * Get a specific iteration. + * + * @param projectId The id of the project the iteration belongs to. + * @param iterationId The id of the iteration to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Iteration object + */ + Observable> getIterationWithServiceResponseAsync(UUID projectId, UUID iterationId); + + /** + * Delete a specific iteration of a project. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void deleteIteration(UUID projectId, UUID iterationId); + + /** + * Delete a specific iteration of a project. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteIterationAsync(UUID projectId, UUID iterationId, final ServiceCallback serviceCallback); + + /** + * Delete a specific iteration of a project. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable deleteIterationAsync(UUID projectId, UUID iterationId); + + /** + * Delete a specific iteration of a project. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> deleteIterationWithServiceResponseAsync(UUID projectId, UUID iterationId); + + /** + * Update a specific iteration. + * + * @param projectId Project id. + * @param iterationId Iteration id. + * @param updatedIteration The updated iteration model. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Iteration object if successful. + */ + Iteration updateIteration(UUID projectId, UUID iterationId, Iteration updatedIteration); + + /** + * Update a specific iteration. + * + * @param projectId Project id. + * @param iterationId Iteration id. + * @param updatedIteration The updated iteration model. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture updateIterationAsync(UUID projectId, UUID iterationId, Iteration updatedIteration, final ServiceCallback serviceCallback); + + /** + * Update a specific iteration. + * + * @param projectId Project id. + * @param iterationId Iteration id. + * @param updatedIteration The updated iteration model. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Iteration object + */ + Observable updateIterationAsync(UUID projectId, UUID iterationId, Iteration updatedIteration); + + /** + * Update a specific iteration. + * + * @param projectId Project id. + * @param iterationId Iteration id. + * @param updatedIteration The updated iteration model. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Iteration object + */ + Observable> updateIterationWithServiceResponseAsync(UUID projectId, UUID iterationId, Iteration updatedIteration); + + /** + * Queues project for training. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Iteration object if successful. + */ + Iteration trainProject(UUID projectId); + + /** + * Queues project for training. + * + * @param projectId The project id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture trainProjectAsync(UUID projectId, final ServiceCallback serviceCallback); + + /** + * Queues project for training. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Iteration object + */ + Observable trainProjectAsync(UUID projectId); + + /** + * Queues project for training. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Iteration object + */ + Observable> trainProjectWithServiceResponseAsync(UUID projectId); + + /** + * Get the list of exports for a specific iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Export> object if successful. + */ + List getExports(UUID projectId, UUID iterationId); + + /** + * Get the list of exports for a specific iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getExportsAsync(UUID projectId, UUID iterationId, final ServiceCallback> serviceCallback); + + /** + * Get the list of exports for a specific iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Export> object + */ + Observable> getExportsAsync(UUID projectId, UUID iterationId); + + /** + * Get the list of exports for a specific iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Export> object + */ + Observable>> getExportsWithServiceResponseAsync(UUID projectId, UUID iterationId); + + /** + * Export a trained iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @param platform The target platform. Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Export object if successful. + */ + Export exportIteration(UUID projectId, UUID iterationId, String platform); + + /** + * Export a trained iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @param platform The target platform. Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture exportIterationAsync(UUID projectId, UUID iterationId, String platform, final ServiceCallback serviceCallback); + + /** + * Export a trained iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @param platform The target platform. Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Export object + */ + Observable exportIterationAsync(UUID projectId, UUID iterationId, String platform); + + /** + * Export a trained iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @param platform The target platform. Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Export object + */ + Observable> exportIterationWithServiceResponseAsync(UUID projectId, UUID iterationId, String platform); + /** + * Export a trained iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @param platform The target platform. Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX' + * @param flavor The flavor of the target platform. Possible values include: 'Linux', 'Windows', 'ONNX10', 'ONNX12' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Export object if successful. + */ + Export exportIteration(UUID projectId, UUID iterationId, String platform, String flavor); + + /** + * Export a trained iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @param platform The target platform. Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX' + * @param flavor The flavor of the target platform. Possible values include: 'Linux', 'Windows', 'ONNX10', 'ONNX12' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture exportIterationAsync(UUID projectId, UUID iterationId, String platform, String flavor, final ServiceCallback serviceCallback); + + /** + * Export a trained iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @param platform The target platform. Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX' + * @param flavor The flavor of the target platform. Possible values include: 'Linux', 'Windows', 'ONNX10', 'ONNX12' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Export object + */ + Observable exportIterationAsync(UUID projectId, UUID iterationId, String platform, String flavor); + + /** + * Export a trained iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @param platform The target platform. Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX' + * @param flavor The flavor of the target platform. Possible values include: 'Linux', 'Windows', 'ONNX10', 'ONNX12' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Export object + */ + Observable> exportIterationWithServiceResponseAsync(UUID projectId, UUID iterationId, String platform, String flavor); + + /** + * Get information about a specific tag. + * + * @param projectId The project this tag belongs to. + * @param tagId The tag id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Tag object if successful. + */ + Tag getTag(UUID projectId, UUID tagId); + + /** + * Get information about a specific tag. + * + * @param projectId The project this tag belongs to. + * @param tagId The tag id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getTagAsync(UUID projectId, UUID tagId, final ServiceCallback serviceCallback); + + /** + * Get information about a specific tag. + * + * @param projectId The project this tag belongs to. + * @param tagId The tag id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Tag object + */ + Observable getTagAsync(UUID projectId, UUID tagId); + + /** + * Get information about a specific tag. + * + * @param projectId The project this tag belongs to. + * @param tagId The tag id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Tag object + */ + Observable> getTagWithServiceResponseAsync(UUID projectId, UUID tagId); + /** + * Get information about a specific tag. + * + * @param projectId The project this tag belongs to. + * @param tagId The tag id. + * @param iterationId The iteration to retrieve this tag from. Optional, defaults to current training set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Tag object if successful. + */ + Tag getTag(UUID projectId, UUID tagId, UUID iterationId); + + /** + * Get information about a specific tag. + * + * @param projectId The project this tag belongs to. + * @param tagId The tag id. + * @param iterationId The iteration to retrieve this tag from. Optional, defaults to current training set. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getTagAsync(UUID projectId, UUID tagId, UUID iterationId, final ServiceCallback serviceCallback); + + /** + * Get information about a specific tag. + * + * @param projectId The project this tag belongs to. + * @param tagId The tag id. + * @param iterationId The iteration to retrieve this tag from. Optional, defaults to current training set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Tag object + */ + Observable getTagAsync(UUID projectId, UUID tagId, UUID iterationId); + + /** + * Get information about a specific tag. + * + * @param projectId The project this tag belongs to. + * @param tagId The tag id. + * @param iterationId The iteration to retrieve this tag from. Optional, defaults to current training set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Tag object + */ + Observable> getTagWithServiceResponseAsync(UUID projectId, UUID tagId, UUID iterationId); + + /** + * Delete a tag from the project. + * + * @param projectId The project id. + * @param tagId Id of the tag to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void deleteTag(UUID projectId, UUID tagId); + + /** + * Delete a tag from the project. + * + * @param projectId The project id. + * @param tagId Id of the tag to be deleted. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteTagAsync(UUID projectId, UUID tagId, final ServiceCallback serviceCallback); + + /** + * Delete a tag from the project. + * + * @param projectId The project id. + * @param tagId Id of the tag to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable deleteTagAsync(UUID projectId, UUID tagId); + + /** + * Delete a tag from the project. + * + * @param projectId The project id. + * @param tagId Id of the tag to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> deleteTagWithServiceResponseAsync(UUID projectId, UUID tagId); + + /** + * Update a tag. + * + * @param projectId The project id. + * @param tagId The id of the target tag. + * @param updatedTag The updated tag model. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Tag object if successful. + */ + Tag updateTag(UUID projectId, UUID tagId, Tag updatedTag); + + /** + * Update a tag. + * + * @param projectId The project id. + * @param tagId The id of the target tag. + * @param updatedTag The updated tag model. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture updateTagAsync(UUID projectId, UUID tagId, Tag updatedTag, final ServiceCallback serviceCallback); + + /** + * Update a tag. + * + * @param projectId The project id. + * @param tagId The id of the target tag. + * @param updatedTag The updated tag model. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Tag object + */ + Observable updateTagAsync(UUID projectId, UUID tagId, Tag updatedTag); + + /** + * Update a tag. + * + * @param projectId The project id. + * @param tagId The id of the target tag. + * @param updatedTag The updated tag model. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Tag object + */ + Observable> updateTagWithServiceResponseAsync(UUID projectId, UUID tagId, Tag updatedTag); + + /** + * Get the tags for a given project and iteration. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Tag> object if successful. + */ + List getTags(UUID projectId); + + /** + * Get the tags for a given project and iteration. + * + * @param projectId The project id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getTagsAsync(UUID projectId, final ServiceCallback> serviceCallback); + + /** + * Get the tags for a given project and iteration. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Tag> object + */ + Observable> getTagsAsync(UUID projectId); + + /** + * Get the tags for a given project and iteration. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Tag> object + */ + Observable>> getTagsWithServiceResponseAsync(UUID projectId); + /** + * Get the tags for a given project and iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Tag> object if successful. + */ + List getTags(UUID projectId, UUID iterationId); + + /** + * Get the tags for a given project and iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getTagsAsync(UUID projectId, UUID iterationId, final ServiceCallback> serviceCallback); + + /** + * Get the tags for a given project and iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Tag> object + */ + Observable> getTagsAsync(UUID projectId, UUID iterationId); + + /** + * Get the tags for a given project and iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Tag> object + */ + Observable>> getTagsWithServiceResponseAsync(UUID projectId, UUID iterationId); + + /** + * Create a tag for the project. + * + * @param projectId The project id. + * @param name The tag name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Tag object if successful. + */ + Tag createTag(UUID projectId, String name); + + /** + * Create a tag for the project. + * + * @param projectId The project id. + * @param name The tag name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture createTagAsync(UUID projectId, String name, final ServiceCallback serviceCallback); + + /** + * Create a tag for the project. + * + * @param projectId The project id. + * @param name The tag name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Tag object + */ + Observable createTagAsync(UUID projectId, String name); + + /** + * Create a tag for the project. + * + * @param projectId The project id. + * @param name The tag name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Tag object + */ + Observable> createTagWithServiceResponseAsync(UUID projectId, String name); + /** + * Create a tag for the project. + * + * @param projectId The project id. + * @param name The tag name. + * @param description Optional description for the tag. + * @param type Optional type for the tag. Possible values include: 'Regular', 'Negative' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Tag object if successful. + */ + Tag createTag(UUID projectId, String name, String description, String type); + + /** + * Create a tag for the project. + * + * @param projectId The project id. + * @param name The tag name. + * @param description Optional description for the tag. + * @param type Optional type for the tag. Possible values include: 'Regular', 'Negative' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture createTagAsync(UUID projectId, String name, String description, String type, final ServiceCallback serviceCallback); + + /** + * Create a tag for the project. + * + * @param projectId The project id. + * @param name The tag name. + * @param description Optional description for the tag. + * @param type Optional type for the tag. Possible values include: 'Regular', 'Negative' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Tag object + */ + Observable createTagAsync(UUID projectId, String name, String description, String type); + + /** + * Create a tag for the project. + * + * @param projectId The project id. + * @param name The tag name. + * @param description Optional description for the tag. + * @param type Optional type for the tag. Possible values include: 'Regular', 'Negative' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Tag object + */ + Observable> createTagWithServiceResponseAsync(UUID projectId, String name, String description, String type); + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/CustomVisionTrainingClientImpl.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/CustomVisionTrainingClientImpl.java new file mode 100644 index 000000000000..b30b8eafd457 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/CustomVisionTrainingClientImpl.java @@ -0,0 +1,5687 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.cognitiveservices.vision.customvision.training.implementation; + +import com.google.common.base.Joiner; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.Domain; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.Export; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.Image; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageCreateSummary; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageFileCreateBatch; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageIdCreateBatch; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImagePerformance; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImagePrediction; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageRegionCreateBatch; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageRegionCreateEntry; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageRegionCreateSummary; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageRegionProposal; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageTagCreateBatch; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageTagCreateEntry; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageTagCreateSummary; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageUrl; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageUrlCreateBatch; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.Iteration; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.IterationPerformance; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.PredictionQueryResult; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.PredictionQueryToken; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.Project; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.Tag; +import com.microsoft.rest.CollectionFormat; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.InputStream; +import java.io.IOException; +import java.util.List; +import java.util.UUID; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Multipart; +import retrofit2.http.Part; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * Initializes a new instance of the CustomVisionTrainingClientImpl class. + */ +public class CustomVisionTrainingClientImpl extends AzureServiceClient implements CustomVisionTrainingClient { + /** The Retrofit service to perform REST calls. */ + private CustomVisionTrainingClientService service; + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** */ + private String apiKey; + + /** + * Gets + * + * @return the apiKey value. + */ + public String apiKey() { + return this.apiKey; + } + + /** + * Sets + * + * @param apiKey the apiKey value. + * @return the service client itself + */ + public CustomVisionTrainingClientImpl withApiKey(String apiKey) { + this.apiKey = apiKey; + return this; + } + + /** Supported Cognitive Services endpoints. */ + private String endpoint; + + /** + * Gets Supported Cognitive Services endpoints. + * + * @return the endpoint value. + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Sets Supported Cognitive Services endpoints. + * + * @param endpoint the endpoint value. + * @return the service client itself + */ + public CustomVisionTrainingClientImpl withEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public CustomVisionTrainingClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public CustomVisionTrainingClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public CustomVisionTrainingClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * Initializes an instance of CustomVisionTrainingClient client. + * + * @param credentials the management credentials for Azure + */ + public CustomVisionTrainingClientImpl(ServiceClientCredentials credentials) { + this("https://{Endpoint}/customvision/v2.2/Training", credentials); + } + + /** + * Initializes an instance of CustomVisionTrainingClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + private CustomVisionTrainingClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of CustomVisionTrainingClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public CustomVisionTrainingClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.azureClient = new AzureClient(this); + initializeService(); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "CustomVisionTrainingClient", "2.2"); + } + + private void initializeService() { + service = restClient().retrofit().create(CustomVisionTrainingClientService.class); + } + + /** + * The interface defining all the services for CustomVisionTrainingClient to be + * used by Retrofit to perform actually REST calls. + */ + interface CustomVisionTrainingClientService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient getDomains" }) + @GET("domains") + Observable> getDomains(@Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient getDomain" }) + @GET("domains/{domainId}") + Observable> getDomain(@Path("domainId") UUID domainId, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient getTaggedImageCount" }) + @GET("projects/{projectId}/images/tagged/count") + Observable> getTaggedImageCount(@Path("projectId") UUID projectId, @Query("iterationId") UUID iterationId, @Query("tagIds") String tagIds, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient getUntaggedImageCount" }) + @GET("projects/{projectId}/images/untagged/count") + Observable> getUntaggedImageCount(@Path("projectId") UUID projectId, @Query("iterationId") UUID iterationId, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient createImageTags" }) + @POST("projects/{projectId}/images/tags") + Observable> createImageTags(@Path("projectId") UUID projectId, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Body ImageTagCreateBatch batch, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient deleteImageTags" }) + @HTTP(path = "projects/{projectId}/images/tags", method = "DELETE", hasBody = true) + Observable> deleteImageTags(@Path("projectId") UUID projectId, @Query("imageIds") String imageIds, @Query("tagIds") String tagIds, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient createImageRegions" }) + @POST("projects/{projectId}/images/regions") + Observable> createImageRegions(@Path("projectId") UUID projectId, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Body ImageRegionCreateBatch batch, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient deleteImageRegions" }) + @HTTP(path = "projects/{projectId}/images/regions", method = "DELETE", hasBody = true) + Observable> deleteImageRegions(@Path("projectId") UUID projectId, @Query("regionIds") String regionIds, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient getTaggedImages" }) + @GET("projects/{projectId}/images/tagged") + Observable> getTaggedImages(@Path("projectId") UUID projectId, @Query("iterationId") UUID iterationId, @Query("tagIds") String tagIds, @Query("orderBy") String orderBy, @Query("take") Integer take, @Query("skip") Integer skip, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient getUntaggedImages" }) + @GET("projects/{projectId}/images/untagged") + Observable> getUntaggedImages(@Path("projectId") UUID projectId, @Query("iterationId") UUID iterationId, @Query("orderBy") String orderBy, @Query("take") Integer take, @Query("skip") Integer skip, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient getImagesByIds" }) + @GET("projects/{projectId}/images/id") + Observable> getImagesByIds(@Path("projectId") UUID projectId, @Query("imageIds") String imageIds, @Query("iterationId") UUID iterationId, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Multipart + @POST("projects/{projectId}/images") + Observable> createImagesFromData(@Path("projectId") UUID projectId, @Query("tagIds") String tagIds, @Part("imageData") RequestBody imageData, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient deleteImages" }) + @HTTP(path = "projects/{projectId}/images", method = "DELETE", hasBody = true) + Observable> deleteImages(@Path("projectId") UUID projectId, @Query("imageIds") String imageIds, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient createImagesFromFiles" }) + @POST("projects/{projectId}/images/files") + Observable> createImagesFromFiles(@Path("projectId") UUID projectId, @Body ImageFileCreateBatch batch, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient createImagesFromUrls" }) + @POST("projects/{projectId}/images/urls") + Observable> createImagesFromUrls(@Path("projectId") UUID projectId, @Body ImageUrlCreateBatch batch, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient createImagesFromPredictions" }) + @POST("projects/{projectId}/images/predictions") + Observable> createImagesFromPredictions(@Path("projectId") UUID projectId, @Body ImageIdCreateBatch batch, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient getImageRegionProposals" }) + @POST("{projectId}/images/{imageId}/regionproposals") + Observable> getImageRegionProposals(@Path("projectId") UUID projectId, @Path("imageId") UUID imageId, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient deletePrediction" }) + @HTTP(path = "projects/{projectId}/predictions", method = "DELETE", hasBody = true) + Observable> deletePrediction(@Path("projectId") UUID projectId, @Query("ids") String ids, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient quickTestImageUrl" }) + @POST("projects/{projectId}/quicktest/url") + Observable> quickTestImageUrl(@Path("projectId") UUID projectId, @Query("iterationId") UUID iterationId, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Body ImageUrl imageUrl, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Multipart + @POST("projects/{projectId}/quicktest/image") + Observable> quickTestImage(@Path("projectId") UUID projectId, @Query("iterationId") UUID iterationId, @Part("imageData") RequestBody imageData, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient queryPredictions" }) + @POST("projects/{projectId}/predictions/query") + Observable> queryPredictions(@Path("projectId") UUID projectId, @Body PredictionQueryToken query, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient getIterationPerformance" }) + @GET("projects/{projectId}/iterations/{iterationId}/performance") + Observable> getIterationPerformance(@Path("projectId") UUID projectId, @Path("iterationId") UUID iterationId, @Query("threshold") Double threshold, @Query("overlapThreshold") Double overlapThreshold, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient getImagePerformances" }) + @GET("projects/{projectId}/iterations/{iterationId}/performance/images") + Observable> getImagePerformances(@Path("projectId") UUID projectId, @Path("iterationId") UUID iterationId, @Query("tagIds") String tagIds, @Query("orderBy") String orderBy, @Query("take") Integer take, @Query("skip") Integer skip, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient getImagePerformanceCount" }) + @GET("projects/{projectId}/iterations/{iterationId}/performance/images/count") + Observable> getImagePerformanceCount(@Path("projectId") UUID projectId, @Path("iterationId") UUID iterationId, @Query("tagIds") String tagIds, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient getProjects" }) + @GET("projects") + Observable> getProjects(@Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient createProject" }) + @POST("projects") + Observable> createProject(@Query("name") String name, @Query("description") String description, @Query("domainId") UUID domainId, @Query("classificationType") String classificationType, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient getProject" }) + @GET("projects/{projectId}") + Observable> getProject(@Path("projectId") UUID projectId, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient deleteProject" }) + @HTTP(path = "projects/{projectId}", method = "DELETE", hasBody = true) + Observable> deleteProject(@Path("projectId") UUID projectId, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient updateProject" }) + @PATCH("projects/{projectId}") + Observable> updateProject(@Path("projectId") UUID projectId, @Body Project updatedProject, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient getIterations" }) + @GET("projects/{projectId}/iterations") + Observable> getIterations(@Path("projectId") UUID projectId, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient getIteration" }) + @GET("projects/{projectId}/iterations/{iterationId}") + Observable> getIteration(@Path("projectId") UUID projectId, @Path("iterationId") UUID iterationId, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient deleteIteration" }) + @HTTP(path = "projects/{projectId}/iterations/{iterationId}", method = "DELETE", hasBody = true) + Observable> deleteIteration(@Path("projectId") UUID projectId, @Path("iterationId") UUID iterationId, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient updateIteration" }) + @PATCH("projects/{projectId}/iterations/{iterationId}") + Observable> updateIteration(@Path("projectId") UUID projectId, @Path("iterationId") UUID iterationId, @Body Iteration updatedIteration, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient trainProject" }) + @POST("projects/{projectId}/train") + Observable> trainProject(@Path("projectId") UUID projectId, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient getExports" }) + @GET("projects/{projectId}/iterations/{iterationId}/export") + Observable> getExports(@Path("projectId") UUID projectId, @Path("iterationId") UUID iterationId, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient exportIteration" }) + @POST("projects/{projectId}/iterations/{iterationId}/export") + Observable> exportIteration(@Path("projectId") UUID projectId, @Path("iterationId") UUID iterationId, @Query("platform") String platform, @Query("flavor") String flavor, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient getTag" }) + @GET("projects/{projectId}/tags/{tagId}") + Observable> getTag(@Path("projectId") UUID projectId, @Path("tagId") UUID tagId, @Query("iterationId") UUID iterationId, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient deleteTag" }) + @HTTP(path = "projects/{projectId}/tags/{tagId}", method = "DELETE", hasBody = true) + Observable> deleteTag(@Path("projectId") UUID projectId, @Path("tagId") UUID tagId, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient updateTag" }) + @PATCH("projects/{projectId}/tags/{tagId}") + Observable> updateTag(@Path("projectId") UUID projectId, @Path("tagId") UUID tagId, @Body Tag updatedTag, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient getTags" }) + @GET("projects/{projectId}/tags") + Observable> getTags(@Path("projectId") UUID projectId, @Query("iterationId") UUID iterationId, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient createTag" }) + @POST("projects/{projectId}/tags") + Observable> createTag(@Path("projectId") UUID projectId, @Query("name") String name, @Query("description") String description, @Query("type") String type, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + } + + /** + * Get a list of the available domains. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Domain> object if successful. + */ + public List getDomains() { + return getDomainsWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get a list of the available domains. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDomainsAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDomainsWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get a list of the available domains. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Domain> object + */ + public Observable> getDomainsAsync() { + return getDomainsWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of the available domains. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Domain> object + */ + public Observable>> getDomainsWithServiceResponseAsync() { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.getDomains(this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDomainsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDomainsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., CloudException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get information about a specific domain. + * + * @param domainId The id of the domain to get information about. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Domain object if successful. + */ + public Domain getDomain(UUID domainId) { + return getDomainWithServiceResponseAsync(domainId).toBlocking().single().body(); + } + + /** + * Get information about a specific domain. + * + * @param domainId The id of the domain to get information about. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDomainAsync(UUID domainId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDomainWithServiceResponseAsync(domainId), serviceCallback); + } + + /** + * Get information about a specific domain. + * + * @param domainId The id of the domain to get information about. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Domain object + */ + public Observable getDomainAsync(UUID domainId) { + return getDomainWithServiceResponseAsync(domainId).map(new Func1, Domain>() { + @Override + public Domain call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get information about a specific domain. + * + * @param domainId The id of the domain to get information about. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Domain object + */ + public Observable> getDomainWithServiceResponseAsync(UUID domainId) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (domainId == null) { + throw new IllegalArgumentException("Parameter domainId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.getDomain(domainId, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDomainDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDomainDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the number of images tagged with the provided {tagIds}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the int object if successful. + */ + public int getTaggedImageCount(UUID projectId) { + return getTaggedImageCountWithServiceResponseAsync(projectId).toBlocking().single().body(); + } + + /** + * Gets the number of images tagged with the provided {tagIds}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getTaggedImageCountAsync(UUID projectId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getTaggedImageCountWithServiceResponseAsync(projectId), serviceCallback); + } + + /** + * Gets the number of images tagged with the provided {tagIds}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Integer object + */ + public Observable getTaggedImageCountAsync(UUID projectId) { + return getTaggedImageCountWithServiceResponseAsync(projectId).map(new Func1, Integer>() { + @Override + public Integer call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the number of images tagged with the provided {tagIds}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Integer object + */ + public Observable> getTaggedImageCountWithServiceResponseAsync(UUID projectId) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + final UUID iterationId = null; + final List tagIds = null; + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + String tagIdsConverted = this.serializerAdapter().serializeList(tagIds, CollectionFormat.CSV); + return service.getTaggedImageCount(projectId, iterationId, tagIdsConverted, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getTaggedImageCountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the number of images tagged with the provided {tagIds}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images to count. Defaults to all tags when null. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the int object if successful. + */ + public int getTaggedImageCount(UUID projectId, UUID iterationId, List tagIds) { + return getTaggedImageCountWithServiceResponseAsync(projectId, iterationId, tagIds).toBlocking().single().body(); + } + + /** + * Gets the number of images tagged with the provided {tagIds}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images to count. Defaults to all tags when null. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getTaggedImageCountAsync(UUID projectId, UUID iterationId, List tagIds, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getTaggedImageCountWithServiceResponseAsync(projectId, iterationId, tagIds), serviceCallback); + } + + /** + * Gets the number of images tagged with the provided {tagIds}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images to count. Defaults to all tags when null. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Integer object + */ + public Observable getTaggedImageCountAsync(UUID projectId, UUID iterationId, List tagIds) { + return getTaggedImageCountWithServiceResponseAsync(projectId, iterationId, tagIds).map(new Func1, Integer>() { + @Override + public Integer call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the number of images tagged with the provided {tagIds}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images to count. Defaults to all tags when null. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Integer object + */ + public Observable> getTaggedImageCountWithServiceResponseAsync(UUID projectId, UUID iterationId, List tagIds) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + Validator.validate(tagIds); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + String tagIdsConverted = this.serializerAdapter().serializeList(tagIds, CollectionFormat.CSV); + return service.getTaggedImageCount(projectId, iterationId, tagIdsConverted, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getTaggedImageCountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getTaggedImageCountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the number of untagged images. + * This API returns the images which have no tags for a given project and optionally an iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the int object if successful. + */ + public int getUntaggedImageCount(UUID projectId) { + return getUntaggedImageCountWithServiceResponseAsync(projectId).toBlocking().single().body(); + } + + /** + * Gets the number of untagged images. + * This API returns the images which have no tags for a given project and optionally an iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getUntaggedImageCountAsync(UUID projectId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getUntaggedImageCountWithServiceResponseAsync(projectId), serviceCallback); + } + + /** + * Gets the number of untagged images. + * This API returns the images which have no tags for a given project and optionally an iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Integer object + */ + public Observable getUntaggedImageCountAsync(UUID projectId) { + return getUntaggedImageCountWithServiceResponseAsync(projectId).map(new Func1, Integer>() { + @Override + public Integer call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the number of untagged images. + * This API returns the images which have no tags for a given project and optionally an iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Integer object + */ + public Observable> getUntaggedImageCountWithServiceResponseAsync(UUID projectId) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + final UUID iterationId = null; + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.getUntaggedImageCount(projectId, iterationId, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getUntaggedImageCountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the number of untagged images. + * This API returns the images which have no tags for a given project and optionally an iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the int object if successful. + */ + public int getUntaggedImageCount(UUID projectId, UUID iterationId) { + return getUntaggedImageCountWithServiceResponseAsync(projectId, iterationId).toBlocking().single().body(); + } + + /** + * Gets the number of untagged images. + * This API returns the images which have no tags for a given project and optionally an iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getUntaggedImageCountAsync(UUID projectId, UUID iterationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getUntaggedImageCountWithServiceResponseAsync(projectId, iterationId), serviceCallback); + } + + /** + * Gets the number of untagged images. + * This API returns the images which have no tags for a given project and optionally an iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Integer object + */ + public Observable getUntaggedImageCountAsync(UUID projectId, UUID iterationId) { + return getUntaggedImageCountWithServiceResponseAsync(projectId, iterationId).map(new Func1, Integer>() { + @Override + public Integer call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the number of untagged images. + * This API returns the images which have no tags for a given project and optionally an iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Integer object + */ + public Observable> getUntaggedImageCountWithServiceResponseAsync(UUID projectId, UUID iterationId) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.getUntaggedImageCount(projectId, iterationId, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getUntaggedImageCountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getUntaggedImageCountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Associate a set of images with a set of tags. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageTagCreateSummary object if successful. + */ + public ImageTagCreateSummary createImageTags(UUID projectId) { + return createImageTagsWithServiceResponseAsync(projectId).toBlocking().single().body(); + } + + /** + * Associate a set of images with a set of tags. + * + * @param projectId The project id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createImageTagsAsync(UUID projectId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createImageTagsWithServiceResponseAsync(projectId), serviceCallback); + } + + /** + * Associate a set of images with a set of tags. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageTagCreateSummary object + */ + public Observable createImageTagsAsync(UUID projectId) { + return createImageTagsWithServiceResponseAsync(projectId).map(new Func1, ImageTagCreateSummary>() { + @Override + public ImageTagCreateSummary call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Associate a set of images with a set of tags. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageTagCreateSummary object + */ + public Observable> createImageTagsWithServiceResponseAsync(UUID projectId) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + final List tags = null; + ImageTagCreateBatch batch = new ImageTagCreateBatch(); + batch.withTags(null); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.createImageTags(projectId, this.apiKey(), this.acceptLanguage(), batch, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createImageTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Associate a set of images with a set of tags. + * + * @param projectId The project id. + * @param tags Image Tag entries to include in this batch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageTagCreateSummary object if successful. + */ + public ImageTagCreateSummary createImageTags(UUID projectId, List tags) { + return createImageTagsWithServiceResponseAsync(projectId, tags).toBlocking().single().body(); + } + + /** + * Associate a set of images with a set of tags. + * + * @param projectId The project id. + * @param tags Image Tag entries to include in this batch. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createImageTagsAsync(UUID projectId, List tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createImageTagsWithServiceResponseAsync(projectId, tags), serviceCallback); + } + + /** + * Associate a set of images with a set of tags. + * + * @param projectId The project id. + * @param tags Image Tag entries to include in this batch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageTagCreateSummary object + */ + public Observable createImageTagsAsync(UUID projectId, List tags) { + return createImageTagsWithServiceResponseAsync(projectId, tags).map(new Func1, ImageTagCreateSummary>() { + @Override + public ImageTagCreateSummary call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Associate a set of images with a set of tags. + * + * @param projectId The project id. + * @param tags Image Tag entries to include in this batch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageTagCreateSummary object + */ + public Observable> createImageTagsWithServiceResponseAsync(UUID projectId, List tags) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + Validator.validate(tags); + ImageTagCreateBatch batch = new ImageTagCreateBatch(); + batch.withTags(tags); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.createImageTags(projectId, this.apiKey(), this.acceptLanguage(), batch, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createImageTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createImageTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Remove a set of tags from a set of images. + * + * @param projectId The project id. + * @param imageIds Image ids. Limited to 64 images. + * @param tagIds Tags to be deleted from the specified images. Limited to 20 tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteImageTags(UUID projectId, List imageIds, List tagIds) { + deleteImageTagsWithServiceResponseAsync(projectId, imageIds, tagIds).toBlocking().single().body(); + } + + /** + * Remove a set of tags from a set of images. + * + * @param projectId The project id. + * @param imageIds Image ids. Limited to 64 images. + * @param tagIds Tags to be deleted from the specified images. Limited to 20 tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteImageTagsAsync(UUID projectId, List imageIds, List tagIds, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteImageTagsWithServiceResponseAsync(projectId, imageIds, tagIds), serviceCallback); + } + + /** + * Remove a set of tags from a set of images. + * + * @param projectId The project id. + * @param imageIds Image ids. Limited to 64 images. + * @param tagIds Tags to be deleted from the specified images. Limited to 20 tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteImageTagsAsync(UUID projectId, List imageIds, List tagIds) { + return deleteImageTagsWithServiceResponseAsync(projectId, imageIds, tagIds).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Remove a set of tags from a set of images. + * + * @param projectId The project id. + * @param imageIds Image ids. Limited to 64 images. + * @param tagIds Tags to be deleted from the specified images. Limited to 20 tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteImageTagsWithServiceResponseAsync(UUID projectId, List imageIds, List tagIds) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (imageIds == null) { + throw new IllegalArgumentException("Parameter imageIds is required and cannot be null."); + } + if (tagIds == null) { + throw new IllegalArgumentException("Parameter tagIds is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + Validator.validate(imageIds); + Validator.validate(tagIds); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + String imageIdsConverted = this.serializerAdapter().serializeList(imageIds, CollectionFormat.CSV);String tagIdsConverted = this.serializerAdapter().serializeList(tagIds, CollectionFormat.CSV); + return service.deleteImageTags(projectId, imageIdsConverted, tagIdsConverted, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteImageTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteImageTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create a set of image regions. + * This API accepts a batch of image regions, and optionally tags, to update existing images with region information. + There is a limit of 64 entries in the batch. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageRegionCreateSummary object if successful. + */ + public ImageRegionCreateSummary createImageRegions(UUID projectId) { + return createImageRegionsWithServiceResponseAsync(projectId).toBlocking().single().body(); + } + + /** + * Create a set of image regions. + * This API accepts a batch of image regions, and optionally tags, to update existing images with region information. + There is a limit of 64 entries in the batch. + * + * @param projectId The project id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createImageRegionsAsync(UUID projectId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createImageRegionsWithServiceResponseAsync(projectId), serviceCallback); + } + + /** + * Create a set of image regions. + * This API accepts a batch of image regions, and optionally tags, to update existing images with region information. + There is a limit of 64 entries in the batch. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageRegionCreateSummary object + */ + public Observable createImageRegionsAsync(UUID projectId) { + return createImageRegionsWithServiceResponseAsync(projectId).map(new Func1, ImageRegionCreateSummary>() { + @Override + public ImageRegionCreateSummary call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a set of image regions. + * This API accepts a batch of image regions, and optionally tags, to update existing images with region information. + There is a limit of 64 entries in the batch. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageRegionCreateSummary object + */ + public Observable> createImageRegionsWithServiceResponseAsync(UUID projectId) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + final List regions = null; + ImageRegionCreateBatch batch = new ImageRegionCreateBatch(); + batch.withRegions(null); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.createImageRegions(projectId, this.apiKey(), this.acceptLanguage(), batch, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createImageRegionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Create a set of image regions. + * This API accepts a batch of image regions, and optionally tags, to update existing images with region information. + There is a limit of 64 entries in the batch. + * + * @param projectId The project id. + * @param regions the List<ImageRegionCreateEntry> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageRegionCreateSummary object if successful. + */ + public ImageRegionCreateSummary createImageRegions(UUID projectId, List regions) { + return createImageRegionsWithServiceResponseAsync(projectId, regions).toBlocking().single().body(); + } + + /** + * Create a set of image regions. + * This API accepts a batch of image regions, and optionally tags, to update existing images with region information. + There is a limit of 64 entries in the batch. + * + * @param projectId The project id. + * @param regions the List<ImageRegionCreateEntry> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createImageRegionsAsync(UUID projectId, List regions, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createImageRegionsWithServiceResponseAsync(projectId, regions), serviceCallback); + } + + /** + * Create a set of image regions. + * This API accepts a batch of image regions, and optionally tags, to update existing images with region information. + There is a limit of 64 entries in the batch. + * + * @param projectId The project id. + * @param regions the List<ImageRegionCreateEntry> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageRegionCreateSummary object + */ + public Observable createImageRegionsAsync(UUID projectId, List regions) { + return createImageRegionsWithServiceResponseAsync(projectId, regions).map(new Func1, ImageRegionCreateSummary>() { + @Override + public ImageRegionCreateSummary call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a set of image regions. + * This API accepts a batch of image regions, and optionally tags, to update existing images with region information. + There is a limit of 64 entries in the batch. + * + * @param projectId The project id. + * @param regions the List<ImageRegionCreateEntry> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageRegionCreateSummary object + */ + public Observable> createImageRegionsWithServiceResponseAsync(UUID projectId, List regions) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + Validator.validate(regions); + ImageRegionCreateBatch batch = new ImageRegionCreateBatch(); + batch.withRegions(regions); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.createImageRegions(projectId, this.apiKey(), this.acceptLanguage(), batch, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createImageRegionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createImageRegionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete a set of image regions. + * + * @param projectId The project id. + * @param regionIds Regions to delete. Limited to 64. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteImageRegions(UUID projectId, List regionIds) { + deleteImageRegionsWithServiceResponseAsync(projectId, regionIds).toBlocking().single().body(); + } + + /** + * Delete a set of image regions. + * + * @param projectId The project id. + * @param regionIds Regions to delete. Limited to 64. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteImageRegionsAsync(UUID projectId, List regionIds, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteImageRegionsWithServiceResponseAsync(projectId, regionIds), serviceCallback); + } + + /** + * Delete a set of image regions. + * + * @param projectId The project id. + * @param regionIds Regions to delete. Limited to 64. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteImageRegionsAsync(UUID projectId, List regionIds) { + return deleteImageRegionsWithServiceResponseAsync(projectId, regionIds).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a set of image regions. + * + * @param projectId The project id. + * @param regionIds Regions to delete. Limited to 64. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteImageRegionsWithServiceResponseAsync(UUID projectId, List regionIds) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (regionIds == null) { + throw new IllegalArgumentException("Parameter regionIds is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + Validator.validate(regionIds); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + String regionIdsConverted = this.serializerAdapter().serializeList(regionIds, CollectionFormat.CSV); + return service.deleteImageRegions(projectId, regionIdsConverted, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteImageRegionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteImageRegionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get tagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Image> object if successful. + */ + public List getTaggedImages(UUID projectId) { + return getTaggedImagesWithServiceResponseAsync(projectId).toBlocking().single().body(); + } + + /** + * Get tagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getTaggedImagesAsync(UUID projectId, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getTaggedImagesWithServiceResponseAsync(projectId), serviceCallback); + } + + /** + * Get tagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Image> object + */ + public Observable> getTaggedImagesAsync(UUID projectId) { + return getTaggedImagesWithServiceResponseAsync(projectId).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get tagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Image> object + */ + public Observable>> getTaggedImagesWithServiceResponseAsync(UUID projectId) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + final UUID iterationId = null; + final List tagIds = null; + final String orderBy = null; + final Integer take = null; + final Integer skip = null; + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + String tagIdsConverted = this.serializerAdapter().serializeList(tagIds, CollectionFormat.CSV); + return service.getTaggedImages(projectId, iterationId, tagIdsConverted, orderBy, take, skip, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getTaggedImagesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get tagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images. Defaults to all tagged images when null. Limited to 20. + * @param orderBy The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest' + * @param take Maximum number of images to return. Defaults to 50, limited to 256. + * @param skip Number of images to skip before beginning the image batch. Defaults to 0. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Image> object if successful. + */ + public List getTaggedImages(UUID projectId, UUID iterationId, List tagIds, String orderBy, Integer take, Integer skip) { + return getTaggedImagesWithServiceResponseAsync(projectId, iterationId, tagIds, orderBy, take, skip).toBlocking().single().body(); + } + + /** + * Get tagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images. Defaults to all tagged images when null. Limited to 20. + * @param orderBy The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest' + * @param take Maximum number of images to return. Defaults to 50, limited to 256. + * @param skip Number of images to skip before beginning the image batch. Defaults to 0. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getTaggedImagesAsync(UUID projectId, UUID iterationId, List tagIds, String orderBy, Integer take, Integer skip, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getTaggedImagesWithServiceResponseAsync(projectId, iterationId, tagIds, orderBy, take, skip), serviceCallback); + } + + /** + * Get tagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images. Defaults to all tagged images when null. Limited to 20. + * @param orderBy The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest' + * @param take Maximum number of images to return. Defaults to 50, limited to 256. + * @param skip Number of images to skip before beginning the image batch. Defaults to 0. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Image> object + */ + public Observable> getTaggedImagesAsync(UUID projectId, UUID iterationId, List tagIds, String orderBy, Integer take, Integer skip) { + return getTaggedImagesWithServiceResponseAsync(projectId, iterationId, tagIds, orderBy, take, skip).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get tagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images. Defaults to all tagged images when null. Limited to 20. + * @param orderBy The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest' + * @param take Maximum number of images to return. Defaults to 50, limited to 256. + * @param skip Number of images to skip before beginning the image batch. Defaults to 0. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Image> object + */ + public Observable>> getTaggedImagesWithServiceResponseAsync(UUID projectId, UUID iterationId, List tagIds, String orderBy, Integer take, Integer skip) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + Validator.validate(tagIds); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + String tagIdsConverted = this.serializerAdapter().serializeList(tagIds, CollectionFormat.CSV); + return service.getTaggedImages(projectId, iterationId, tagIdsConverted, orderBy, take, skip, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getTaggedImagesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getTaggedImagesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., CloudException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get untagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Image> object if successful. + */ + public List getUntaggedImages(UUID projectId) { + return getUntaggedImagesWithServiceResponseAsync(projectId).toBlocking().single().body(); + } + + /** + * Get untagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + * + * @param projectId The project id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getUntaggedImagesAsync(UUID projectId, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getUntaggedImagesWithServiceResponseAsync(projectId), serviceCallback); + } + + /** + * Get untagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Image> object + */ + public Observable> getUntaggedImagesAsync(UUID projectId) { + return getUntaggedImagesWithServiceResponseAsync(projectId).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get untagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Image> object + */ + public Observable>> getUntaggedImagesWithServiceResponseAsync(UUID projectId) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + final UUID iterationId = null; + final String orderBy = null; + final Integer take = null; + final Integer skip = null; + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.getUntaggedImages(projectId, iterationId, orderBy, take, skip, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getUntaggedImagesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get untagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param orderBy The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest' + * @param take Maximum number of images to return. Defaults to 50, limited to 256. + * @param skip Number of images to skip before beginning the image batch. Defaults to 0. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Image> object if successful. + */ + public List getUntaggedImages(UUID projectId, UUID iterationId, String orderBy, Integer take, Integer skip) { + return getUntaggedImagesWithServiceResponseAsync(projectId, iterationId, orderBy, take, skip).toBlocking().single().body(); + } + + /** + * Get untagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param orderBy The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest' + * @param take Maximum number of images to return. Defaults to 50, limited to 256. + * @param skip Number of images to skip before beginning the image batch. Defaults to 0. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getUntaggedImagesAsync(UUID projectId, UUID iterationId, String orderBy, Integer take, Integer skip, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getUntaggedImagesWithServiceResponseAsync(projectId, iterationId, orderBy, take, skip), serviceCallback); + } + + /** + * Get untagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param orderBy The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest' + * @param take Maximum number of images to return. Defaults to 50, limited to 256. + * @param skip Number of images to skip before beginning the image batch. Defaults to 0. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Image> object + */ + public Observable> getUntaggedImagesAsync(UUID projectId, UUID iterationId, String orderBy, Integer take, Integer skip) { + return getUntaggedImagesWithServiceResponseAsync(projectId, iterationId, orderBy, take, skip).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get untagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param orderBy The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest' + * @param take Maximum number of images to return. Defaults to 50, limited to 256. + * @param skip Number of images to skip before beginning the image batch. Defaults to 0. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Image> object + */ + public Observable>> getUntaggedImagesWithServiceResponseAsync(UUID projectId, UUID iterationId, String orderBy, Integer take, Integer skip) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.getUntaggedImages(projectId, iterationId, orderBy, take, skip, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getUntaggedImagesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getUntaggedImagesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., CloudException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get images by id for a given project iteration. + * This API will return a set of Images for the specified tags and optionally iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Image> object if successful. + */ + public List getImagesByIds(UUID projectId) { + return getImagesByIdsWithServiceResponseAsync(projectId).toBlocking().single().body(); + } + + /** + * Get images by id for a given project iteration. + * This API will return a set of Images for the specified tags and optionally iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getImagesByIdsAsync(UUID projectId, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getImagesByIdsWithServiceResponseAsync(projectId), serviceCallback); + } + + /** + * Get images by id for a given project iteration. + * This API will return a set of Images for the specified tags and optionally iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Image> object + */ + public Observable> getImagesByIdsAsync(UUID projectId) { + return getImagesByIdsWithServiceResponseAsync(projectId).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get images by id for a given project iteration. + * This API will return a set of Images for the specified tags and optionally iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Image> object + */ + public Observable>> getImagesByIdsWithServiceResponseAsync(UUID projectId) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + final List imageIds = null; + final UUID iterationId = null; + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + String imageIdsConverted = this.serializerAdapter().serializeList(imageIds, CollectionFormat.CSV); + return service.getImagesByIds(projectId, imageIdsConverted, iterationId, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getImagesByIdsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get images by id for a given project iteration. + * This API will return a set of Images for the specified tags and optionally iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @param imageIds The list of image ids to retrieve. Limited to 256. + * @param iterationId The iteration id. Defaults to workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Image> object if successful. + */ + public List getImagesByIds(UUID projectId, List imageIds, UUID iterationId) { + return getImagesByIdsWithServiceResponseAsync(projectId, imageIds, iterationId).toBlocking().single().body(); + } + + /** + * Get images by id for a given project iteration. + * This API will return a set of Images for the specified tags and optionally iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @param imageIds The list of image ids to retrieve. Limited to 256. + * @param iterationId The iteration id. Defaults to workspace. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getImagesByIdsAsync(UUID projectId, List imageIds, UUID iterationId, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getImagesByIdsWithServiceResponseAsync(projectId, imageIds, iterationId), serviceCallback); + } + + /** + * Get images by id for a given project iteration. + * This API will return a set of Images for the specified tags and optionally iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @param imageIds The list of image ids to retrieve. Limited to 256. + * @param iterationId The iteration id. Defaults to workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Image> object + */ + public Observable> getImagesByIdsAsync(UUID projectId, List imageIds, UUID iterationId) { + return getImagesByIdsWithServiceResponseAsync(projectId, imageIds, iterationId).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get images by id for a given project iteration. + * This API will return a set of Images for the specified tags and optionally iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id. + * @param imageIds The list of image ids to retrieve. Limited to 256. + * @param iterationId The iteration id. Defaults to workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Image> object + */ + public Observable>> getImagesByIdsWithServiceResponseAsync(UUID projectId, List imageIds, UUID iterationId) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + Validator.validate(imageIds); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + String imageIdsConverted = this.serializerAdapter().serializeList(imageIds, CollectionFormat.CSV); + return service.getImagesByIds(projectId, imageIdsConverted, iterationId, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getImagesByIdsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getImagesByIdsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., CloudException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Add the provided images to the set of training images. + * This API accepts body content as multipart/form-data and application/octet-stream. When using multipart + multiple image files can be sent at once, with a maximum of 64 files. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageCreateSummary object if successful. + */ + public ImageCreateSummary createImagesFromData(UUID projectId, byte[] imageData) { + return createImagesFromDataWithServiceResponseAsync(projectId, imageData).toBlocking().single().body(); + } + + /** + * Add the provided images to the set of training images. + * This API accepts body content as multipart/form-data and application/octet-stream. When using multipart + multiple image files can be sent at once, with a maximum of 64 files. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createImagesFromDataAsync(UUID projectId, byte[] imageData, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createImagesFromDataWithServiceResponseAsync(projectId, imageData), serviceCallback); + } + + /** + * Add the provided images to the set of training images. + * This API accepts body content as multipart/form-data and application/octet-stream. When using multipart + multiple image files can be sent at once, with a maximum of 64 files. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageCreateSummary object + */ + public Observable createImagesFromDataAsync(UUID projectId, byte[] imageData) { + return createImagesFromDataWithServiceResponseAsync(projectId, imageData).map(new Func1, ImageCreateSummary>() { + @Override + public ImageCreateSummary call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Add the provided images to the set of training images. + * This API accepts body content as multipart/form-data and application/octet-stream. When using multipart + multiple image files can be sent at once, with a maximum of 64 files. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageCreateSummary object + */ + public Observable> createImagesFromDataWithServiceResponseAsync(UUID projectId, byte[] imageData) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (imageData == null) { + throw new IllegalArgumentException("Parameter imageData is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + final List tagIds = null; + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + String tagIdsConverted = this.serializerAdapter().serializeList(tagIds, CollectionFormat.CSV);RequestBody imageDataConverted = RequestBody.create(MediaType.parse("multipart/form-data"), imageData); + return service.createImagesFromData(projectId, tagIdsConverted, imageDataConverted, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createImagesFromDataDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Add the provided images to the set of training images. + * This API accepts body content as multipart/form-data and application/octet-stream. When using multipart + multiple image files can be sent at once, with a maximum of 64 files. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @param tagIds The tags ids with which to tag each image. Limited to 20. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageCreateSummary object if successful. + */ + public ImageCreateSummary createImagesFromData(UUID projectId, byte[] imageData, List tagIds) { + return createImagesFromDataWithServiceResponseAsync(projectId, imageData, tagIds).toBlocking().single().body(); + } + + /** + * Add the provided images to the set of training images. + * This API accepts body content as multipart/form-data and application/octet-stream. When using multipart + multiple image files can be sent at once, with a maximum of 64 files. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @param tagIds The tags ids with which to tag each image. Limited to 20. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createImagesFromDataAsync(UUID projectId, byte[] imageData, List tagIds, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createImagesFromDataWithServiceResponseAsync(projectId, imageData, tagIds), serviceCallback); + } + + /** + * Add the provided images to the set of training images. + * This API accepts body content as multipart/form-data and application/octet-stream. When using multipart + multiple image files can be sent at once, with a maximum of 64 files. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @param tagIds The tags ids with which to tag each image. Limited to 20. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageCreateSummary object + */ + public Observable createImagesFromDataAsync(UUID projectId, byte[] imageData, List tagIds) { + return createImagesFromDataWithServiceResponseAsync(projectId, imageData, tagIds).map(new Func1, ImageCreateSummary>() { + @Override + public ImageCreateSummary call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Add the provided images to the set of training images. + * This API accepts body content as multipart/form-data and application/octet-stream. When using multipart + multiple image files can be sent at once, with a maximum of 64 files. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @param tagIds The tags ids with which to tag each image. Limited to 20. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageCreateSummary object + */ + public Observable> createImagesFromDataWithServiceResponseAsync(UUID projectId, byte[] imageData, List tagIds) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (imageData == null) { + throw new IllegalArgumentException("Parameter imageData is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + Validator.validate(tagIds); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + String tagIdsConverted = this.serializerAdapter().serializeList(tagIds, CollectionFormat.CSV);RequestBody imageDataConverted = RequestBody.create(MediaType.parse("multipart/form-data"), imageData); + return service.createImagesFromData(projectId, tagIdsConverted, imageDataConverted, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createImagesFromDataDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createImagesFromDataDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete images from the set of training images. + * + * @param projectId The project id. + * @param imageIds Ids of the images to be deleted. Limited to 256 images per batch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteImages(UUID projectId, List imageIds) { + deleteImagesWithServiceResponseAsync(projectId, imageIds).toBlocking().single().body(); + } + + /** + * Delete images from the set of training images. + * + * @param projectId The project id. + * @param imageIds Ids of the images to be deleted. Limited to 256 images per batch. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteImagesAsync(UUID projectId, List imageIds, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteImagesWithServiceResponseAsync(projectId, imageIds), serviceCallback); + } + + /** + * Delete images from the set of training images. + * + * @param projectId The project id. + * @param imageIds Ids of the images to be deleted. Limited to 256 images per batch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteImagesAsync(UUID projectId, List imageIds) { + return deleteImagesWithServiceResponseAsync(projectId, imageIds).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete images from the set of training images. + * + * @param projectId The project id. + * @param imageIds Ids of the images to be deleted. Limited to 256 images per batch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteImagesWithServiceResponseAsync(UUID projectId, List imageIds) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (imageIds == null) { + throw new IllegalArgumentException("Parameter imageIds is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + Validator.validate(imageIds); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + String imageIdsConverted = this.serializerAdapter().serializeList(imageIds, CollectionFormat.CSV); + return service.deleteImages(projectId, imageIdsConverted, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteImagesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteImagesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Add the provided batch of images to the set of training images. + * This API accepts a batch of files, and optionally tags, to create images. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id. + * @param batch The batch of image files to add. Limited to 64 images and 20 tags per batch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageCreateSummary object if successful. + */ + public ImageCreateSummary createImagesFromFiles(UUID projectId, ImageFileCreateBatch batch) { + return createImagesFromFilesWithServiceResponseAsync(projectId, batch).toBlocking().single().body(); + } + + /** + * Add the provided batch of images to the set of training images. + * This API accepts a batch of files, and optionally tags, to create images. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id. + * @param batch The batch of image files to add. Limited to 64 images and 20 tags per batch. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createImagesFromFilesAsync(UUID projectId, ImageFileCreateBatch batch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createImagesFromFilesWithServiceResponseAsync(projectId, batch), serviceCallback); + } + + /** + * Add the provided batch of images to the set of training images. + * This API accepts a batch of files, and optionally tags, to create images. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id. + * @param batch The batch of image files to add. Limited to 64 images and 20 tags per batch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageCreateSummary object + */ + public Observable createImagesFromFilesAsync(UUID projectId, ImageFileCreateBatch batch) { + return createImagesFromFilesWithServiceResponseAsync(projectId, batch).map(new Func1, ImageCreateSummary>() { + @Override + public ImageCreateSummary call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Add the provided batch of images to the set of training images. + * This API accepts a batch of files, and optionally tags, to create images. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id. + * @param batch The batch of image files to add. Limited to 64 images and 20 tags per batch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageCreateSummary object + */ + public Observable> createImagesFromFilesWithServiceResponseAsync(UUID projectId, ImageFileCreateBatch batch) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (batch == null) { + throw new IllegalArgumentException("Parameter batch is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + Validator.validate(batch); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.createImagesFromFiles(projectId, batch, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createImagesFromFilesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createImagesFromFilesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Add the provided images urls to the set of training images. + * This API accepts a batch of urls, and optionally tags, to create images. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id. + * @param batch Image urls and tag ids. Limited to 64 images and 20 tags per batch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageCreateSummary object if successful. + */ + public ImageCreateSummary createImagesFromUrls(UUID projectId, ImageUrlCreateBatch batch) { + return createImagesFromUrlsWithServiceResponseAsync(projectId, batch).toBlocking().single().body(); + } + + /** + * Add the provided images urls to the set of training images. + * This API accepts a batch of urls, and optionally tags, to create images. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id. + * @param batch Image urls and tag ids. Limited to 64 images and 20 tags per batch. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createImagesFromUrlsAsync(UUID projectId, ImageUrlCreateBatch batch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createImagesFromUrlsWithServiceResponseAsync(projectId, batch), serviceCallback); + } + + /** + * Add the provided images urls to the set of training images. + * This API accepts a batch of urls, and optionally tags, to create images. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id. + * @param batch Image urls and tag ids. Limited to 64 images and 20 tags per batch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageCreateSummary object + */ + public Observable createImagesFromUrlsAsync(UUID projectId, ImageUrlCreateBatch batch) { + return createImagesFromUrlsWithServiceResponseAsync(projectId, batch).map(new Func1, ImageCreateSummary>() { + @Override + public ImageCreateSummary call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Add the provided images urls to the set of training images. + * This API accepts a batch of urls, and optionally tags, to create images. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id. + * @param batch Image urls and tag ids. Limited to 64 images and 20 tags per batch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageCreateSummary object + */ + public Observable> createImagesFromUrlsWithServiceResponseAsync(UUID projectId, ImageUrlCreateBatch batch) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (batch == null) { + throw new IllegalArgumentException("Parameter batch is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + Validator.validate(batch); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.createImagesFromUrls(projectId, batch, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createImagesFromUrlsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createImagesFromUrlsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Add the specified predicted images to the set of training images. + * This API creates a batch of images from predicted images specified. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id. + * @param batch Image and tag ids. Limited to 64 images and 20 tags per batch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageCreateSummary object if successful. + */ + public ImageCreateSummary createImagesFromPredictions(UUID projectId, ImageIdCreateBatch batch) { + return createImagesFromPredictionsWithServiceResponseAsync(projectId, batch).toBlocking().single().body(); + } + + /** + * Add the specified predicted images to the set of training images. + * This API creates a batch of images from predicted images specified. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id. + * @param batch Image and tag ids. Limited to 64 images and 20 tags per batch. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createImagesFromPredictionsAsync(UUID projectId, ImageIdCreateBatch batch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createImagesFromPredictionsWithServiceResponseAsync(projectId, batch), serviceCallback); + } + + /** + * Add the specified predicted images to the set of training images. + * This API creates a batch of images from predicted images specified. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id. + * @param batch Image and tag ids. Limited to 64 images and 20 tags per batch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageCreateSummary object + */ + public Observable createImagesFromPredictionsAsync(UUID projectId, ImageIdCreateBatch batch) { + return createImagesFromPredictionsWithServiceResponseAsync(projectId, batch).map(new Func1, ImageCreateSummary>() { + @Override + public ImageCreateSummary call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Add the specified predicted images to the set of training images. + * This API creates a batch of images from predicted images specified. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id. + * @param batch Image and tag ids. Limited to 64 images and 20 tags per batch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageCreateSummary object + */ + public Observable> createImagesFromPredictionsWithServiceResponseAsync(UUID projectId, ImageIdCreateBatch batch) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (batch == null) { + throw new IllegalArgumentException("Parameter batch is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + Validator.validate(batch); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.createImagesFromPredictions(projectId, batch, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createImagesFromPredictionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createImagesFromPredictionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get region proposals for an image. Returns empty array if no proposals are found. + * This API will get region proposals for an image along with confidences for the region. It returns an empty array if no proposals are found. + * + * @param projectId The project id. + * @param imageId The image id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageRegionProposal object if successful. + */ + public ImageRegionProposal getImageRegionProposals(UUID projectId, UUID imageId) { + return getImageRegionProposalsWithServiceResponseAsync(projectId, imageId).toBlocking().single().body(); + } + + /** + * Get region proposals for an image. Returns empty array if no proposals are found. + * This API will get region proposals for an image along with confidences for the region. It returns an empty array if no proposals are found. + * + * @param projectId The project id. + * @param imageId The image id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getImageRegionProposalsAsync(UUID projectId, UUID imageId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getImageRegionProposalsWithServiceResponseAsync(projectId, imageId), serviceCallback); + } + + /** + * Get region proposals for an image. Returns empty array if no proposals are found. + * This API will get region proposals for an image along with confidences for the region. It returns an empty array if no proposals are found. + * + * @param projectId The project id. + * @param imageId The image id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageRegionProposal object + */ + public Observable getImageRegionProposalsAsync(UUID projectId, UUID imageId) { + return getImageRegionProposalsWithServiceResponseAsync(projectId, imageId).map(new Func1, ImageRegionProposal>() { + @Override + public ImageRegionProposal call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get region proposals for an image. Returns empty array if no proposals are found. + * This API will get region proposals for an image along with confidences for the region. It returns an empty array if no proposals are found. + * + * @param projectId The project id. + * @param imageId The image id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageRegionProposal object + */ + public Observable> getImageRegionProposalsWithServiceResponseAsync(UUID projectId, UUID imageId) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (imageId == null) { + throw new IllegalArgumentException("Parameter imageId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.getImageRegionProposals(projectId, imageId, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getImageRegionProposalsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getImageRegionProposalsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete a set of predicted images and their associated prediction results. + * + * @param projectId The project id. + * @param ids The prediction ids. Limited to 64. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deletePrediction(UUID projectId, List ids) { + deletePredictionWithServiceResponseAsync(projectId, ids).toBlocking().single().body(); + } + + /** + * Delete a set of predicted images and their associated prediction results. + * + * @param projectId The project id. + * @param ids The prediction ids. Limited to 64. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deletePredictionAsync(UUID projectId, List ids, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deletePredictionWithServiceResponseAsync(projectId, ids), serviceCallback); + } + + /** + * Delete a set of predicted images and their associated prediction results. + * + * @param projectId The project id. + * @param ids The prediction ids. Limited to 64. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deletePredictionAsync(UUID projectId, List ids) { + return deletePredictionWithServiceResponseAsync(projectId, ids).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a set of predicted images and their associated prediction results. + * + * @param projectId The project id. + * @param ids The prediction ids. Limited to 64. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deletePredictionWithServiceResponseAsync(UUID projectId, List ids) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (ids == null) { + throw new IllegalArgumentException("Parameter ids is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + Validator.validate(ids); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + String idsConverted = this.serializerAdapter().serializeList(ids, CollectionFormat.CSV); + return service.deletePrediction(projectId, idsConverted, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deletePredictionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deletePredictionDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Quick test an image url. + * + * @param projectId The project to evaluate against. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + public ImagePrediction quickTestImageUrl(UUID projectId) { + return quickTestImageUrlWithServiceResponseAsync(projectId).toBlocking().single().body(); + } + + /** + * Quick test an image url. + * + * @param projectId The project to evaluate against. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture quickTestImageUrlAsync(UUID projectId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(quickTestImageUrlWithServiceResponseAsync(projectId), serviceCallback); + } + + /** + * Quick test an image url. + * + * @param projectId The project to evaluate against. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable quickTestImageUrlAsync(UUID projectId) { + return quickTestImageUrlWithServiceResponseAsync(projectId).map(new Func1, ImagePrediction>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Quick test an image url. + * + * @param projectId The project to evaluate against. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable> quickTestImageUrlWithServiceResponseAsync(UUID projectId) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + final UUID iterationId = null; + final String url = null; + ImageUrl imageUrl = new ImageUrl(); + imageUrl.withUrl(null); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.quickTestImageUrl(projectId, iterationId, this.apiKey(), this.acceptLanguage(), imageUrl, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = quickTestImageUrlDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Quick test an image url. + * + * @param projectId The project to evaluate against. + * @param iterationId Optional. Specifies the id of a particular iteration to evaluate against. + The default iteration for the project will be used when not specified. + * @param url the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + public ImagePrediction quickTestImageUrl(UUID projectId, UUID iterationId, String url) { + return quickTestImageUrlWithServiceResponseAsync(projectId, iterationId, url).toBlocking().single().body(); + } + + /** + * Quick test an image url. + * + * @param projectId The project to evaluate against. + * @param iterationId Optional. Specifies the id of a particular iteration to evaluate against. + The default iteration for the project will be used when not specified. + * @param url the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture quickTestImageUrlAsync(UUID projectId, UUID iterationId, String url, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(quickTestImageUrlWithServiceResponseAsync(projectId, iterationId, url), serviceCallback); + } + + /** + * Quick test an image url. + * + * @param projectId The project to evaluate against. + * @param iterationId Optional. Specifies the id of a particular iteration to evaluate against. + The default iteration for the project will be used when not specified. + * @param url the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable quickTestImageUrlAsync(UUID projectId, UUID iterationId, String url) { + return quickTestImageUrlWithServiceResponseAsync(projectId, iterationId, url).map(new Func1, ImagePrediction>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Quick test an image url. + * + * @param projectId The project to evaluate against. + * @param iterationId Optional. Specifies the id of a particular iteration to evaluate against. + The default iteration for the project will be used when not specified. + * @param url the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable> quickTestImageUrlWithServiceResponseAsync(UUID projectId, UUID iterationId, String url) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + ImageUrl imageUrl = new ImageUrl(); + imageUrl.withUrl(url); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.quickTestImageUrl(projectId, iterationId, this.apiKey(), this.acceptLanguage(), imageUrl, parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = quickTestImageUrlDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse quickTestImageUrlDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Quick test an image. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + public ImagePrediction quickTestImage(UUID projectId, byte[] imageData) { + return quickTestImageWithServiceResponseAsync(projectId, imageData).toBlocking().single().body(); + } + + /** + * Quick test an image. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture quickTestImageAsync(UUID projectId, byte[] imageData, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(quickTestImageWithServiceResponseAsync(projectId, imageData), serviceCallback); + } + + /** + * Quick test an image. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable quickTestImageAsync(UUID projectId, byte[] imageData) { + return quickTestImageWithServiceResponseAsync(projectId, imageData).map(new Func1, ImagePrediction>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Quick test an image. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable> quickTestImageWithServiceResponseAsync(UUID projectId, byte[] imageData) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (imageData == null) { + throw new IllegalArgumentException("Parameter imageData is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + final UUID iterationId = null; + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + RequestBody imageDataConverted = RequestBody.create(MediaType.parse("multipart/form-data"), imageData); + return service.quickTestImage(projectId, iterationId, imageDataConverted, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = quickTestImageDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Quick test an image. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @param iterationId Optional. Specifies the id of a particular iteration to evaluate against. + The default iteration for the project will be used when not specified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + public ImagePrediction quickTestImage(UUID projectId, byte[] imageData, UUID iterationId) { + return quickTestImageWithServiceResponseAsync(projectId, imageData, iterationId).toBlocking().single().body(); + } + + /** + * Quick test an image. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @param iterationId Optional. Specifies the id of a particular iteration to evaluate against. + The default iteration for the project will be used when not specified. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture quickTestImageAsync(UUID projectId, byte[] imageData, UUID iterationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(quickTestImageWithServiceResponseAsync(projectId, imageData, iterationId), serviceCallback); + } + + /** + * Quick test an image. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @param iterationId Optional. Specifies the id of a particular iteration to evaluate against. + The default iteration for the project will be used when not specified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable quickTestImageAsync(UUID projectId, byte[] imageData, UUID iterationId) { + return quickTestImageWithServiceResponseAsync(projectId, imageData, iterationId).map(new Func1, ImagePrediction>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Quick test an image. + * + * @param projectId The project id. + * @param imageData Binary image data. + * @param iterationId Optional. Specifies the id of a particular iteration to evaluate against. + The default iteration for the project will be used when not specified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable> quickTestImageWithServiceResponseAsync(UUID projectId, byte[] imageData, UUID iterationId) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (imageData == null) { + throw new IllegalArgumentException("Parameter imageData is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + RequestBody imageDataConverted = RequestBody.create(MediaType.parse("multipart/form-data"), imageData); + return service.quickTestImage(projectId, iterationId, imageDataConverted, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = quickTestImageDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse quickTestImageDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get images that were sent to your prediction endpoint. + * + * @param projectId The project id. + * @param query Parameters used to query the predictions. Limited to combining 2 tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PredictionQueryResult object if successful. + */ + public PredictionQueryResult queryPredictions(UUID projectId, PredictionQueryToken query) { + return queryPredictionsWithServiceResponseAsync(projectId, query).toBlocking().single().body(); + } + + /** + * Get images that were sent to your prediction endpoint. + * + * @param projectId The project id. + * @param query Parameters used to query the predictions. Limited to combining 2 tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture queryPredictionsAsync(UUID projectId, PredictionQueryToken query, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(queryPredictionsWithServiceResponseAsync(projectId, query), serviceCallback); + } + + /** + * Get images that were sent to your prediction endpoint. + * + * @param projectId The project id. + * @param query Parameters used to query the predictions. Limited to combining 2 tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PredictionQueryResult object + */ + public Observable queryPredictionsAsync(UUID projectId, PredictionQueryToken query) { + return queryPredictionsWithServiceResponseAsync(projectId, query).map(new Func1, PredictionQueryResult>() { + @Override + public PredictionQueryResult call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get images that were sent to your prediction endpoint. + * + * @param projectId The project id. + * @param query Parameters used to query the predictions. Limited to combining 2 tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PredictionQueryResult object + */ + public Observable> queryPredictionsWithServiceResponseAsync(UUID projectId, PredictionQueryToken query) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (query == null) { + throw new IllegalArgumentException("Parameter query is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + Validator.validate(query); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.queryPredictions(projectId, query, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = queryPredictionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse queryPredictionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get detailed performance information about an iteration. + * + * @param projectId The id of the project the iteration belongs to. + * @param iterationId The id of the iteration to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IterationPerformance object if successful. + */ + public IterationPerformance getIterationPerformance(UUID projectId, UUID iterationId) { + return getIterationPerformanceWithServiceResponseAsync(projectId, iterationId).toBlocking().single().body(); + } + + /** + * Get detailed performance information about an iteration. + * + * @param projectId The id of the project the iteration belongs to. + * @param iterationId The id of the iteration to get. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getIterationPerformanceAsync(UUID projectId, UUID iterationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getIterationPerformanceWithServiceResponseAsync(projectId, iterationId), serviceCallback); + } + + /** + * Get detailed performance information about an iteration. + * + * @param projectId The id of the project the iteration belongs to. + * @param iterationId The id of the iteration to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IterationPerformance object + */ + public Observable getIterationPerformanceAsync(UUID projectId, UUID iterationId) { + return getIterationPerformanceWithServiceResponseAsync(projectId, iterationId).map(new Func1, IterationPerformance>() { + @Override + public IterationPerformance call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get detailed performance information about an iteration. + * + * @param projectId The id of the project the iteration belongs to. + * @param iterationId The id of the iteration to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IterationPerformance object + */ + public Observable> getIterationPerformanceWithServiceResponseAsync(UUID projectId, UUID iterationId) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (iterationId == null) { + throw new IllegalArgumentException("Parameter iterationId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + final Double threshold = null; + final Double overlapThreshold = null; + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.getIterationPerformance(projectId, iterationId, threshold, overlapThreshold, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getIterationPerformanceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get detailed performance information about an iteration. + * + * @param projectId The id of the project the iteration belongs to. + * @param iterationId The id of the iteration to get. + * @param threshold The threshold used to determine true predictions. + * @param overlapThreshold If applicable, the bounding box overlap threshold used to determine true predictions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IterationPerformance object if successful. + */ + public IterationPerformance getIterationPerformance(UUID projectId, UUID iterationId, Double threshold, Double overlapThreshold) { + return getIterationPerformanceWithServiceResponseAsync(projectId, iterationId, threshold, overlapThreshold).toBlocking().single().body(); + } + + /** + * Get detailed performance information about an iteration. + * + * @param projectId The id of the project the iteration belongs to. + * @param iterationId The id of the iteration to get. + * @param threshold The threshold used to determine true predictions. + * @param overlapThreshold If applicable, the bounding box overlap threshold used to determine true predictions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getIterationPerformanceAsync(UUID projectId, UUID iterationId, Double threshold, Double overlapThreshold, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getIterationPerformanceWithServiceResponseAsync(projectId, iterationId, threshold, overlapThreshold), serviceCallback); + } + + /** + * Get detailed performance information about an iteration. + * + * @param projectId The id of the project the iteration belongs to. + * @param iterationId The id of the iteration to get. + * @param threshold The threshold used to determine true predictions. + * @param overlapThreshold If applicable, the bounding box overlap threshold used to determine true predictions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IterationPerformance object + */ + public Observable getIterationPerformanceAsync(UUID projectId, UUID iterationId, Double threshold, Double overlapThreshold) { + return getIterationPerformanceWithServiceResponseAsync(projectId, iterationId, threshold, overlapThreshold).map(new Func1, IterationPerformance>() { + @Override + public IterationPerformance call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get detailed performance information about an iteration. + * + * @param projectId The id of the project the iteration belongs to. + * @param iterationId The id of the iteration to get. + * @param threshold The threshold used to determine true predictions. + * @param overlapThreshold If applicable, the bounding box overlap threshold used to determine true predictions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IterationPerformance object + */ + public Observable> getIterationPerformanceWithServiceResponseAsync(UUID projectId, UUID iterationId, Double threshold, Double overlapThreshold) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (iterationId == null) { + throw new IllegalArgumentException("Parameter iterationId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.getIterationPerformance(projectId, iterationId, threshold, overlapThreshold, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getIterationPerformanceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getIterationPerformanceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get image with its prediction for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ImagePerformance> object if successful. + */ + public List getImagePerformances(UUID projectId, UUID iterationId) { + return getImagePerformancesWithServiceResponseAsync(projectId, iterationId).toBlocking().single().body(); + } + + /** + * Get image with its prediction for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getImagePerformancesAsync(UUID projectId, UUID iterationId, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getImagePerformancesWithServiceResponseAsync(projectId, iterationId), serviceCallback); + } + + /** + * Get image with its prediction for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ImagePerformance> object + */ + public Observable> getImagePerformancesAsync(UUID projectId, UUID iterationId) { + return getImagePerformancesWithServiceResponseAsync(projectId, iterationId).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get image with its prediction for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ImagePerformance> object + */ + public Observable>> getImagePerformancesWithServiceResponseAsync(UUID projectId, UUID iterationId) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (iterationId == null) { + throw new IllegalArgumentException("Parameter iterationId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + final List tagIds = null; + final String orderBy = null; + final Integer take = null; + final Integer skip = null; + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + String tagIdsConverted = this.serializerAdapter().serializeList(tagIds, CollectionFormat.CSV); + return service.getImagePerformances(projectId, iterationId, tagIdsConverted, orderBy, take, skip, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getImagePerformancesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get image with its prediction for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images. Defaults to all tagged images when null. Limited to 20. + * @param orderBy The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest' + * @param take Maximum number of images to return. Defaults to 50, limited to 256. + * @param skip Number of images to skip before beginning the image batch. Defaults to 0. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ImagePerformance> object if successful. + */ + public List getImagePerformances(UUID projectId, UUID iterationId, List tagIds, String orderBy, Integer take, Integer skip) { + return getImagePerformancesWithServiceResponseAsync(projectId, iterationId, tagIds, orderBy, take, skip).toBlocking().single().body(); + } + + /** + * Get image with its prediction for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images. Defaults to all tagged images when null. Limited to 20. + * @param orderBy The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest' + * @param take Maximum number of images to return. Defaults to 50, limited to 256. + * @param skip Number of images to skip before beginning the image batch. Defaults to 0. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getImagePerformancesAsync(UUID projectId, UUID iterationId, List tagIds, String orderBy, Integer take, Integer skip, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getImagePerformancesWithServiceResponseAsync(projectId, iterationId, tagIds, orderBy, take, skip), serviceCallback); + } + + /** + * Get image with its prediction for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images. Defaults to all tagged images when null. Limited to 20. + * @param orderBy The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest' + * @param take Maximum number of images to return. Defaults to 50, limited to 256. + * @param skip Number of images to skip before beginning the image batch. Defaults to 0. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ImagePerformance> object + */ + public Observable> getImagePerformancesAsync(UUID projectId, UUID iterationId, List tagIds, String orderBy, Integer take, Integer skip) { + return getImagePerformancesWithServiceResponseAsync(projectId, iterationId, tagIds, orderBy, take, skip).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get image with its prediction for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images. Defaults to all tagged images when null. Limited to 20. + * @param orderBy The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest' + * @param take Maximum number of images to return. Defaults to 50, limited to 256. + * @param skip Number of images to skip before beginning the image batch. Defaults to 0. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ImagePerformance> object + */ + public Observable>> getImagePerformancesWithServiceResponseAsync(UUID projectId, UUID iterationId, List tagIds, String orderBy, Integer take, Integer skip) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (iterationId == null) { + throw new IllegalArgumentException("Parameter iterationId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + Validator.validate(tagIds); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + String tagIdsConverted = this.serializerAdapter().serializeList(tagIds, CollectionFormat.CSV); + return service.getImagePerformances(projectId, iterationId, tagIdsConverted, orderBy, take, skip, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getImagePerformancesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getImagePerformancesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., CloudException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the number of images tagged with the provided {tagIds} that have prediction results from + training for the provided iteration {iterationId}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the int object if successful. + */ + public int getImagePerformanceCount(UUID projectId, UUID iterationId) { + return getImagePerformanceCountWithServiceResponseAsync(projectId, iterationId).toBlocking().single().body(); + } + + /** + * Gets the number of images tagged with the provided {tagIds} that have prediction results from + training for the provided iteration {iterationId}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getImagePerformanceCountAsync(UUID projectId, UUID iterationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getImagePerformanceCountWithServiceResponseAsync(projectId, iterationId), serviceCallback); + } + + /** + * Gets the number of images tagged with the provided {tagIds} that have prediction results from + training for the provided iteration {iterationId}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Integer object + */ + public Observable getImagePerformanceCountAsync(UUID projectId, UUID iterationId) { + return getImagePerformanceCountWithServiceResponseAsync(projectId, iterationId).map(new Func1, Integer>() { + @Override + public Integer call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the number of images tagged with the provided {tagIds} that have prediction results from + training for the provided iteration {iterationId}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Integer object + */ + public Observable> getImagePerformanceCountWithServiceResponseAsync(UUID projectId, UUID iterationId) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (iterationId == null) { + throw new IllegalArgumentException("Parameter iterationId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + final List tagIds = null; + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + String tagIdsConverted = this.serializerAdapter().serializeList(tagIds, CollectionFormat.CSV); + return service.getImagePerformanceCount(projectId, iterationId, tagIdsConverted, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getImagePerformanceCountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the number of images tagged with the provided {tagIds} that have prediction results from + training for the provided iteration {iterationId}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images to count. Defaults to all tags when null. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the int object if successful. + */ + public int getImagePerformanceCount(UUID projectId, UUID iterationId, List tagIds) { + return getImagePerformanceCountWithServiceResponseAsync(projectId, iterationId, tagIds).toBlocking().single().body(); + } + + /** + * Gets the number of images tagged with the provided {tagIds} that have prediction results from + training for the provided iteration {iterationId}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images to count. Defaults to all tags when null. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getImagePerformanceCountAsync(UUID projectId, UUID iterationId, List tagIds, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getImagePerformanceCountWithServiceResponseAsync(projectId, iterationId, tagIds), serviceCallback); + } + + /** + * Gets the number of images tagged with the provided {tagIds} that have prediction results from + training for the provided iteration {iterationId}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images to count. Defaults to all tags when null. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Integer object + */ + public Observable getImagePerformanceCountAsync(UUID projectId, UUID iterationId, List tagIds) { + return getImagePerformanceCountWithServiceResponseAsync(projectId, iterationId, tagIds).map(new Func1, Integer>() { + @Override + public Integer call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the number of images tagged with the provided {tagIds} that have prediction results from + training for the provided iteration {iterationId}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param tagIds A list of tags ids to filter the images to count. Defaults to all tags when null. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Integer object + */ + public Observable> getImagePerformanceCountWithServiceResponseAsync(UUID projectId, UUID iterationId, List tagIds) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (iterationId == null) { + throw new IllegalArgumentException("Parameter iterationId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + Validator.validate(tagIds); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + String tagIdsConverted = this.serializerAdapter().serializeList(tagIds, CollectionFormat.CSV); + return service.getImagePerformanceCount(projectId, iterationId, tagIdsConverted, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getImagePerformanceCountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getImagePerformanceCountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get your projects. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Project> object if successful. + */ + public List getProjects() { + return getProjectsWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get your projects. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getProjectsAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getProjectsWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get your projects. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Project> object + */ + public Observable> getProjectsAsync() { + return getProjectsWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get your projects. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Project> object + */ + public Observable>> getProjectsWithServiceResponseAsync() { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.getProjects(this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getProjectsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getProjectsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., CloudException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create a project. + * + * @param name Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Project object if successful. + */ + public Project createProject(String name) { + return createProjectWithServiceResponseAsync(name).toBlocking().single().body(); + } + + /** + * Create a project. + * + * @param name Name of the project. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createProjectAsync(String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createProjectWithServiceResponseAsync(name), serviceCallback); + } + + /** + * Create a project. + * + * @param name Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Project object + */ + public Observable createProjectAsync(String name) { + return createProjectWithServiceResponseAsync(name).map(new Func1, Project>() { + @Override + public Project call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a project. + * + * @param name Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Project object + */ + public Observable> createProjectWithServiceResponseAsync(String name) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + final String description = null; + final UUID domainId = null; + final String classificationType = null; + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.createProject(name, description, domainId, classificationType, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createProjectDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Create a project. + * + * @param name Name of the project. + * @param description The description of the project. + * @param domainId The id of the domain to use for this project. Defaults to General. + * @param classificationType The type of classifier to create for this project. Possible values include: 'Multiclass', 'Multilabel' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Project object if successful. + */ + public Project createProject(String name, String description, UUID domainId, String classificationType) { + return createProjectWithServiceResponseAsync(name, description, domainId, classificationType).toBlocking().single().body(); + } + + /** + * Create a project. + * + * @param name Name of the project. + * @param description The description of the project. + * @param domainId The id of the domain to use for this project. Defaults to General. + * @param classificationType The type of classifier to create for this project. Possible values include: 'Multiclass', 'Multilabel' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createProjectAsync(String name, String description, UUID domainId, String classificationType, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createProjectWithServiceResponseAsync(name, description, domainId, classificationType), serviceCallback); + } + + /** + * Create a project. + * + * @param name Name of the project. + * @param description The description of the project. + * @param domainId The id of the domain to use for this project. Defaults to General. + * @param classificationType The type of classifier to create for this project. Possible values include: 'Multiclass', 'Multilabel' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Project object + */ + public Observable createProjectAsync(String name, String description, UUID domainId, String classificationType) { + return createProjectWithServiceResponseAsync(name, description, domainId, classificationType).map(new Func1, Project>() { + @Override + public Project call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a project. + * + * @param name Name of the project. + * @param description The description of the project. + * @param domainId The id of the domain to use for this project. Defaults to General. + * @param classificationType The type of classifier to create for this project. Possible values include: 'Multiclass', 'Multilabel' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Project object + */ + public Observable> createProjectWithServiceResponseAsync(String name, String description, UUID domainId, String classificationType) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.createProject(name, description, domainId, classificationType, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createProjectDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createProjectDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a specific project. + * + * @param projectId The id of the project to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Project object if successful. + */ + public Project getProject(UUID projectId) { + return getProjectWithServiceResponseAsync(projectId).toBlocking().single().body(); + } + + /** + * Get a specific project. + * + * @param projectId The id of the project to get. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getProjectAsync(UUID projectId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getProjectWithServiceResponseAsync(projectId), serviceCallback); + } + + /** + * Get a specific project. + * + * @param projectId The id of the project to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Project object + */ + public Observable getProjectAsync(UUID projectId) { + return getProjectWithServiceResponseAsync(projectId).map(new Func1, Project>() { + @Override + public Project call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a specific project. + * + * @param projectId The id of the project to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Project object + */ + public Observable> getProjectWithServiceResponseAsync(UUID projectId) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.getProject(projectId, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getProjectDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getProjectDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete a specific project. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteProject(UUID projectId) { + deleteProjectWithServiceResponseAsync(projectId).toBlocking().single().body(); + } + + /** + * Delete a specific project. + * + * @param projectId The project id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteProjectAsync(UUID projectId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteProjectWithServiceResponseAsync(projectId), serviceCallback); + } + + /** + * Delete a specific project. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteProjectAsync(UUID projectId) { + return deleteProjectWithServiceResponseAsync(projectId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a specific project. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteProjectWithServiceResponseAsync(UUID projectId) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.deleteProject(projectId, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteProjectDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteProjectDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update a specific project. + * + * @param projectId The id of the project to update. + * @param updatedProject The updated project model. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Project object if successful. + */ + public Project updateProject(UUID projectId, Project updatedProject) { + return updateProjectWithServiceResponseAsync(projectId, updatedProject).toBlocking().single().body(); + } + + /** + * Update a specific project. + * + * @param projectId The id of the project to update. + * @param updatedProject The updated project model. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateProjectAsync(UUID projectId, Project updatedProject, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateProjectWithServiceResponseAsync(projectId, updatedProject), serviceCallback); + } + + /** + * Update a specific project. + * + * @param projectId The id of the project to update. + * @param updatedProject The updated project model. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Project object + */ + public Observable updateProjectAsync(UUID projectId, Project updatedProject) { + return updateProjectWithServiceResponseAsync(projectId, updatedProject).map(new Func1, Project>() { + @Override + public Project call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a specific project. + * + * @param projectId The id of the project to update. + * @param updatedProject The updated project model. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Project object + */ + public Observable> updateProjectWithServiceResponseAsync(UUID projectId, Project updatedProject) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (updatedProject == null) { + throw new IllegalArgumentException("Parameter updatedProject is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + Validator.validate(updatedProject); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.updateProject(projectId, updatedProject, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateProjectDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateProjectDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get iterations for the project. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Iteration> object if successful. + */ + public List getIterations(UUID projectId) { + return getIterationsWithServiceResponseAsync(projectId).toBlocking().single().body(); + } + + /** + * Get iterations for the project. + * + * @param projectId The project id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getIterationsAsync(UUID projectId, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getIterationsWithServiceResponseAsync(projectId), serviceCallback); + } + + /** + * Get iterations for the project. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Iteration> object + */ + public Observable> getIterationsAsync(UUID projectId) { + return getIterationsWithServiceResponseAsync(projectId).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get iterations for the project. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Iteration> object + */ + public Observable>> getIterationsWithServiceResponseAsync(UUID projectId) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.getIterations(projectId, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getIterationsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getIterationsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., CloudException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a specific iteration. + * + * @param projectId The id of the project the iteration belongs to. + * @param iterationId The id of the iteration to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Iteration object if successful. + */ + public Iteration getIteration(UUID projectId, UUID iterationId) { + return getIterationWithServiceResponseAsync(projectId, iterationId).toBlocking().single().body(); + } + + /** + * Get a specific iteration. + * + * @param projectId The id of the project the iteration belongs to. + * @param iterationId The id of the iteration to get. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getIterationAsync(UUID projectId, UUID iterationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getIterationWithServiceResponseAsync(projectId, iterationId), serviceCallback); + } + + /** + * Get a specific iteration. + * + * @param projectId The id of the project the iteration belongs to. + * @param iterationId The id of the iteration to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Iteration object + */ + public Observable getIterationAsync(UUID projectId, UUID iterationId) { + return getIterationWithServiceResponseAsync(projectId, iterationId).map(new Func1, Iteration>() { + @Override + public Iteration call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a specific iteration. + * + * @param projectId The id of the project the iteration belongs to. + * @param iterationId The id of the iteration to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Iteration object + */ + public Observable> getIterationWithServiceResponseAsync(UUID projectId, UUID iterationId) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (iterationId == null) { + throw new IllegalArgumentException("Parameter iterationId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.getIteration(projectId, iterationId, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getIterationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getIterationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete a specific iteration of a project. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteIteration(UUID projectId, UUID iterationId) { + deleteIterationWithServiceResponseAsync(projectId, iterationId).toBlocking().single().body(); + } + + /** + * Delete a specific iteration of a project. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteIterationAsync(UUID projectId, UUID iterationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteIterationWithServiceResponseAsync(projectId, iterationId), serviceCallback); + } + + /** + * Delete a specific iteration of a project. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteIterationAsync(UUID projectId, UUID iterationId) { + return deleteIterationWithServiceResponseAsync(projectId, iterationId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a specific iteration of a project. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteIterationWithServiceResponseAsync(UUID projectId, UUID iterationId) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (iterationId == null) { + throw new IllegalArgumentException("Parameter iterationId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.deleteIteration(projectId, iterationId, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteIterationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteIterationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update a specific iteration. + * + * @param projectId Project id. + * @param iterationId Iteration id. + * @param updatedIteration The updated iteration model. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Iteration object if successful. + */ + public Iteration updateIteration(UUID projectId, UUID iterationId, Iteration updatedIteration) { + return updateIterationWithServiceResponseAsync(projectId, iterationId, updatedIteration).toBlocking().single().body(); + } + + /** + * Update a specific iteration. + * + * @param projectId Project id. + * @param iterationId Iteration id. + * @param updatedIteration The updated iteration model. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateIterationAsync(UUID projectId, UUID iterationId, Iteration updatedIteration, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateIterationWithServiceResponseAsync(projectId, iterationId, updatedIteration), serviceCallback); + } + + /** + * Update a specific iteration. + * + * @param projectId Project id. + * @param iterationId Iteration id. + * @param updatedIteration The updated iteration model. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Iteration object + */ + public Observable updateIterationAsync(UUID projectId, UUID iterationId, Iteration updatedIteration) { + return updateIterationWithServiceResponseAsync(projectId, iterationId, updatedIteration).map(new Func1, Iteration>() { + @Override + public Iteration call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a specific iteration. + * + * @param projectId Project id. + * @param iterationId Iteration id. + * @param updatedIteration The updated iteration model. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Iteration object + */ + public Observable> updateIterationWithServiceResponseAsync(UUID projectId, UUID iterationId, Iteration updatedIteration) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (iterationId == null) { + throw new IllegalArgumentException("Parameter iterationId is required and cannot be null."); + } + if (updatedIteration == null) { + throw new IllegalArgumentException("Parameter updatedIteration is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + Validator.validate(updatedIteration); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.updateIteration(projectId, iterationId, updatedIteration, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateIterationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateIterationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Queues project for training. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Iteration object if successful. + */ + public Iteration trainProject(UUID projectId) { + return trainProjectWithServiceResponseAsync(projectId).toBlocking().single().body(); + } + + /** + * Queues project for training. + * + * @param projectId The project id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture trainProjectAsync(UUID projectId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(trainProjectWithServiceResponseAsync(projectId), serviceCallback); + } + + /** + * Queues project for training. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Iteration object + */ + public Observable trainProjectAsync(UUID projectId) { + return trainProjectWithServiceResponseAsync(projectId).map(new Func1, Iteration>() { + @Override + public Iteration call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Queues project for training. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Iteration object + */ + public Observable> trainProjectWithServiceResponseAsync(UUID projectId) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.trainProject(projectId, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = trainProjectDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse trainProjectDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the list of exports for a specific iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Export> object if successful. + */ + public List getExports(UUID projectId, UUID iterationId) { + return getExportsWithServiceResponseAsync(projectId, iterationId).toBlocking().single().body(); + } + + /** + * Get the list of exports for a specific iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getExportsAsync(UUID projectId, UUID iterationId, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getExportsWithServiceResponseAsync(projectId, iterationId), serviceCallback); + } + + /** + * Get the list of exports for a specific iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Export> object + */ + public Observable> getExportsAsync(UUID projectId, UUID iterationId) { + return getExportsWithServiceResponseAsync(projectId, iterationId).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the list of exports for a specific iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Export> object + */ + public Observable>> getExportsWithServiceResponseAsync(UUID projectId, UUID iterationId) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (iterationId == null) { + throw new IllegalArgumentException("Parameter iterationId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.getExports(projectId, iterationId, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getExportsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getExportsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., CloudException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Export a trained iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @param platform The target platform. Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Export object if successful. + */ + public Export exportIteration(UUID projectId, UUID iterationId, String platform) { + return exportIterationWithServiceResponseAsync(projectId, iterationId, platform).toBlocking().single().body(); + } + + /** + * Export a trained iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @param platform The target platform. Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture exportIterationAsync(UUID projectId, UUID iterationId, String platform, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(exportIterationWithServiceResponseAsync(projectId, iterationId, platform), serviceCallback); + } + + /** + * Export a trained iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @param platform The target platform. Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Export object + */ + public Observable exportIterationAsync(UUID projectId, UUID iterationId, String platform) { + return exportIterationWithServiceResponseAsync(projectId, iterationId, platform).map(new Func1, Export>() { + @Override + public Export call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Export a trained iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @param platform The target platform. Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Export object + */ + public Observable> exportIterationWithServiceResponseAsync(UUID projectId, UUID iterationId, String platform) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (iterationId == null) { + throw new IllegalArgumentException("Parameter iterationId is required and cannot be null."); + } + if (platform == null) { + throw new IllegalArgumentException("Parameter platform is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + final String flavor = null; + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.exportIteration(projectId, iterationId, platform, flavor, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = exportIterationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Export a trained iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @param platform The target platform. Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX' + * @param flavor The flavor of the target platform. Possible values include: 'Linux', 'Windows', 'ONNX10', 'ONNX12' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Export object if successful. + */ + public Export exportIteration(UUID projectId, UUID iterationId, String platform, String flavor) { + return exportIterationWithServiceResponseAsync(projectId, iterationId, platform, flavor).toBlocking().single().body(); + } + + /** + * Export a trained iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @param platform The target platform. Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX' + * @param flavor The flavor of the target platform. Possible values include: 'Linux', 'Windows', 'ONNX10', 'ONNX12' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture exportIterationAsync(UUID projectId, UUID iterationId, String platform, String flavor, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(exportIterationWithServiceResponseAsync(projectId, iterationId, platform, flavor), serviceCallback); + } + + /** + * Export a trained iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @param platform The target platform. Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX' + * @param flavor The flavor of the target platform. Possible values include: 'Linux', 'Windows', 'ONNX10', 'ONNX12' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Export object + */ + public Observable exportIterationAsync(UUID projectId, UUID iterationId, String platform, String flavor) { + return exportIterationWithServiceResponseAsync(projectId, iterationId, platform, flavor).map(new Func1, Export>() { + @Override + public Export call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Export a trained iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @param platform The target platform. Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX' + * @param flavor The flavor of the target platform. Possible values include: 'Linux', 'Windows', 'ONNX10', 'ONNX12' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Export object + */ + public Observable> exportIterationWithServiceResponseAsync(UUID projectId, UUID iterationId, String platform, String flavor) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (iterationId == null) { + throw new IllegalArgumentException("Parameter iterationId is required and cannot be null."); + } + if (platform == null) { + throw new IllegalArgumentException("Parameter platform is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.exportIteration(projectId, iterationId, platform, flavor, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = exportIterationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse exportIterationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get information about a specific tag. + * + * @param projectId The project this tag belongs to. + * @param tagId The tag id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Tag object if successful. + */ + public Tag getTag(UUID projectId, UUID tagId) { + return getTagWithServiceResponseAsync(projectId, tagId).toBlocking().single().body(); + } + + /** + * Get information about a specific tag. + * + * @param projectId The project this tag belongs to. + * @param tagId The tag id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getTagAsync(UUID projectId, UUID tagId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getTagWithServiceResponseAsync(projectId, tagId), serviceCallback); + } + + /** + * Get information about a specific tag. + * + * @param projectId The project this tag belongs to. + * @param tagId The tag id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Tag object + */ + public Observable getTagAsync(UUID projectId, UUID tagId) { + return getTagWithServiceResponseAsync(projectId, tagId).map(new Func1, Tag>() { + @Override + public Tag call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get information about a specific tag. + * + * @param projectId The project this tag belongs to. + * @param tagId The tag id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Tag object + */ + public Observable> getTagWithServiceResponseAsync(UUID projectId, UUID tagId) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (tagId == null) { + throw new IllegalArgumentException("Parameter tagId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + final UUID iterationId = null; + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.getTag(projectId, tagId, iterationId, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getTagDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get information about a specific tag. + * + * @param projectId The project this tag belongs to. + * @param tagId The tag id. + * @param iterationId The iteration to retrieve this tag from. Optional, defaults to current training set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Tag object if successful. + */ + public Tag getTag(UUID projectId, UUID tagId, UUID iterationId) { + return getTagWithServiceResponseAsync(projectId, tagId, iterationId).toBlocking().single().body(); + } + + /** + * Get information about a specific tag. + * + * @param projectId The project this tag belongs to. + * @param tagId The tag id. + * @param iterationId The iteration to retrieve this tag from. Optional, defaults to current training set. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getTagAsync(UUID projectId, UUID tagId, UUID iterationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getTagWithServiceResponseAsync(projectId, tagId, iterationId), serviceCallback); + } + + /** + * Get information about a specific tag. + * + * @param projectId The project this tag belongs to. + * @param tagId The tag id. + * @param iterationId The iteration to retrieve this tag from. Optional, defaults to current training set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Tag object + */ + public Observable getTagAsync(UUID projectId, UUID tagId, UUID iterationId) { + return getTagWithServiceResponseAsync(projectId, tagId, iterationId).map(new Func1, Tag>() { + @Override + public Tag call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get information about a specific tag. + * + * @param projectId The project this tag belongs to. + * @param tagId The tag id. + * @param iterationId The iteration to retrieve this tag from. Optional, defaults to current training set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Tag object + */ + public Observable> getTagWithServiceResponseAsync(UUID projectId, UUID tagId, UUID iterationId) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (tagId == null) { + throw new IllegalArgumentException("Parameter tagId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.getTag(projectId, tagId, iterationId, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getTagDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getTagDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete a tag from the project. + * + * @param projectId The project id. + * @param tagId Id of the tag to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteTag(UUID projectId, UUID tagId) { + deleteTagWithServiceResponseAsync(projectId, tagId).toBlocking().single().body(); + } + + /** + * Delete a tag from the project. + * + * @param projectId The project id. + * @param tagId Id of the tag to be deleted. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteTagAsync(UUID projectId, UUID tagId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteTagWithServiceResponseAsync(projectId, tagId), serviceCallback); + } + + /** + * Delete a tag from the project. + * + * @param projectId The project id. + * @param tagId Id of the tag to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteTagAsync(UUID projectId, UUID tagId) { + return deleteTagWithServiceResponseAsync(projectId, tagId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a tag from the project. + * + * @param projectId The project id. + * @param tagId Id of the tag to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteTagWithServiceResponseAsync(UUID projectId, UUID tagId) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (tagId == null) { + throw new IllegalArgumentException("Parameter tagId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.deleteTag(projectId, tagId, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteTagDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteTagDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update a tag. + * + * @param projectId The project id. + * @param tagId The id of the target tag. + * @param updatedTag The updated tag model. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Tag object if successful. + */ + public Tag updateTag(UUID projectId, UUID tagId, Tag updatedTag) { + return updateTagWithServiceResponseAsync(projectId, tagId, updatedTag).toBlocking().single().body(); + } + + /** + * Update a tag. + * + * @param projectId The project id. + * @param tagId The id of the target tag. + * @param updatedTag The updated tag model. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagAsync(UUID projectId, UUID tagId, Tag updatedTag, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagWithServiceResponseAsync(projectId, tagId, updatedTag), serviceCallback); + } + + /** + * Update a tag. + * + * @param projectId The project id. + * @param tagId The id of the target tag. + * @param updatedTag The updated tag model. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Tag object + */ + public Observable updateTagAsync(UUID projectId, UUID tagId, Tag updatedTag) { + return updateTagWithServiceResponseAsync(projectId, tagId, updatedTag).map(new Func1, Tag>() { + @Override + public Tag call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a tag. + * + * @param projectId The project id. + * @param tagId The id of the target tag. + * @param updatedTag The updated tag model. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Tag object + */ + public Observable> updateTagWithServiceResponseAsync(UUID projectId, UUID tagId, Tag updatedTag) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (tagId == null) { + throw new IllegalArgumentException("Parameter tagId is required and cannot be null."); + } + if (updatedTag == null) { + throw new IllegalArgumentException("Parameter updatedTag is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + Validator.validate(updatedTag); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.updateTag(projectId, tagId, updatedTag, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateTagDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateTagDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the tags for a given project and iteration. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Tag> object if successful. + */ + public List getTags(UUID projectId) { + return getTagsWithServiceResponseAsync(projectId).toBlocking().single().body(); + } + + /** + * Get the tags for a given project and iteration. + * + * @param projectId The project id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getTagsAsync(UUID projectId, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getTagsWithServiceResponseAsync(projectId), serviceCallback); + } + + /** + * Get the tags for a given project and iteration. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Tag> object + */ + public Observable> getTagsAsync(UUID projectId) { + return getTagsWithServiceResponseAsync(projectId).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the tags for a given project and iteration. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Tag> object + */ + public Observable>> getTagsWithServiceResponseAsync(UUID projectId) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + final UUID iterationId = null; + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.getTags(projectId, iterationId, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the tags for a given project and iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Tag> object if successful. + */ + public List getTags(UUID projectId, UUID iterationId) { + return getTagsWithServiceResponseAsync(projectId, iterationId).toBlocking().single().body(); + } + + /** + * Get the tags for a given project and iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getTagsAsync(UUID projectId, UUID iterationId, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getTagsWithServiceResponseAsync(projectId, iterationId), serviceCallback); + } + + /** + * Get the tags for a given project and iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Tag> object + */ + public Observable> getTagsAsync(UUID projectId, UUID iterationId) { + return getTagsWithServiceResponseAsync(projectId, iterationId).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the tags for a given project and iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Tag> object + */ + public Observable>> getTagsWithServiceResponseAsync(UUID projectId, UUID iterationId) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.getTags(projectId, iterationId, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., CloudException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create a tag for the project. + * + * @param projectId The project id. + * @param name The tag name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Tag object if successful. + */ + public Tag createTag(UUID projectId, String name) { + return createTagWithServiceResponseAsync(projectId, name).toBlocking().single().body(); + } + + /** + * Create a tag for the project. + * + * @param projectId The project id. + * @param name The tag name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createTagAsync(UUID projectId, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createTagWithServiceResponseAsync(projectId, name), serviceCallback); + } + + /** + * Create a tag for the project. + * + * @param projectId The project id. + * @param name The tag name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Tag object + */ + public Observable createTagAsync(UUID projectId, String name) { + return createTagWithServiceResponseAsync(projectId, name).map(new Func1, Tag>() { + @Override + public Tag call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a tag for the project. + * + * @param projectId The project id. + * @param name The tag name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Tag object + */ + public Observable> createTagWithServiceResponseAsync(UUID projectId, String name) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + final String description = null; + final String type = null; + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.createTag(projectId, name, description, type, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createTagDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Create a tag for the project. + * + * @param projectId The project id. + * @param name The tag name. + * @param description Optional description for the tag. + * @param type Optional type for the tag. Possible values include: 'Regular', 'Negative' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Tag object if successful. + */ + public Tag createTag(UUID projectId, String name, String description, String type) { + return createTagWithServiceResponseAsync(projectId, name, description, type).toBlocking().single().body(); + } + + /** + * Create a tag for the project. + * + * @param projectId The project id. + * @param name The tag name. + * @param description Optional description for the tag. + * @param type Optional type for the tag. Possible values include: 'Regular', 'Negative' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createTagAsync(UUID projectId, String name, String description, String type, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createTagWithServiceResponseAsync(projectId, name, description, type), serviceCallback); + } + + /** + * Create a tag for the project. + * + * @param projectId The project id. + * @param name The tag name. + * @param description Optional description for the tag. + * @param type Optional type for the tag. Possible values include: 'Regular', 'Negative' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Tag object + */ + public Observable createTagAsync(UUID projectId, String name, String description, String type) { + return createTagWithServiceResponseAsync(projectId, name, description, type).map(new Func1, Tag>() { + @Override + public Tag call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a tag for the project. + * + * @param projectId The project id. + * @param name The tag name. + * @param description Optional description for the tag. + * @param type Optional type for the tag. Possible values include: 'Regular', 'Negative' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Tag object + */ + public Observable> createTagWithServiceResponseAsync(UUID projectId, String name, String description, String type) { + if (this.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.apiKey() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); + return service.createTag(projectId, name, description, type, this.apiKey(), this.acceptLanguage(), parameterizedHost, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createTagDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createTagDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/package-info.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/package-info.java index 660ca0524a9a..6f29966a919a 100644 --- a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/package-info.java +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/package-info.java @@ -5,6 +5,6 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * This package contains the implementation classes for TrainingApi. + * This package contains the implementation classes for CustomVisionTrainingClient. */ package com.microsoft.azure.cognitiveservices.vision.customvision.training.implementation; diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Domain.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Domain.java index aa6d35c493cd..8fb5909e685f 100644 --- a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Domain.java +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Domain.java @@ -64,7 +64,7 @@ public String name() { } /** - * Get the type value. + * Get possible values include: 'Classification', 'ObjectDetection'. * * @return the type value */ diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Export.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Export.java index c4dc3d42098e..08cd381dec98 100644 --- a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Export.java +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Export.java @@ -15,46 +15,50 @@ */ public class Export { /** - * Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX'. + * Platform of the export. Possible values include: 'CoreML', 'TensorFlow', + * 'DockerFile', 'ONNX'. */ @JsonProperty(value = "platform", access = JsonProperty.Access.WRITE_ONLY) - private ExportPlatform platform; + private ExportPlatformModel platform; /** - * Possible values include: 'Exporting', 'Failed', 'Done'. + * Status of the export. Possible values include: 'Exporting', 'Failed', + * 'Done'. */ @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private ExportStatusModel status; /** - * The downloadUri property. + * URI used to download the model. */ @JsonProperty(value = "downloadUri", access = JsonProperty.Access.WRITE_ONLY) private String downloadUri; /** - * Possible values include: 'Linux', 'Windows'. + * Flavor of the export. Possible values include: 'Linux', 'Windows', + * 'ONNX10', 'ONNX12'. */ @JsonProperty(value = "flavor", access = JsonProperty.Access.WRITE_ONLY) - private ExportFlavor flavor; + private ExportFlavorModel flavor; /** - * The newerVersionAvailable property. + * Indicates an updated version of the export package is available and + * should be re-exported for the latest changes. */ @JsonProperty(value = "newerVersionAvailable", access = JsonProperty.Access.WRITE_ONLY) private boolean newerVersionAvailable; /** - * Get the platform value. + * Get platform of the export. Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX'. * * @return the platform value */ - public ExportPlatform platform() { + public ExportPlatformModel platform() { return this.platform; } /** - * Get the status value. + * Get status of the export. Possible values include: 'Exporting', 'Failed', 'Done'. * * @return the status value */ @@ -63,7 +67,7 @@ public ExportStatusModel status() { } /** - * Get the downloadUri value. + * Get uRI used to download the model. * * @return the downloadUri value */ @@ -72,16 +76,16 @@ public String downloadUri() { } /** - * Get the flavor value. + * Get flavor of the export. Possible values include: 'Linux', 'Windows', 'ONNX10', 'ONNX12'. * * @return the flavor value */ - public ExportFlavor flavor() { + public ExportFlavorModel flavor() { return this.flavor; } /** - * Get the newerVersionAvailable value. + * Get indicates an updated version of the export package is available and should be re-exported for the latest changes. * * @return the newerVersionAvailable value */ diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportFlavorModel.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportFlavorModel.java new file mode 100644 index 000000000000..3d18b8dd6fff --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportFlavorModel.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.cognitiveservices.vision.customvision.training.models; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ExportFlavorModel. + */ +public final class ExportFlavorModel extends ExpandableStringEnum { + /** Static value Linux for ExportFlavorModel. */ + public static final ExportFlavorModel LINUX = fromString("Linux"); + + /** Static value Windows for ExportFlavorModel. */ + public static final ExportFlavorModel WINDOWS = fromString("Windows"); + + /** Static value ONNX10 for ExportFlavorModel. */ + public static final ExportFlavorModel ONNX10 = fromString("ONNX10"); + + /** Static value ONNX12 for ExportFlavorModel. */ + public static final ExportFlavorModel ONNX12 = fromString("ONNX12"); + + /** + * Creates or finds a ExportFlavorModel from its string representation. + * @param name a name to look for + * @return the corresponding ExportFlavorModel + */ + @JsonCreator + public static ExportFlavorModel fromString(String name) { + return fromString(name, ExportFlavorModel.class); + } + + /** + * @return known ExportFlavorModel values + */ + public static Collection values() { + return values(ExportFlavorModel.class); + } +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportPlatformModel.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportPlatformModel.java new file mode 100644 index 000000000000..1cd3c4c4151f --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportPlatformModel.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.cognitiveservices.vision.customvision.training.models; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ExportPlatformModel. + */ +public final class ExportPlatformModel extends ExpandableStringEnum { + /** Static value CoreML for ExportPlatformModel. */ + public static final ExportPlatformModel CORE_ML = fromString("CoreML"); + + /** Static value TensorFlow for ExportPlatformModel. */ + public static final ExportPlatformModel TENSOR_FLOW = fromString("TensorFlow"); + + /** Static value DockerFile for ExportPlatformModel. */ + public static final ExportPlatformModel DOCKER_FILE = fromString("DockerFile"); + + /** Static value ONNX for ExportPlatformModel. */ + public static final ExportPlatformModel ONNX = fromString("ONNX"); + + /** + * Creates or finds a ExportPlatformModel from its string representation. + * @param name a name to look for + * @return the corresponding ExportPlatformModel + */ + @JsonCreator + public static ExportPlatformModel fromString(String name) { + return fromString(name, ExportPlatformModel.class); + } + + /** + * @return known ExportPlatformModel values + */ + public static Collection values() { + return values(ExportPlatformModel.class); + } +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Image.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Image.java index 2dd19b767654..8695b2b2b3cb 100644 --- a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Image.java +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Image.java @@ -18,55 +18,61 @@ */ public class Image { /** - * The id property. + * Id of the image. */ @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private UUID id; /** - * The created property. + * Date the image was created. */ @JsonProperty(value = "created", access = JsonProperty.Access.WRITE_ONLY) private DateTime created; /** - * The width property. + * Width of the image. */ @JsonProperty(value = "width", access = JsonProperty.Access.WRITE_ONLY) private int width; /** - * The height property. + * Height of the image. */ @JsonProperty(value = "height", access = JsonProperty.Access.WRITE_ONLY) private int height; /** - * The imageUri property. + * The URI to the (resized) image used for training. */ - @JsonProperty(value = "imageUri", access = JsonProperty.Access.WRITE_ONLY) - private String imageUri; + @JsonProperty(value = "resizedImageUri", access = JsonProperty.Access.WRITE_ONLY) + private String resizedImageUri; /** - * The thumbnailUri property. + * The URI to the thumbnail of the original image. */ @JsonProperty(value = "thumbnailUri", access = JsonProperty.Access.WRITE_ONLY) private String thumbnailUri; /** - * The tags property. + * The URI to the original uploaded image. + */ + @JsonProperty(value = "originalImageUri", access = JsonProperty.Access.WRITE_ONLY) + private String originalImageUri; + + /** + * Tags associated with this image. */ @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) private List tags; /** - * The regions property. + * Regions associated with this image. */ @JsonProperty(value = "regions", access = JsonProperty.Access.WRITE_ONLY) private List regions; /** - * Get the id value. + * Get id of the image. * * @return the id value */ @@ -75,7 +81,7 @@ public UUID id() { } /** - * Get the created value. + * Get date the image was created. * * @return the created value */ @@ -84,7 +90,7 @@ public DateTime created() { } /** - * Get the width value. + * Get width of the image. * * @return the width value */ @@ -93,7 +99,7 @@ public int width() { } /** - * Get the height value. + * Get height of the image. * * @return the height value */ @@ -102,16 +108,16 @@ public int height() { } /** - * Get the imageUri value. + * Get the URI to the (resized) image used for training. * - * @return the imageUri value + * @return the resizedImageUri value */ - public String imageUri() { - return this.imageUri; + public String resizedImageUri() { + return this.resizedImageUri; } /** - * Get the thumbnailUri value. + * Get the URI to the thumbnail of the original image. * * @return the thumbnailUri value */ @@ -120,7 +126,16 @@ public String thumbnailUri() { } /** - * Get the tags value. + * Get the URI to the original uploaded image. + * + * @return the originalImageUri value + */ + public String originalImageUri() { + return this.originalImageUri; + } + + /** + * Get tags associated with this image. * * @return the tags value */ @@ -129,7 +144,7 @@ public List tags() { } /** - * Get the regions value. + * Get regions associated with this image. * * @return the regions value */ diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageCreateResult.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageCreateResult.java index 550d0a0ec3b7..f7708ce50794 100644 --- a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageCreateResult.java +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageCreateResult.java @@ -15,28 +15,29 @@ */ public class ImageCreateResult { /** - * The sourceUrl property. + * Source URL of the image. */ @JsonProperty(value = "sourceUrl", access = JsonProperty.Access.WRITE_ONLY) private String sourceUrl; /** - * Possible values include: 'OK', 'OKDuplicate', 'ErrorSource', - * 'ErrorImageFormat', 'ErrorImageSize', 'ErrorStorage', - * 'ErrorLimitExceed', 'ErrorTagLimitExceed', 'ErrorRegionLimitExceed', - * 'ErrorUnknown'. + * Status of the image creation. Possible values include: 'OK', + * 'OKDuplicate', 'ErrorSource', 'ErrorImageFormat', 'ErrorImageSize', + * 'ErrorStorage', 'ErrorLimitExceed', 'ErrorTagLimitExceed', + * 'ErrorRegionLimitExceed', 'ErrorUnknown', + * 'ErrorNegativeAndRegularTagOnSameImage'. */ @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private ImageUploadStatus status; + private ImageCreateStatus status; /** - * The image property. + * The image. */ @JsonProperty(value = "image", access = JsonProperty.Access.WRITE_ONLY) private Image image; /** - * Get the sourceUrl value. + * Get source URL of the image. * * @return the sourceUrl value */ @@ -45,16 +46,16 @@ public String sourceUrl() { } /** - * Get the status value. + * Get status of the image creation. Possible values include: 'OK', 'OKDuplicate', 'ErrorSource', 'ErrorImageFormat', 'ErrorImageSize', 'ErrorStorage', 'ErrorLimitExceed', 'ErrorTagLimitExceed', 'ErrorRegionLimitExceed', 'ErrorUnknown', 'ErrorNegativeAndRegularTagOnSameImage'. * * @return the status value */ - public ImageUploadStatus status() { + public ImageCreateStatus status() { return this.status; } /** - * Get the image value. + * Get the image. * * @return the image value */ diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageCreateStatus.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageCreateStatus.java new file mode 100644 index 000000000000..b3cdf60e41ff --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageCreateStatus.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.cognitiveservices.vision.customvision.training.models; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ImageCreateStatus. + */ +public final class ImageCreateStatus extends ExpandableStringEnum { + /** Static value OK for ImageCreateStatus. */ + public static final ImageCreateStatus OK = fromString("OK"); + + /** Static value OKDuplicate for ImageCreateStatus. */ + public static final ImageCreateStatus OKDUPLICATE = fromString("OKDuplicate"); + + /** Static value ErrorSource for ImageCreateStatus. */ + public static final ImageCreateStatus ERROR_SOURCE = fromString("ErrorSource"); + + /** Static value ErrorImageFormat for ImageCreateStatus. */ + public static final ImageCreateStatus ERROR_IMAGE_FORMAT = fromString("ErrorImageFormat"); + + /** Static value ErrorImageSize for ImageCreateStatus. */ + public static final ImageCreateStatus ERROR_IMAGE_SIZE = fromString("ErrorImageSize"); + + /** Static value ErrorStorage for ImageCreateStatus. */ + public static final ImageCreateStatus ERROR_STORAGE = fromString("ErrorStorage"); + + /** Static value ErrorLimitExceed for ImageCreateStatus. */ + public static final ImageCreateStatus ERROR_LIMIT_EXCEED = fromString("ErrorLimitExceed"); + + /** Static value ErrorTagLimitExceed for ImageCreateStatus. */ + public static final ImageCreateStatus ERROR_TAG_LIMIT_EXCEED = fromString("ErrorTagLimitExceed"); + + /** Static value ErrorRegionLimitExceed for ImageCreateStatus. */ + public static final ImageCreateStatus ERROR_REGION_LIMIT_EXCEED = fromString("ErrorRegionLimitExceed"); + + /** Static value ErrorUnknown for ImageCreateStatus. */ + public static final ImageCreateStatus ERROR_UNKNOWN = fromString("ErrorUnknown"); + + /** Static value ErrorNegativeAndRegularTagOnSameImage for ImageCreateStatus. */ + public static final ImageCreateStatus ERROR_NEGATIVE_AND_REGULAR_TAG_ON_SAME_IMAGE = fromString("ErrorNegativeAndRegularTagOnSameImage"); + + /** + * Creates or finds a ImageCreateStatus from its string representation. + * @param name a name to look for + * @return the corresponding ImageCreateStatus + */ + @JsonCreator + public static ImageCreateStatus fromString(String name) { + return fromString(name, ImageCreateStatus.class); + } + + /** + * @return known ImageCreateStatus values + */ + public static Collection values() { + return values(ImageCreateStatus.class); + } +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageCreateSummary.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageCreateSummary.java index 16597571a075..fd286ae7ea4c 100644 --- a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageCreateSummary.java +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageCreateSummary.java @@ -16,19 +16,20 @@ */ public class ImageCreateSummary { /** - * The isBatchSuccessful property. + * True if all of the images in the batch were created successfully, + * otherwise false. */ @JsonProperty(value = "isBatchSuccessful", access = JsonProperty.Access.WRITE_ONLY) private boolean isBatchSuccessful; /** - * The images property. + * List of the image creation results. */ @JsonProperty(value = "images", access = JsonProperty.Access.WRITE_ONLY) private List images; /** - * Get the isBatchSuccessful value. + * Get true if all of the images in the batch were created successfully, otherwise false. * * @return the isBatchSuccessful value */ @@ -37,7 +38,7 @@ public boolean isBatchSuccessful() { } /** - * Get the images value. + * Get list of the image creation results. * * @return the images value */ diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegion.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegion.java index 36e160ed153d..5c704ac4b7a2 100644 --- a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegion.java +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegion.java @@ -35,7 +35,7 @@ public class ImageRegion { private DateTime created; /** - * The tagId property. + * Id of the tag associated with this region. */ @JsonProperty(value = "tagId") private UUID tagId; @@ -92,7 +92,7 @@ public DateTime created() { } /** - * Get the tagId value. + * Get id of the tag associated with this region. * * @return the tagId value */ @@ -101,7 +101,7 @@ public UUID tagId() { } /** - * Set the tagId value. + * Set id of the tag associated with this region. * * @param tagId the tagId value to set * @return the ImageRegion object itself. diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionCreateEntry.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionCreateEntry.java index 077f0d78db63..426ecb02924f 100644 --- a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionCreateEntry.java +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionCreateEntry.java @@ -12,17 +12,17 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The ImageRegionCreateEntry model. + * Entry associating a region to an image. */ public class ImageRegionCreateEntry { /** - * The imageId property. + * Id of the image. */ @JsonProperty(value = "imageId") private UUID imageId; /** - * The tagId property. + * Id of the tag associated with this region. */ @JsonProperty(value = "tagId") private UUID tagId; @@ -52,7 +52,7 @@ public class ImageRegionCreateEntry { private double height; /** - * Get the imageId value. + * Get id of the image. * * @return the imageId value */ @@ -61,7 +61,7 @@ public UUID imageId() { } /** - * Set the imageId value. + * Set id of the image. * * @param imageId the imageId value to set * @return the ImageRegionCreateEntry object itself. @@ -72,7 +72,7 @@ public ImageRegionCreateEntry withImageId(UUID imageId) { } /** - * Get the tagId value. + * Get id of the tag associated with this region. * * @return the tagId value */ @@ -81,7 +81,7 @@ public UUID tagId() { } /** - * Set the tagId value. + * Set id of the tag associated with this region. * * @param tagId the tagId value to set * @return the ImageRegionCreateEntry object itself. diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionCreateResult.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionCreateResult.java index 212f89ba2b42..7c8c098d9771 100644 --- a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionCreateResult.java +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionCreateResult.java @@ -41,7 +41,7 @@ public class ImageRegionCreateResult { private DateTime created; /** - * The tagId property. + * Id of the tag associated with this region. */ @JsonProperty(value = "tagId") private UUID tagId; @@ -107,7 +107,7 @@ public DateTime created() { } /** - * Get the tagId value. + * Get id of the tag associated with this region. * * @return the tagId value */ @@ -116,7 +116,7 @@ public UUID tagId() { } /** - * Set the tagId value. + * Set id of the tag associated with this region. * * @param tagId the tagId value to set * @return the ImageRegionCreateResult object itself. diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageTagCreateBatch.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageTagCreateBatch.java index 1a6645dd0e2f..b37a106deacf 100644 --- a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageTagCreateBatch.java +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageTagCreateBatch.java @@ -12,17 +12,17 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The ImageTagCreateBatch model. + * Batch of image tags. */ public class ImageTagCreateBatch { /** - * The tags property. + * Image Tag entries to include in this batch. */ @JsonProperty(value = "tags") private List tags; /** - * Get the tags value. + * Get image Tag entries to include in this batch. * * @return the tags value */ @@ -31,7 +31,7 @@ public List tags() { } /** - * Set the tags value. + * Set image Tag entries to include in this batch. * * @param tags the tags value to set * @return the ImageTagCreateBatch object itself. diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageTagCreateEntry.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageTagCreateEntry.java index f907b176be74..5e5023ca0c89 100644 --- a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageTagCreateEntry.java +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageTagCreateEntry.java @@ -12,23 +12,23 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The ImageTagCreateEntry model. + * Entry associating a tag to an image. */ public class ImageTagCreateEntry { /** - * The imageId property. + * Id of the image. */ @JsonProperty(value = "imageId") private UUID imageId; /** - * The tagId property. + * Id of the tag. */ @JsonProperty(value = "tagId") private UUID tagId; /** - * Get the imageId value. + * Get id of the image. * * @return the imageId value */ @@ -37,7 +37,7 @@ public UUID imageId() { } /** - * Set the imageId value. + * Set id of the image. * * @param imageId the imageId value to set * @return the ImageTagCreateEntry object itself. @@ -48,7 +48,7 @@ public ImageTagCreateEntry withImageId(UUID imageId) { } /** - * Get the tagId value. + * Get id of the tag. * * @return the tagId value */ @@ -57,7 +57,7 @@ public UUID tagId() { } /** - * Set the tagId value. + * Set id of the tag. * * @param tagId the tagId value to set * @return the ImageTagCreateEntry object itself. diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Iteration.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Iteration.java index 2f3eb95aeab3..8fd9bb6a5423 100644 --- a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Iteration.java +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Iteration.java @@ -60,7 +60,7 @@ public class Iteration { private DateTime trainedAt; /** - * Gets the project id of the iteration. + * Gets The project id. of the iteration. */ @JsonProperty(value = "projectId", access = JsonProperty.Access.WRITE_ONLY) private UUID projectId; @@ -85,7 +85,7 @@ public class Iteration { private Classifier classificationType; /** - * Get the id value. + * Get gets the id of the iteration. * * @return the id value */ @@ -94,7 +94,7 @@ public UUID id() { } /** - * Get the name value. + * Get gets or sets the name of the iteration. * * @return the name value */ @@ -103,7 +103,7 @@ public String name() { } /** - * Set the name value. + * Set gets or sets the name of the iteration. * * @param name the name value to set * @return the Iteration object itself. @@ -114,7 +114,7 @@ public Iteration withName(String name) { } /** - * Get the isDefault value. + * Get gets or sets a value indicating whether the iteration is the default iteration for the project. * * @return the isDefault value */ @@ -123,7 +123,7 @@ public boolean isDefault() { } /** - * Set the isDefault value. + * Set gets or sets a value indicating whether the iteration is the default iteration for the project. * * @param isDefault the isDefault value to set * @return the Iteration object itself. @@ -134,7 +134,7 @@ public Iteration withIsDefault(boolean isDefault) { } /** - * Get the status value. + * Get gets the current iteration status. * * @return the status value */ @@ -143,7 +143,7 @@ public String status() { } /** - * Get the created value. + * Get gets the time this iteration was completed. * * @return the created value */ @@ -152,7 +152,7 @@ public DateTime created() { } /** - * Get the lastModified value. + * Get gets the time this iteration was last modified. * * @return the lastModified value */ @@ -161,7 +161,7 @@ public DateTime lastModified() { } /** - * Get the trainedAt value. + * Get gets the time this iteration was last modified. * * @return the trainedAt value */ @@ -170,7 +170,7 @@ public DateTime trainedAt() { } /** - * Get the projectId value. + * Get gets The project id. of the iteration. * * @return the projectId value */ @@ -179,7 +179,7 @@ public UUID projectId() { } /** - * Get the exportable value. + * Get whether the iteration can be exported to another format for download. * * @return the exportable value */ @@ -188,7 +188,7 @@ public boolean exportable() { } /** - * Get the domainId value. + * Get get or sets a guid of the domain the iteration has been trained on. * * @return the domainId value */ @@ -197,7 +197,7 @@ public UUID domainId() { } /** - * Get the classificationType value. + * Get gets the classification type of the project. Possible values include: 'Multiclass', 'Multilabel'. * * @return the classificationType value */ diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/IterationPerformance.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/IterationPerformance.java index eec95575cf0f..6675a83dfbf1 100644 --- a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/IterationPerformance.java +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/IterationPerformance.java @@ -52,7 +52,7 @@ public class IterationPerformance { private Double averagePrecision; /** - * Get the perTagPerformance value. + * Get gets the per-tag performance details for this iteration. * * @return the perTagPerformance value */ @@ -61,7 +61,7 @@ public List perTagPerformance() { } /** - * Get the precision value. + * Get gets the precision. * * @return the precision value */ @@ -70,7 +70,7 @@ public double precision() { } /** - * Get the precisionStdDeviation value. + * Get gets the standard deviation for the precision. * * @return the precisionStdDeviation value */ @@ -79,7 +79,7 @@ public double precisionStdDeviation() { } /** - * Get the recall value. + * Get gets the recall. * * @return the recall value */ @@ -88,7 +88,7 @@ public double recall() { } /** - * Get the recallStdDeviation value. + * Get gets the standard deviation for the recall. * * @return the recallStdDeviation value */ @@ -97,7 +97,7 @@ public double recallStdDeviation() { } /** - * Get the averagePrecision value. + * Get gets the average precision when applicable. * * @return the averagePrecision value */ diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/PredictionQueryToken.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/PredictionQueryToken.java index bfaed30a24a4..9ac03c4c673a 100644 --- a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/PredictionQueryToken.java +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/PredictionQueryToken.java @@ -132,7 +132,7 @@ public PredictionQueryToken withMaxCount(int maxCount) { } /** - * Get the orderBy value. + * Get possible values include: 'Newest', 'Oldest', 'Suggested'. * * @return the orderBy value */ @@ -141,7 +141,7 @@ public OrderBy orderBy() { } /** - * Set the orderBy value. + * Set possible values include: 'Newest', 'Oldest', 'Suggested'. * * @param orderBy the orderBy value to set * @return the PredictionQueryToken object itself. diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Project.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Project.java index 31dd5e249e6e..6c0cda37cab8 100644 --- a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Project.java +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Project.java @@ -17,7 +17,7 @@ */ public class Project { /** - * Gets the project id. + * Gets The project id. */ @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private UUID id; @@ -47,7 +47,7 @@ public class Project { private DateTime created; /** - * Gets the date this project was last modifed. + * Gets the date this project was last modified. */ @JsonProperty(value = "lastModified", access = JsonProperty.Access.WRITE_ONLY) private DateTime lastModified; @@ -59,7 +59,7 @@ public class Project { private String thumbnailUri; /** - * Get the id value. + * Get gets The project id. * * @return the id value */ @@ -68,7 +68,7 @@ public UUID id() { } /** - * Get the name value. + * Get gets or sets the name of the project. * * @return the name value */ @@ -77,7 +77,7 @@ public String name() { } /** - * Set the name value. + * Set gets or sets the name of the project. * * @param name the name value to set * @return the Project object itself. @@ -88,7 +88,7 @@ public Project withName(String name) { } /** - * Get the description value. + * Get gets or sets the description of the project. * * @return the description value */ @@ -97,7 +97,7 @@ public String description() { } /** - * Set the description value. + * Set gets or sets the description of the project. * * @param description the description value to set * @return the Project object itself. @@ -108,7 +108,7 @@ public Project withDescription(String description) { } /** - * Get the settings value. + * Get gets or sets the project settings. * * @return the settings value */ @@ -117,7 +117,7 @@ public ProjectSettings settings() { } /** - * Set the settings value. + * Set gets or sets the project settings. * * @param settings the settings value to set * @return the Project object itself. @@ -128,7 +128,7 @@ public Project withSettings(ProjectSettings settings) { } /** - * Get the created value. + * Get gets the date this project was created. * * @return the created value */ @@ -137,7 +137,7 @@ public DateTime created() { } /** - * Get the lastModified value. + * Get gets the date this project was last modified. * * @return the lastModified value */ @@ -146,7 +146,7 @@ public DateTime lastModified() { } /** - * Get the thumbnailUri value. + * Get gets the thumbnail url representing the project. * * @return the thumbnailUri value */ diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ProjectSettings.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ProjectSettings.java index ba8855458e12..7251c06cd8c0 100644 --- a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ProjectSettings.java +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ProjectSettings.java @@ -29,7 +29,7 @@ public class ProjectSettings { private Classifier classificationType; /** - * Get the domainId value. + * Get gets or sets the id of the Domain to use with this project. * * @return the domainId value */ @@ -38,7 +38,7 @@ public UUID domainId() { } /** - * Set the domainId value. + * Set gets or sets the id of the Domain to use with this project. * * @param domainId the domainId value to set * @return the ProjectSettings object itself. @@ -49,7 +49,7 @@ public ProjectSettings withDomainId(UUID domainId) { } /** - * Get the classificationType value. + * Get gets or sets the classification type of the project. Possible values include: 'Multiclass', 'Multilabel'. * * @return the classificationType value */ @@ -58,7 +58,7 @@ public Classifier classificationType() { } /** - * Set the classificationType value. + * Set gets or sets the classification type of the project. Possible values include: 'Multiclass', 'Multilabel'. * * @param classificationType the classificationType value to set * @return the ProjectSettings object itself. diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Region.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Region.java index 1c9cf038292c..b99d47579584 100644 --- a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Region.java +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Region.java @@ -16,7 +16,7 @@ */ public class Region { /** - * The tagId property. + * Id of the tag associated with this region. */ @JsonProperty(value = "tagId") private UUID tagId; @@ -46,7 +46,7 @@ public class Region { private double height; /** - * Get the tagId value. + * Get id of the tag associated with this region. * * @return the tagId value */ @@ -55,7 +55,7 @@ public UUID tagId() { } /** - * Set the tagId value. + * Set id of the tag associated with this region. * * @param tagId the tagId value to set * @return the Region object itself. diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/StoredImagePrediction.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/StoredImagePrediction.java index 763004edf3f6..89d015ec416c 100644 --- a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/StoredImagePrediction.java +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/StoredImagePrediction.java @@ -18,19 +18,25 @@ */ public class StoredImagePrediction { /** - * The imageUri property. + * The URI to the (resized) prediction image. */ - @JsonProperty(value = "imageUri", access = JsonProperty.Access.WRITE_ONLY) - private String imageUri; + @JsonProperty(value = "resizedImageUri", access = JsonProperty.Access.WRITE_ONLY) + private String resizedImageUri; /** - * The thumbnailUri property. + * The URI to the thumbnail of the original prediction image. */ @JsonProperty(value = "thumbnailUri", access = JsonProperty.Access.WRITE_ONLY) private String thumbnailUri; /** - * The domain property. + * The URI to the original prediction image. + */ + @JsonProperty(value = "originalImageUri", access = JsonProperty.Access.WRITE_ONLY) + private String originalImageUri; + + /** + * Domain used for the prediction. */ @JsonProperty(value = "domain", access = JsonProperty.Access.WRITE_ONLY) private UUID domain; @@ -66,16 +72,16 @@ public class StoredImagePrediction { private List predictions; /** - * Get the imageUri value. + * Get the URI to the (resized) prediction image. * - * @return the imageUri value + * @return the resizedImageUri value */ - public String imageUri() { - return this.imageUri; + public String resizedImageUri() { + return this.resizedImageUri; } /** - * Get the thumbnailUri value. + * Get the URI to the thumbnail of the original prediction image. * * @return the thumbnailUri value */ @@ -84,7 +90,16 @@ public String thumbnailUri() { } /** - * Get the domain value. + * Get the URI to the original prediction image. + * + * @return the originalImageUri value + */ + public String originalImageUri() { + return this.originalImageUri; + } + + /** + * Get domain used for the prediction. * * @return the domain value */ diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Tag.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Tag.java index 42de469690e0..d169271ecd84 100644 --- a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Tag.java +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Tag.java @@ -33,6 +33,13 @@ public class Tag { @JsonProperty(value = "description") private String description; + /** + * Gets or sets the type of the tag. Possible values include: 'Regular', + * 'Negative'. + */ + @JsonProperty(value = "type") + private TagType type; + /** * Gets the number of images with this tag. */ @@ -40,7 +47,7 @@ public class Tag { private int imageCount; /** - * Get the id value. + * Get gets the Tag ID. * * @return the id value */ @@ -49,7 +56,7 @@ public UUID id() { } /** - * Get the name value. + * Get gets or sets the name of the tag. * * @return the name value */ @@ -58,7 +65,7 @@ public String name() { } /** - * Set the name value. + * Set gets or sets the name of the tag. * * @param name the name value to set * @return the Tag object itself. @@ -69,7 +76,7 @@ public Tag withName(String name) { } /** - * Get the description value. + * Get gets or sets the description of the tag. * * @return the description value */ @@ -78,7 +85,7 @@ public String description() { } /** - * Set the description value. + * Set gets or sets the description of the tag. * * @param description the description value to set * @return the Tag object itself. @@ -89,7 +96,27 @@ public Tag withDescription(String description) { } /** - * Get the imageCount value. + * Get gets or sets the type of the tag. Possible values include: 'Regular', 'Negative'. + * + * @return the type value + */ + public TagType type() { + return this.type; + } + + /** + * Set gets or sets the type of the tag. Possible values include: 'Regular', 'Negative'. + * + * @param type the type value to set + * @return the Tag object itself. + */ + public Tag withType(TagType type) { + this.type = type; + return this; + } + + /** + * Get gets the number of images with this tag. * * @return the imageCount value */ diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/TagPerformance.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/TagPerformance.java index c19f74b0e4a3..e4d9c26e28da 100644 --- a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/TagPerformance.java +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/TagPerformance.java @@ -76,7 +76,7 @@ public String name() { } /** - * Get the precision value. + * Get gets the precision. * * @return the precision value */ @@ -85,7 +85,7 @@ public double precision() { } /** - * Get the precisionStdDeviation value. + * Get gets the standard deviation for the precision. * * @return the precisionStdDeviation value */ @@ -94,7 +94,7 @@ public double precisionStdDeviation() { } /** - * Get the recall value. + * Get gets the recall. * * @return the recall value */ @@ -103,7 +103,7 @@ public double recall() { } /** - * Get the recallStdDeviation value. + * Get gets the standard deviation for the recall. * * @return the recallStdDeviation value */ @@ -112,7 +112,7 @@ public double recallStdDeviation() { } /** - * Get the averagePrecision value. + * Get gets the average precision when applicable. * * @return the averagePrecision value */ diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/TagType.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/TagType.java new file mode 100644 index 000000000000..de7e24225dfb --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/TagType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.cognitiveservices.vision.customvision.training.models; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TagType. + */ +public final class TagType extends ExpandableStringEnum { + /** Static value Regular for TagType. */ + public static final TagType REGULAR = fromString("Regular"); + + /** Static value Negative for TagType. */ + public static final TagType NEGATIVE = fromString("Negative"); + + /** + * Creates or finds a TagType from its string representation. + * @param name a name to look for + * @return the corresponding TagType + */ + @JsonCreator + public static TagType fromString(String name) { + return fromString(name, TagType.class); + } + + /** + * @return known TagType values + */ + public static Collection values() { + return values(TagType.class); + } +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/package-info.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/package-info.java index a23776b5606c..06f9626aacbd 100644 --- a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/package-info.java +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/package-info.java @@ -5,6 +5,6 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * This package contains the models classes for TrainingApi. + * This package contains the models classes for CustomVisionTrainingClient. */ package com.microsoft.azure.cognitiveservices.vision.customvision.training.models; diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/package-info.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/package-info.java index 40cf7938d6de..92a37b7d2484 100644 --- a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/package-info.java +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/package-info.java @@ -5,6 +5,6 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * This package contains the classes for TrainingApi. + * This package contains the classes for CustomVisionTrainingClient. */ package com.microsoft.azure.cognitiveservices.vision.customvision.training;