From 80e8125193eae252b3a4ed77a33c030357e801d5 Mon Sep 17 00:00:00 2001 From: Jianghao Lu Date: Fri, 13 Sep 2019 10:45:57 -0700 Subject: [PATCH 1/2] Regenerate custom vision prediction --- .../implementation/package-info.java | 2 +- .../prediction/models/BoundingBox.java | 18 +++++++++--------- .../prediction/models/ImagePrediction.java | 12 ++++++------ .../prediction/models/ImageUrl.java | 6 +++--- .../prediction/models/Prediction.java | 10 +++++----- .../prediction/models/package-info.java | 2 +- .../customvision/prediction/package-info.java | 2 +- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/package-info.java b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/package-info.java index b57774622496..1b58a050731e 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/package-info.java +++ b/sdk/cognitiveservices/ms-azure-cs-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/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/BoundingBox.java b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/BoundingBox.java index 48cce04f1dfa..4f9ce6ec99fb 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/BoundingBox.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/BoundingBox.java @@ -11,31 +11,31 @@ 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") + @JsonProperty(value = "left", required = true) private double left; /** - * The top property. + * Coordinate of the top boundary. */ - @JsonProperty(value = "top") + @JsonProperty(value = "top", required = true) private double top; /** - * The width property. + * Width. */ - @JsonProperty(value = "width") + @JsonProperty(value = "width", required = true) private double width; /** - * The height property. + * Height. */ - @JsonProperty(value = "height") + @JsonProperty(value = "height", required = true) private double height; /** diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ImagePrediction.java b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ImagePrediction.java index 728d0f28c449..bccb9a66ae8c 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ImagePrediction.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ImagePrediction.java @@ -14,35 +14,35 @@ 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; diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ImageUrl.java b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ImageUrl.java index 079b6e21446e..9a62db2a994b 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ImageUrl.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ImageUrl.java @@ -11,13 +11,13 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The ImageUrl model. + * Image url. */ public class ImageUrl { /** - * The url property. + * Url of the image. */ - @JsonProperty(value = "url") + @JsonProperty(value = "url", required = true) private String url; /** diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/Prediction.java b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/Prediction.java index 1735949fc348..2deada193085 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/Prediction.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/Prediction.java @@ -12,29 +12,29 @@ 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; diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/package-info.java b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/package-info.java index 3a76c984fb2a..fa3b8487472b 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/package-info.java +++ b/sdk/cognitiveservices/ms-azure-cs-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/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/package-info.java b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/package-info.java index b44683ce86ed..f90bebdd2fef 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/package-info.java +++ b/sdk/cognitiveservices/ms-azure-cs-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; From 8b8845a4bc7af8649dad4a7550f668442fa78cc8 Mon Sep 17 00:00:00 2001 From: Jianghao Lu Date: Fri, 13 Sep 2019 11:40:32 -0700 Subject: [PATCH 2/2] Regenerate prediction and training for custom vision --- .../pom.xml | 4 +- ...java => CustomVisionPredictionClient.java} | 31 +- .../CustomVisionPredictionManager.java | 16 +- .../customvision/prediction/Predictions.java | 725 ++- ... => CustomVisionPredictionClientImpl.java} | 59 +- .../implementation/PredictionsImpl.java | 1330 ++++- ...va => ClassifyImageOptionalParameter.java} | 40 +- ...=> ClassifyImageUrlOptionalParameter.java} | 40 +- ...yImageUrlWithNoStoreOptionalParameter.java | 66 + ...sifyImageWithNoStoreOptionalParameter.java | 66 + .../prediction/models/CustomVisionError.java | 135 + .../models/CustomVisionErrorCodes.java | 371 ++ .../models/CustomVisionErrorException.java | 44 + .../models/DetectImageOptionalParameter.java | 66 + .../DetectImageUrlOptionalParameter.java | 66 + ...tImageUrlWithNoStoreOptionalParameter.java | 66 + ...tectImageWithNoStoreOptionalParameter.java | 66 + .../PredictImageUrlOptionalParameter.java | 119 - ...tImageUrlWithNoStoreOptionalParameter.java | 119 - .../ms-azure-cs-customvision-training/pom.xml | 4 +- ...i.java => CustomVisionTrainingClient.java} | 31 +- .../training/CustomVisionTrainingManager.java | 16 +- .../customvision/training/Trainings.java | 2056 +++---- ...va => CustomVisionTrainingClientImpl.java} | 61 +- .../implementation/TrainingsImpl.java | 4730 +++++++++-------- .../training/implementation/package-info.java | 2 +- .../training/models/BoundingBox.java | 18 +- .../CreateImageTagsOptionalParameter.java | 2 +- ...CreateImagesFromDataOptionalParameter.java | 7 +- .../CreateProjectOptionalParameter.java | 26 + .../models/CreateTagOptionalParameter.java | 26 + .../training/models/CustomVisionError.java | 135 + .../models/CustomVisionErrorCodes.java | 374 ++ .../models/CustomVisionErrorException.java | 44 + .../customvision/training/models/Export.java | 18 +- .../training/models/ExportFlavor.java | 9 + .../ExportIterationOptionalParameter.java | 4 +- .../training/models/ExportPlatform.java | 3 + .../training/models/ExportStatus.java | 44 + .../training/models/ExportStatusModel.java | 44 - ...magePerformanceCountOptionalParameter.java | 7 +- ...GetImagePerformancesOptionalParameter.java | 7 +- .../GetImagesByIdsOptionalParameter.java | 6 +- .../GetTaggedImageCountOptionalParameter.java | 6 +- .../GetTaggedImagesOptionalParameter.java | 6 +- .../customvision/training/models/Image.java | 43 +- .../training/models/ImageCreateResult.java | 17 +- .../training/models/ImageCreateStatus.java | 68 + .../training/models/ImageCreateSummary.java | 5 +- .../training/models/ImageIdCreateEntry.java | 2 +- .../training/models/ImagePrediction.java | 12 +- .../training/models/ImageRegion.java | 20 +- .../models/ImageRegionCreateEntry.java | 26 +- .../models/ImageRegionCreateResult.java | 20 +- .../training/models/ImageTagCreateBatch.java | 4 +- .../training/models/ImageTagCreateEntry.java | 6 +- .../training/models/ImageUploadStatus.java | 65 - .../training/models/ImageUrl.java | 6 +- .../training/models/ImageUrlCreateEntry.java | 4 +- .../training/models/Iteration.java | 106 +- .../training/models/Prediction.java | 10 +- .../customvision/training/models/Project.java | 25 +- .../training/models/ProjectSettings.java | 28 + .../QuickTestImageUrlOptionalParameter.java | 25 - .../customvision/training/models/Region.java | 20 +- .../models/StoredImagePrediction.java | 43 +- .../customvision/training/models/Tag.java | 31 +- .../customvision/training/models/TagType.java | 41 + .../models/TrainProjectOptionalParameter.java | 144 + .../training/models/TrainingType.java | 41 + .../training/models/package-info.java | 2 +- .../customvision/training/package-info.java | 2 +- 72 files changed, 7839 insertions(+), 4092 deletions(-) rename sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/{PredictionEndpoint.java => CustomVisionPredictionClient.java} (74%) rename sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/{PredictionEndpointImpl.java => CustomVisionPredictionClientImpl.java} (72%) rename sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/{PredictImageOptionalParameter.java => ClassifyImageOptionalParameter.java} (55%) rename sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/{PredictImageWithNoStoreOptionalParameter.java => ClassifyImageUrlOptionalParameter.java} (53%) create mode 100644 sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ClassifyImageUrlWithNoStoreOptionalParameter.java create mode 100644 sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ClassifyImageWithNoStoreOptionalParameter.java create mode 100644 sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/CustomVisionError.java create mode 100644 sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/CustomVisionErrorCodes.java create mode 100644 sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/CustomVisionErrorException.java create mode 100644 sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/DetectImageOptionalParameter.java create mode 100644 sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/DetectImageUrlOptionalParameter.java create mode 100644 sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/DetectImageUrlWithNoStoreOptionalParameter.java create mode 100644 sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/DetectImageWithNoStoreOptionalParameter.java delete mode 100644 sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/PredictImageUrlOptionalParameter.java delete mode 100644 sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/PredictImageUrlWithNoStoreOptionalParameter.java rename sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/{TrainingApi.java => CustomVisionTrainingClient.java} (74%) rename sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/{TrainingApiImpl.java => CustomVisionTrainingClientImpl.java} (72%) create mode 100644 sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CustomVisionError.java create mode 100644 sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CustomVisionErrorCodes.java create mode 100644 sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CustomVisionErrorException.java create mode 100644 sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportStatus.java delete mode 100644 sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportStatusModel.java create mode 100644 sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageCreateStatus.java delete mode 100644 sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageUploadStatus.java create mode 100644 sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/TagType.java create mode 100644 sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/TrainProjectOptionalParameter.java create mode 100644 sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/TrainingType.java diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/pom.xml b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/pom.xml index 62e0394ca71b..821f65b7c513 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/pom.xml +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/pom.xml @@ -14,7 +14,7 @@ ../../../pom.data.xml azure-cognitiveservices-customvision-prediction - 1.1.0-preview.1 + 1.1.0-preview.2 jar Microsoft Azure SDK for Cognitive Service Custom Vision Prediction This package contains Microsoft Cognitive Service Custom Vision Prediction SDK. @@ -88,4 +88,4 @@ - \ No newline at end of file + diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/PredictionEndpoint.java b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/CustomVisionPredictionClient.java similarity index 74% rename from sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/PredictionEndpoint.java rename to sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/CustomVisionPredictionClient.java index af52578febfc..013701ba15d7 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/PredictionEndpoint.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/CustomVisionPredictionClient.java @@ -12,9 +12,9 @@ import com.microsoft.rest.RestClient; /** - * The interface for PredictionEndpoint class. + * The interface for CustomVisionPredictionClient class. */ -public interface PredictionEndpoint { +public interface CustomVisionPredictionClient { /** * Gets the REST client. * @@ -36,19 +36,34 @@ public interface PredictionEndpoint { String userAgent(); /** - * Gets . + * Gets API key.. * * @return the apiKey value. */ String apiKey(); /** - * Sets . + * Sets API key.. * * @param apiKey the apiKey value. * @return the service client itself */ - PredictionEndpoint withApiKey(String apiKey); + 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 Gets or sets the preferred language for the response.. @@ -63,7 +78,7 @@ public interface PredictionEndpoint { * @param acceptLanguage the acceptLanguage value. * @return the service client itself */ - PredictionEndpoint withAcceptLanguage(String acceptLanguage); + CustomVisionPredictionClient withAcceptLanguage(String acceptLanguage); /** * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. @@ -78,7 +93,7 @@ public interface PredictionEndpoint { * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. * @return the service client itself */ - PredictionEndpoint withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout); + CustomVisionPredictionClient withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout); /** * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. @@ -93,7 +108,7 @@ public interface PredictionEndpoint { * @param generateClientRequestId the generateClientRequestId value. * @return the service client itself */ - PredictionEndpoint withGenerateClientRequestId(boolean generateClientRequestId); + CustomVisionPredictionClient withGenerateClientRequestId(boolean generateClientRequestId); /** * Gets the Predictions object to access its operations. diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/CustomVisionPredictionManager.java b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/CustomVisionPredictionManager.java index cd0c09735463..09e46676aa62 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/CustomVisionPredictionManager.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/CustomVisionPredictionManager.java @@ -6,7 +6,7 @@ package com.microsoft.azure.cognitiveservices.vision.customvision.prediction; -import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.implementation.PredictionEndpointImpl; +import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.implementation.CustomVisionPredictionClientImpl; import com.microsoft.rest.RestClient; import com.microsoft.rest.credentials.ServiceClientCredentials; import okhttp3.OkHttpClient; @@ -21,7 +21,7 @@ public class CustomVisionPredictionManager { * @param apiKey the Custom Vision Prediction API key * @return the Computer Vision API client */ - public static PredictionEndpoint authenticate(String apiKey) { + public static CustomVisionPredictionClient authenticate(String apiKey) { return authenticate("https://southcentralus.api.cognitive.microsoft.com/customvision/v2.0/Prediction/", apiKey); } @@ -32,7 +32,7 @@ public static PredictionEndpoint authenticate(String apiKey) { * @param apiKey the Custom Vision Prediction API key * @return the Custom Vision Prediction API client */ - public static PredictionEndpoint authenticate(String baseUrl, final String apiKey) { + public static CustomVisionPredictionClient authenticate(String baseUrl, final String apiKey) { ServiceClientCredentials serviceClientCredentials = new ServiceClientCredentials() { @Override public void applyCredentialsFilter(OkHttpClient.Builder builder) { @@ -48,7 +48,7 @@ public void applyCredentialsFilter(OkHttpClient.Builder builder) { * @param apiKey the Custom Vision Prediction API key * @return the Computer Vision API client */ - public static PredictionEndpoint authenticate(ServiceClientCredentials credentials, final String apiKey) { + public static CustomVisionPredictionClient authenticate(ServiceClientCredentials credentials, final String apiKey) { return authenticate("https://southcentralus.api.cognitive.microsoft.com/customvision/v2.0/Prediction/", credentials, apiKey); } @@ -60,8 +60,8 @@ public static PredictionEndpoint authenticate(ServiceClientCredentials credentia * @param apiKey the Custom Vision Prediction API key * @return the Custom Vision Prediction API client */ - public static PredictionEndpoint authenticate(String baseUrl, ServiceClientCredentials credentials, final String apiKey) { - return new PredictionEndpointImpl(baseUrl, credentials).withApiKey(apiKey); + public static CustomVisionPredictionClient authenticate(String baseUrl, ServiceClientCredentials credentials, final String apiKey) { + return new CustomVisionPredictionClientImpl(baseUrl, credentials).withApiKey(apiKey); } /** @@ -71,7 +71,7 @@ public static PredictionEndpoint authenticate(String baseUrl, ServiceClientCrede * @param apiKey the Custom Vision Prediction API key * @return the Custom Vision Prediction API client */ - public static PredictionEndpoint authenticate(RestClient restClient, final String apiKey) { - return new PredictionEndpointImpl(restClient).withApiKey(apiKey); + public static CustomVisionPredictionClient authenticate(RestClient restClient, final String apiKey) { + return new CustomVisionPredictionClientImpl(restClient).withApiKey(apiKey); } } diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/Predictions.java b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/Predictions.java index 75bf2eefb553..99c8be336d42 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/Predictions.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/Predictions.java @@ -8,12 +8,17 @@ package com.microsoft.azure.cognitiveservices.vision.customvision.prediction; -import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.PredictImageWithNoStoreOptionalParameter; -import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.PredictImageUrlWithNoStoreOptionalParameter; -import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.PredictImageOptionalParameter; -import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.PredictImageUrlOptionalParameter; -import com.microsoft.azure.CloudException; +import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.DetectImageWithNoStoreOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.DetectImageUrlWithNoStoreOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.DetectImageOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.DetectImageUrlOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.ClassifyImageWithNoStoreOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.ClassifyImageUrlWithNoStoreOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.ClassifyImageOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.ClassifyImageUrlOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.CustomVisionErrorException; import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.ImagePrediction; +import java.io.IOException; import java.util.UUID; import rx.Observable; @@ -23,42 +28,42 @@ */ public interface Predictions { /** - * Predict an image without saving the result. + * Detect objects in an image without saving the result. * * @param projectId The project id. - * @param imageData the InputStream value. - * @param predictImageWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 0MB. + * @param detectImageWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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. */ - @Deprecated - ImagePrediction predictImageWithNoStore(UUID projectId, byte[] imageData, PredictImageWithNoStoreOptionalParameter predictImageWithNoStoreOptionalParameter); + ImagePrediction detectImageWithNoStore(UUID projectId, String publishedName, byte[] imageData, DetectImageWithNoStoreOptionalParameter detectImageWithNoStoreOptionalParameter); /** - * Predict an image without saving the result. + * Detect objects in an image without saving the result. * * @param projectId The project id. - * @param imageData the InputStream value. - * @param predictImageWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 0MB. + * @param detectImageWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ImagePrediction object */ - @Deprecated - Observable predictImageWithNoStoreAsync(UUID projectId, byte[] imageData, PredictImageWithNoStoreOptionalParameter predictImageWithNoStoreOptionalParameter); + Observable detectImageWithNoStoreAsync(UUID projectId, String publishedName, byte[] imageData, DetectImageWithNoStoreOptionalParameter detectImageWithNoStoreOptionalParameter); /** - * Predict an image without saving the result. + * Detect objects in an image without saving the result. * - * @return the first stage of the predictImageWithNoStore call + * @return the first stage of the detectImageWithNoStore call */ - PredictionsPredictImageWithNoStoreDefinitionStages.WithProjectId predictImageWithNoStore(); + PredictionsDetectImageWithNoStoreDefinitionStages.WithProjectId detectImageWithNoStore(); /** - * Grouping of predictImageWithNoStore definition stages. + * Grouping of detectImageWithNoStore definition stages. */ - interface PredictionsPredictImageWithNoStoreDefinitionStages { + interface PredictionsDetectImageWithNoStoreDefinitionStages { /** * The stage of the definition to be specify projectId. */ @@ -68,18 +73,29 @@ interface WithProjectId { * * @return next definition stage */ - WithImageData withProjectId(UUID projectId); + WithPublishedName withProjectId(UUID projectId); + } + /** + * The stage of the definition to be specify publishedName. + */ + interface WithPublishedName { + /** + * Specifies the name of the model to evaluate against. + * + * @return next definition stage + */ + WithImageData withPublishedName(String publishedName); } /** * The stage of the definition to be specify imageData. */ interface WithImageData { /** - * + * Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 0MB. * * @return next definition stage */ - PredictionsPredictImageWithNoStoreDefinitionStages.WithExecute withImageData(byte[] imageData); + PredictionsDetectImageWithNoStoreDefinitionStages.WithExecute withImageData(byte[] imageData); } /** @@ -87,26 +103,132 @@ interface WithImageData { */ interface WithAllOptions { /** - * Optional. Specifies the id of a particular iteration to evaluate against. - * The default iteration for the project will be used when not specified. + * Optional. Specifies the name of application using the endpoint. * * @return next definition stage */ - PredictionsPredictImageWithNoStoreDefinitionStages.WithExecute withIterationId(UUID iterationId); + PredictionsDetectImageWithNoStoreDefinitionStages.WithExecute withApplication(String application); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends PredictionsDetectImageWithNoStoreDefinitionStages.WithAllOptions { + /** + * Execute the request. + * + * @return the ImagePrediction object if successful. + */ + ImagePrediction execute(); + /** + * Execute the request asynchronously. + * + * @return the observable to the ImagePrediction object + */ + Observable executeAsync(); + } + } + + /** + * The entirety of detectImageWithNoStore definition. + */ + interface PredictionsDetectImageWithNoStoreDefinition extends + PredictionsDetectImageWithNoStoreDefinitionStages.WithProjectId, + PredictionsDetectImageWithNoStoreDefinitionStages.WithPublishedName, + PredictionsDetectImageWithNoStoreDefinitionStages.WithImageData, + PredictionsDetectImageWithNoStoreDefinitionStages.WithExecute { + } + + /** + * Detect objects in an image url without saving the result. + * + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param url Url of the image. + * @param detectImageUrlWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 publishedName, String url, DetectImageUrlWithNoStoreOptionalParameter detectImageUrlWithNoStoreOptionalParameter); + + /** + * Detect objects in an image url without saving the result. + * + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param url Url of the image. + * @param detectImageUrlWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable detectImageUrlWithNoStoreAsync(UUID projectId, String publishedName, String url, DetectImageUrlWithNoStoreOptionalParameter detectImageUrlWithNoStoreOptionalParameter); + + /** + * Detect objects in an image url without saving the result. + * + * @return the first stage of the detectImageUrlWithNoStore call + */ + PredictionsDetectImageUrlWithNoStoreDefinitionStages.WithProjectId detectImageUrlWithNoStore(); + + /** + * Grouping of detectImageUrlWithNoStore definition stages. + */ + interface PredictionsDetectImageUrlWithNoStoreDefinitionStages { + /** + * The stage of the definition to be specify projectId. + */ + interface WithProjectId { + /** + * The project id. + * + * @return next definition stage + */ + WithPublishedName withProjectId(UUID projectId); + } + /** + * The stage of the definition to be specify publishedName. + */ + interface WithPublishedName { + /** + * Specifies the name of the model to evaluate against. + * + * @return next definition stage + */ + WithUrl withPublishedName(String publishedName); + } + /** + * The stage of the definition to be specify url. + */ + interface WithUrl { + /** + * Url of the image. + * + * @return next definition stage + */ + PredictionsDetectImageUrlWithNoStoreDefinitionStages.WithExecute withUrl(String url); + } + + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + interface WithAllOptions { /** * Optional. Specifies the name of application using the endpoint. * * @return next definition stage */ - PredictionsPredictImageWithNoStoreDefinitionStages.WithExecute withApplication(String application); + PredictionsDetectImageUrlWithNoStoreDefinitionStages.WithExecute withApplication(String application); } /** * The last stage of the definition which will make the operation call. */ - interface WithExecute extends PredictionsPredictImageWithNoStoreDefinitionStages.WithAllOptions { + interface WithExecute extends PredictionsDetectImageUrlWithNoStoreDefinitionStages.WithAllOptions { /** * Execute the request. * @@ -124,49 +246,52 @@ interface WithExecute extends PredictionsPredictImageWithNoStoreDefinitionStages } /** - * The entirety of predictImageWithNoStore definition. + * The entirety of detectImageUrlWithNoStore definition. */ - interface PredictionsPredictImageWithNoStoreDefinition extends - PredictionsPredictImageWithNoStoreDefinitionStages.WithProjectId, - PredictionsPredictImageWithNoStoreDefinitionStages.WithImageData, - PredictionsPredictImageWithNoStoreDefinitionStages.WithExecute { + interface PredictionsDetectImageUrlWithNoStoreDefinition extends + PredictionsDetectImageUrlWithNoStoreDefinitionStages.WithProjectId, + PredictionsDetectImageUrlWithNoStoreDefinitionStages.WithPublishedName, + PredictionsDetectImageUrlWithNoStoreDefinitionStages.WithUrl, + PredictionsDetectImageUrlWithNoStoreDefinitionStages.WithExecute { } /** - * Predict an image url without saving the result. + * Detect objects in an image and saves the result. * * @param projectId The project id. - * @param predictImageUrlWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 4MB. + * @param detectImageOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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. */ - @Deprecated - ImagePrediction predictImageUrlWithNoStore(UUID projectId, PredictImageUrlWithNoStoreOptionalParameter predictImageUrlWithNoStoreOptionalParameter); + ImagePrediction detectImage(UUID projectId, String publishedName, byte[] imageData, DetectImageOptionalParameter detectImageOptionalParameter); /** - * Predict an image url without saving the result. + * Detect objects in an image and saves the result. * * @param projectId The project id. - * @param predictImageUrlWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 4MB. + * @param detectImageOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ImagePrediction object */ - @Deprecated - Observable predictImageUrlWithNoStoreAsync(UUID projectId, PredictImageUrlWithNoStoreOptionalParameter predictImageUrlWithNoStoreOptionalParameter); + Observable detectImageAsync(UUID projectId, String publishedName, byte[] imageData, DetectImageOptionalParameter detectImageOptionalParameter); /** - * Predict an image url without saving the result. + * Detect objects in an image and saves the result. * - * @return the first stage of the predictImageUrlWithNoStore call + * @return the first stage of the detectImage call */ - PredictionsPredictImageUrlWithNoStoreDefinitionStages.WithProjectId predictImageUrlWithNoStore(); + PredictionsDetectImageDefinitionStages.WithProjectId detectImage(); /** - * Grouping of predictImageUrlWithNoStore definition stages. + * Grouping of detectImage definition stages. */ - interface PredictionsPredictImageUrlWithNoStoreDefinitionStages { + interface PredictionsDetectImageDefinitionStages { /** * The stage of the definition to be specify projectId. */ @@ -176,7 +301,29 @@ interface WithProjectId { * * @return next definition stage */ - PredictionsPredictImageUrlWithNoStoreDefinitionStages.WithExecute withProjectId(UUID projectId); + WithPublishedName withProjectId(UUID projectId); + } + /** + * The stage of the definition to be specify publishedName. + */ + interface WithPublishedName { + /** + * Specifies the name of the model to evaluate against. + * + * @return next definition stage + */ + WithImageData withPublishedName(String publishedName); + } + /** + * The stage of the definition to be specify imageData. + */ + interface WithImageData { + /** + * Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 4MB. + * + * @return next definition stage + */ + PredictionsDetectImageDefinitionStages.WithExecute withImageData(byte[] imageData); } /** @@ -184,33 +331,132 @@ interface WithProjectId { */ interface WithAllOptions { /** - * Optional. Specifies the id of a particular iteration to evaluate against. - * The default iteration for the project will be used when not specified. + * Optional. Specifies the name of application using the endpoint. * * @return next definition stage */ - PredictionsPredictImageUrlWithNoStoreDefinitionStages.WithExecute withIterationId(UUID iterationId); + PredictionsDetectImageDefinitionStages.WithExecute withApplication(String application); + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends PredictionsDetectImageDefinitionStages.WithAllOptions { /** - * Optional. Specifies the name of application using the endpoint. + * Execute the request. * - * @return next definition stage + * @return the ImagePrediction object if successful. */ - PredictionsPredictImageUrlWithNoStoreDefinitionStages.WithExecute withApplication(String application); + ImagePrediction execute(); /** + * Execute the request asynchronously. * + * @return the observable to the ImagePrediction object + */ + Observable executeAsync(); + } + } + + /** + * The entirety of detectImage definition. + */ + interface PredictionsDetectImageDefinition extends + PredictionsDetectImageDefinitionStages.WithProjectId, + PredictionsDetectImageDefinitionStages.WithPublishedName, + PredictionsDetectImageDefinitionStages.WithImageData, + PredictionsDetectImageDefinitionStages.WithExecute { + } + + /** + * Detect objects in an image url and saves the result. + * + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param url Url of the image. + * @param detectImageUrlOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 publishedName, String url, DetectImageUrlOptionalParameter detectImageUrlOptionalParameter); + + /** + * Detect objects in an image url and saves the result. + * + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param url Url of the image. + * @param detectImageUrlOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable detectImageUrlAsync(UUID projectId, String publishedName, String url, DetectImageUrlOptionalParameter detectImageUrlOptionalParameter); + + /** + * Detect objects in an image url and saves the result. + * + * @return the first stage of the detectImageUrl call + */ + PredictionsDetectImageUrlDefinitionStages.WithProjectId detectImageUrl(); + + /** + * Grouping of detectImageUrl definition stages. + */ + interface PredictionsDetectImageUrlDefinitionStages { + /** + * The stage of the definition to be specify projectId. + */ + interface WithProjectId { + /** + * The project id. + * + * @return next definition stage + */ + WithPublishedName withProjectId(UUID projectId); + } + /** + * The stage of the definition to be specify publishedName. + */ + interface WithPublishedName { + /** + * Specifies the name of the model to evaluate against. + * + * @return next definition stage + */ + WithUrl withPublishedName(String publishedName); + } + /** + * The stage of the definition to be specify url. + */ + interface WithUrl { + /** + * Url of the image. + * + * @return next definition stage + */ + PredictionsDetectImageUrlDefinitionStages.WithExecute withUrl(String url); + } + + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + interface WithAllOptions { + /** + * Optional. Specifies the name of application using the endpoint. * * @return next definition stage */ - PredictionsPredictImageUrlWithNoStoreDefinitionStages.WithExecute withUrl(String url); + PredictionsDetectImageUrlDefinitionStages.WithExecute withApplication(String application); } /** * The last stage of the definition which will make the operation call. */ - interface WithExecute extends PredictionsPredictImageUrlWithNoStoreDefinitionStages.WithAllOptions { + interface WithExecute extends PredictionsDetectImageUrlDefinitionStages.WithAllOptions { /** * Execute the request. * @@ -228,50 +474,52 @@ interface WithExecute extends PredictionsPredictImageUrlWithNoStoreDefinitionSta } /** - * The entirety of predictImageUrlWithNoStore definition. + * The entirety of detectImageUrl definition. */ - interface PredictionsPredictImageUrlWithNoStoreDefinition extends - PredictionsPredictImageUrlWithNoStoreDefinitionStages.WithProjectId, - PredictionsPredictImageUrlWithNoStoreDefinitionStages.WithExecute { + interface PredictionsDetectImageUrlDefinition extends + PredictionsDetectImageUrlDefinitionStages.WithProjectId, + PredictionsDetectImageUrlDefinitionStages.WithPublishedName, + PredictionsDetectImageUrlDefinitionStages.WithUrl, + PredictionsDetectImageUrlDefinitionStages.WithExecute { } /** - * Predict an image and saves the result. + * Classify an image without saving the result. * * @param projectId The project id. - * @param imageData the InputStream value. - * @param predictImageOptionalParameter the object representing the optional parameters to be set before calling this API + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 0MB. + * @param classifyImageWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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. */ - @Deprecated - ImagePrediction predictImage(UUID projectId, byte[] imageData, PredictImageOptionalParameter predictImageOptionalParameter); + ImagePrediction classifyImageWithNoStore(UUID projectId, String publishedName, byte[] imageData, ClassifyImageWithNoStoreOptionalParameter classifyImageWithNoStoreOptionalParameter); /** - * Predict an image and saves the result. + * Classify an image without saving the result. * * @param projectId The project id. - * @param imageData the InputStream value. - * @param predictImageOptionalParameter the object representing the optional parameters to be set before calling this API + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 0MB. + * @param classifyImageWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ImagePrediction object */ - @Deprecated - Observable predictImageAsync(UUID projectId, byte[] imageData, PredictImageOptionalParameter predictImageOptionalParameter); + Observable classifyImageWithNoStoreAsync(UUID projectId, String publishedName, byte[] imageData, ClassifyImageWithNoStoreOptionalParameter classifyImageWithNoStoreOptionalParameter); /** - * Predict an image and saves the result. + * Classify an image without saving the result. * - * @return the first stage of the predictImage call + * @return the first stage of the classifyImageWithNoStore call */ - PredictionsPredictImageDefinitionStages.WithProjectId predictImage(); + PredictionsClassifyImageWithNoStoreDefinitionStages.WithProjectId classifyImageWithNoStore(); /** - * Grouping of predictImage definition stages. + * Grouping of classifyImageWithNoStore definition stages. */ - interface PredictionsPredictImageDefinitionStages { + interface PredictionsClassifyImageWithNoStoreDefinitionStages { /** * The stage of the definition to be specify projectId. */ @@ -281,18 +529,29 @@ interface WithProjectId { * * @return next definition stage */ - WithImageData withProjectId(UUID projectId); + WithPublishedName withProjectId(UUID projectId); + } + /** + * The stage of the definition to be specify publishedName. + */ + interface WithPublishedName { + /** + * Specifies the name of the model to evaluate against. + * + * @return next definition stage + */ + WithImageData withPublishedName(String publishedName); } /** * The stage of the definition to be specify imageData. */ interface WithImageData { /** - * + * Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 0MB. * * @return next definition stage */ - PredictionsPredictImageDefinitionStages.WithExecute withImageData(byte[] imageData); + PredictionsClassifyImageWithNoStoreDefinitionStages.WithExecute withImageData(byte[] imageData); } /** @@ -300,26 +559,132 @@ interface WithImageData { */ interface WithAllOptions { /** - * Optional. Specifies the id of a particular iteration to evaluate against. - * The default iteration for the project will be used when not specified. + * Optional. Specifies the name of application using the endpoint. * * @return next definition stage */ - PredictionsPredictImageDefinitionStages.WithExecute withIterationId(UUID iterationId); + PredictionsClassifyImageWithNoStoreDefinitionStages.WithExecute withApplication(String application); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends PredictionsClassifyImageWithNoStoreDefinitionStages.WithAllOptions { + /** + * Execute the request. + * + * @return the ImagePrediction object if successful. + */ + ImagePrediction execute(); + /** + * Execute the request asynchronously. + * + * @return the observable to the ImagePrediction object + */ + Observable executeAsync(); + } + } + + /** + * The entirety of classifyImageWithNoStore definition. + */ + interface PredictionsClassifyImageWithNoStoreDefinition extends + PredictionsClassifyImageWithNoStoreDefinitionStages.WithProjectId, + PredictionsClassifyImageWithNoStoreDefinitionStages.WithPublishedName, + PredictionsClassifyImageWithNoStoreDefinitionStages.WithImageData, + PredictionsClassifyImageWithNoStoreDefinitionStages.WithExecute { + } + + /** + * Classify an image url without saving the result. + * + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param url Url of the image. + * @param classifyImageUrlWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 publishedName, String url, ClassifyImageUrlWithNoStoreOptionalParameter classifyImageUrlWithNoStoreOptionalParameter); + + /** + * Classify an image url without saving the result. + * + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param url Url of the image. + * @param classifyImageUrlWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable classifyImageUrlWithNoStoreAsync(UUID projectId, String publishedName, String url, ClassifyImageUrlWithNoStoreOptionalParameter classifyImageUrlWithNoStoreOptionalParameter); + + /** + * Classify an image url without saving the result. + * + * @return the first stage of the classifyImageUrlWithNoStore call + */ + PredictionsClassifyImageUrlWithNoStoreDefinitionStages.WithProjectId classifyImageUrlWithNoStore(); + + /** + * Grouping of classifyImageUrlWithNoStore definition stages. + */ + interface PredictionsClassifyImageUrlWithNoStoreDefinitionStages { + /** + * The stage of the definition to be specify projectId. + */ + interface WithProjectId { + /** + * The project id. + * + * @return next definition stage + */ + WithPublishedName withProjectId(UUID projectId); + } + /** + * The stage of the definition to be specify publishedName. + */ + interface WithPublishedName { + /** + * Specifies the name of the model to evaluate against. + * + * @return next definition stage + */ + WithUrl withPublishedName(String publishedName); + } + /** + * The stage of the definition to be specify url. + */ + interface WithUrl { + /** + * Url of the image. + * + * @return next definition stage + */ + PredictionsClassifyImageUrlWithNoStoreDefinitionStages.WithExecute withUrl(String url); + } + + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + interface WithAllOptions { /** * Optional. Specifies the name of application using the endpoint. * * @return next definition stage */ - PredictionsPredictImageDefinitionStages.WithExecute withApplication(String application); + PredictionsClassifyImageUrlWithNoStoreDefinitionStages.WithExecute withApplication(String application); } /** * The last stage of the definition which will make the operation call. */ - interface WithExecute extends PredictionsPredictImageDefinitionStages.WithAllOptions { + interface WithExecute extends PredictionsClassifyImageUrlWithNoStoreDefinitionStages.WithAllOptions { /** * Execute the request. * @@ -337,49 +702,52 @@ interface WithExecute extends PredictionsPredictImageDefinitionStages.WithAllOpt } /** - * The entirety of predictImage definition. + * The entirety of classifyImageUrlWithNoStore definition. */ - interface PredictionsPredictImageDefinition extends - PredictionsPredictImageDefinitionStages.WithProjectId, - PredictionsPredictImageDefinitionStages.WithImageData, - PredictionsPredictImageDefinitionStages.WithExecute { + interface PredictionsClassifyImageUrlWithNoStoreDefinition extends + PredictionsClassifyImageUrlWithNoStoreDefinitionStages.WithProjectId, + PredictionsClassifyImageUrlWithNoStoreDefinitionStages.WithPublishedName, + PredictionsClassifyImageUrlWithNoStoreDefinitionStages.WithUrl, + PredictionsClassifyImageUrlWithNoStoreDefinitionStages.WithExecute { } /** - * Predict an image url and saves the result. + * Classify an image and saves the result. * * @param projectId The project id. - * @param predictImageUrlOptionalParameter the object representing the optional parameters to be set before calling this API + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 4MB. + * @param classifyImageOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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. */ - @Deprecated - ImagePrediction predictImageUrl(UUID projectId, PredictImageUrlOptionalParameter predictImageUrlOptionalParameter); + ImagePrediction classifyImage(UUID projectId, String publishedName, byte[] imageData, ClassifyImageOptionalParameter classifyImageOptionalParameter); /** - * Predict an image url and saves the result. + * Classify an image and saves the result. * * @param projectId The project id. - * @param predictImageUrlOptionalParameter the object representing the optional parameters to be set before calling this API + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 4MB. + * @param classifyImageOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ImagePrediction object */ - @Deprecated - Observable predictImageUrlAsync(UUID projectId, PredictImageUrlOptionalParameter predictImageUrlOptionalParameter); + Observable classifyImageAsync(UUID projectId, String publishedName, byte[] imageData, ClassifyImageOptionalParameter classifyImageOptionalParameter); /** - * Predict an image url and saves the result. + * Classify an image and saves the result. * - * @return the first stage of the predictImageUrl call + * @return the first stage of the classifyImage call */ - PredictionsPredictImageUrlDefinitionStages.WithProjectId predictImageUrl(); + PredictionsClassifyImageDefinitionStages.WithProjectId classifyImage(); /** - * Grouping of predictImageUrl definition stages. + * Grouping of classifyImage definition stages. */ - interface PredictionsPredictImageUrlDefinitionStages { + interface PredictionsClassifyImageDefinitionStages { /** * The stage of the definition to be specify projectId. */ @@ -389,7 +757,29 @@ interface WithProjectId { * * @return next definition stage */ - PredictionsPredictImageUrlDefinitionStages.WithExecute withProjectId(UUID projectId); + WithPublishedName withProjectId(UUID projectId); + } + /** + * The stage of the definition to be specify publishedName. + */ + interface WithPublishedName { + /** + * Specifies the name of the model to evaluate against. + * + * @return next definition stage + */ + WithImageData withPublishedName(String publishedName); + } + /** + * The stage of the definition to be specify imageData. + */ + interface WithImageData { + /** + * Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 4MB. + * + * @return next definition stage + */ + PredictionsClassifyImageDefinitionStages.WithExecute withImageData(byte[] imageData); } /** @@ -397,33 +787,132 @@ interface WithProjectId { */ interface WithAllOptions { /** - * Optional. Specifies the id of a particular iteration to evaluate against. - * The default iteration for the project will be used when not specified. + * Optional. Specifies the name of application using the endpoint. * * @return next definition stage */ - PredictionsPredictImageUrlDefinitionStages.WithExecute withIterationId(UUID iterationId); + PredictionsClassifyImageDefinitionStages.WithExecute withApplication(String application); + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends PredictionsClassifyImageDefinitionStages.WithAllOptions { /** - * Optional. Specifies the name of application using the endpoint. + * Execute the request. * - * @return next definition stage + * @return the ImagePrediction object if successful. */ - PredictionsPredictImageUrlDefinitionStages.WithExecute withApplication(String application); + ImagePrediction execute(); /** + * Execute the request asynchronously. * + * @return the observable to the ImagePrediction object + */ + Observable executeAsync(); + } + } + + /** + * The entirety of classifyImage definition. + */ + interface PredictionsClassifyImageDefinition extends + PredictionsClassifyImageDefinitionStages.WithProjectId, + PredictionsClassifyImageDefinitionStages.WithPublishedName, + PredictionsClassifyImageDefinitionStages.WithImageData, + PredictionsClassifyImageDefinitionStages.WithExecute { + } + + /** + * Classify an image url and saves the result. + * + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param url Url of the image. + * @param classifyImageUrlOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 publishedName, String url, ClassifyImageUrlOptionalParameter classifyImageUrlOptionalParameter); + + /** + * Classify an image url and saves the result. + * + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param url Url of the image. + * @param classifyImageUrlOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + Observable classifyImageUrlAsync(UUID projectId, String publishedName, String url, ClassifyImageUrlOptionalParameter classifyImageUrlOptionalParameter); + + /** + * Classify an image url and saves the result. + * + * @return the first stage of the classifyImageUrl call + */ + PredictionsClassifyImageUrlDefinitionStages.WithProjectId classifyImageUrl(); + + /** + * Grouping of classifyImageUrl definition stages. + */ + interface PredictionsClassifyImageUrlDefinitionStages { + /** + * The stage of the definition to be specify projectId. + */ + interface WithProjectId { + /** + * The project id. + * + * @return next definition stage + */ + WithPublishedName withProjectId(UUID projectId); + } + /** + * The stage of the definition to be specify publishedName. + */ + interface WithPublishedName { + /** + * Specifies the name of the model to evaluate against. + * + * @return next definition stage + */ + WithUrl withPublishedName(String publishedName); + } + /** + * The stage of the definition to be specify url. + */ + interface WithUrl { + /** + * Url of the image. + * + * @return next definition stage + */ + PredictionsClassifyImageUrlDefinitionStages.WithExecute withUrl(String url); + } + + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + interface WithAllOptions { + /** + * Optional. Specifies the name of application using the endpoint. * * @return next definition stage */ - PredictionsPredictImageUrlDefinitionStages.WithExecute withUrl(String url); + PredictionsClassifyImageUrlDefinitionStages.WithExecute withApplication(String application); } /** * The last stage of the definition which will make the operation call. */ - interface WithExecute extends PredictionsPredictImageUrlDefinitionStages.WithAllOptions { + interface WithExecute extends PredictionsClassifyImageUrlDefinitionStages.WithAllOptions { /** * Execute the request. * @@ -441,11 +930,13 @@ interface WithExecute extends PredictionsPredictImageUrlDefinitionStages.WithAll } /** - * The entirety of predictImageUrl definition. + * The entirety of classifyImageUrl definition. */ - interface PredictionsPredictImageUrlDefinition extends - PredictionsPredictImageUrlDefinitionStages.WithProjectId, - PredictionsPredictImageUrlDefinitionStages.WithExecute { + interface PredictionsClassifyImageUrlDefinition extends + PredictionsClassifyImageUrlDefinitionStages.WithProjectId, + PredictionsClassifyImageUrlDefinitionStages.WithPublishedName, + PredictionsClassifyImageUrlDefinitionStages.WithUrl, + PredictionsClassifyImageUrlDefinitionStages.WithExecute { } } diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/PredictionEndpointImpl.java b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/CustomVisionPredictionClientImpl.java similarity index 72% rename from sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/PredictionEndpointImpl.java rename to sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/CustomVisionPredictionClientImpl.java index bef91917e5e5..02d866db49cc 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/PredictionEndpointImpl.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/CustomVisionPredictionClientImpl.java @@ -10,15 +10,15 @@ import com.microsoft.azure.AzureClient; import com.microsoft.azure.AzureServiceClient; -import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.PredictionEndpoint; +import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.CustomVisionPredictionClient; import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.Predictions; import com.microsoft.rest.credentials.ServiceClientCredentials; import com.microsoft.rest.RestClient; /** - * Initializes a new instance of the PredictionEndpointImpl class. + * Initializes a new instance of the CustomVisionPredictionClientImpl class. */ -public class PredictionEndpointImpl extends AzureServiceClient implements PredictionEndpoint { +public class CustomVisionPredictionClientImpl extends AzureServiceClient implements CustomVisionPredictionClient { /** the {@link AzureClient} used for long running operations. */ private AzureClient azureClient; @@ -30,11 +30,11 @@ public AzureClient getAzureClient() { return this.azureClient; } - /** The API key. */ + /** API key. */ private String apiKey; /** - * Gets the API key. + * Gets API key. * * @return the apiKey value. */ @@ -43,16 +43,39 @@ public String apiKey() { } /** - * Sets the API key. + * Sets API key. * * @param apiKey the apiKey value. * @return the service client itself */ - public PredictionEndpointImpl withApiKey(String apiKey) { + 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; + } + /** Gets or sets the preferred language for the response. */ private String acceptLanguage; @@ -71,7 +94,7 @@ public String acceptLanguage() { * @param acceptLanguage the acceptLanguage value. * @return the service client itself */ - public PredictionEndpointImpl withAcceptLanguage(String acceptLanguage) { + public CustomVisionPredictionClientImpl withAcceptLanguage(String acceptLanguage) { this.acceptLanguage = acceptLanguage; return this; } @@ -94,7 +117,7 @@ public int longRunningOperationRetryTimeout() { * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. * @return the service client itself */ - public PredictionEndpointImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + public CustomVisionPredictionClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; return this; } @@ -117,7 +140,7 @@ public boolean generateClientRequestId() { * @param generateClientRequestId the generateClientRequestId value. * @return the service client itself */ - public PredictionEndpointImpl withGenerateClientRequestId(boolean generateClientRequestId) { + public CustomVisionPredictionClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { this.generateClientRequestId = generateClientRequestId; return this; } @@ -136,31 +159,31 @@ public Predictions predictions() { } /** - * Initializes an instance of PredictionEndpoint client. + * Initializes an instance of CustomVisionPredictionClient client. * * @param credentials the management credentials for Azure */ - public PredictionEndpointImpl(ServiceClientCredentials credentials) { - this("https://southcentralus.api.cognitive.microsoft.com/customvision/v2.0/Prediction", credentials); + public CustomVisionPredictionClientImpl(ServiceClientCredentials credentials) { + this("https://{Endpoint}/customvision/v3.0/prediction", credentials); } /** - * Initializes an instance of PredictionEndpoint client. + * Initializes an instance of CustomVisionPredictionClient client. * * @param baseUrl the base URL of the host * @param credentials the management credentials for Azure */ - public PredictionEndpointImpl(String baseUrl, ServiceClientCredentials credentials) { + public CustomVisionPredictionClientImpl(String baseUrl, ServiceClientCredentials credentials) { super(baseUrl, credentials); initialize(); } /** - * Initializes an instance of PredictionEndpoint client. + * Initializes an instance of CustomVisionPredictionClient client. * * @param restClient the REST client to connect to Azure. */ - public PredictionEndpointImpl(RestClient restClient) { + public CustomVisionPredictionClientImpl(RestClient restClient) { super(restClient); initialize(); } @@ -180,6 +203,6 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "PredictionEndpoint", "2.0"); + return String.format("%s (%s, %s)", super.userAgent(), "CustomVisionPredictionClient", "3.0"); } } diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/PredictionsImpl.java b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/PredictionsImpl.java index cd0b38cef52e..8dd87314aa76 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/PredictionsImpl.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/PredictionsImpl.java @@ -8,21 +8,27 @@ package com.microsoft.azure.cognitiveservices.vision.customvision.prediction.implementation; -import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.PredictImageWithNoStoreOptionalParameter; -import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.PredictImageUrlWithNoStoreOptionalParameter; -import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.PredictImageOptionalParameter; -import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.PredictImageUrlOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.DetectImageWithNoStoreOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.DetectImageUrlWithNoStoreOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.DetectImageOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.DetectImageUrlOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.ClassifyImageWithNoStoreOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.ClassifyImageUrlWithNoStoreOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.ClassifyImageOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models.ClassifyImageUrlOptionalParameter; import okhttp3.MediaType; import okhttp3.RequestBody; import retrofit2.Retrofit; import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.Predictions; +import com.google.common.base.Joiner; import com.google.common.reflect.TypeToken; -import com.microsoft.azure.CloudException; +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.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; @@ -46,7 +52,7 @@ public class PredictionsImpl implements Predictions { /** The Retrofit service to perform REST calls. */ private PredictionsService service; /** The service client containing this operation class. */ - private PredictionEndpointImpl client; + private CustomVisionPredictionClientImpl client; /** * Initializes an instance of PredictionsImpl. @@ -54,7 +60,7 @@ public class PredictionsImpl implements Predictions { * @param retrofit the Retrofit instance built from a Retrofit Builder. * @param client the instance of the service client containing this operation class. */ - public PredictionsImpl(Retrofit retrofit, PredictionEndpointImpl client) { + public PredictionsImpl(Retrofit retrofit, CustomVisionPredictionClientImpl client) { this.service = retrofit.create(PredictionsService.class); this.client = client; } @@ -65,64 +71,83 @@ public PredictionsImpl(Retrofit retrofit, PredictionEndpointImpl client) { */ interface PredictionsService { @Multipart - @POST("{projectId}/image/nostore") - Observable> predictImageWithNoStore(@Path("projectId") UUID projectId, @Query("iterationId") UUID iterationId, @Query("application") String application, @Part("imageData") RequestBody imageData, @Header("Prediction-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @POST("{projectId}/detect/iterations/{publishedName}/image/nostore") + Observable> detectImageWithNoStore(@Path("projectId") UUID projectId, @Path("publishedName") String publishedName, @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.Predictions predictImageUrlWithNoStore" }) - @POST("{projectId}/url/nostore") - Observable> predictImageUrlWithNoStore(@Path("projectId") UUID projectId, @Query("iterationId") UUID iterationId, @Query("application") String application, @Header("Prediction-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Body ImageUrl imageUrl, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.prediction.Predictions detectImageUrlWithNoStore" }) + @POST("{projectId}/detect/iterations/{publishedName}/url/nostore") + Observable> detectImageUrlWithNoStore(@Path("projectId") UUID projectId, @Path("publishedName") String publishedName, @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}/image") - Observable> predictImage(@Path("projectId") UUID projectId, @Query("iterationId") UUID iterationId, @Query("application") String application, @Part("imageData") RequestBody imageData, @Header("Prediction-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @POST("{projectId}/detect/iterations/{publishedName}/image") + Observable> detectImage(@Path("projectId") UUID projectId, @Path("publishedName") String publishedName, @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.Predictions predictImageUrl" }) - @POST("{projectId}/url") - Observable> predictImageUrl(@Path("projectId") UUID projectId, @Query("iterationId") UUID iterationId, @Query("application") String application, @Header("Prediction-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Body ImageUrl imageUrl, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.prediction.Predictions detectImageUrl" }) + @POST("{projectId}/detect/iterations/{publishedName}/url") + Observable> detectImageUrl(@Path("projectId") UUID projectId, @Path("publishedName") String publishedName, @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/iterations/{publishedName}/image/nostore") + Observable> classifyImageWithNoStore(@Path("projectId") UUID projectId, @Path("publishedName") String publishedName, @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.Predictions classifyImageUrlWithNoStore" }) + @POST("{projectId}/classify/iterations/{publishedName}/url/nostore") + Observable> classifyImageUrlWithNoStore(@Path("projectId") UUID projectId, @Path("publishedName") String publishedName, @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/iterations/{publishedName}/image") + Observable> classifyImage(@Path("projectId") UUID projectId, @Path("publishedName") String publishedName, @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.Predictions classifyImageUrl" }) + @POST("{projectId}/classify/iterations/{publishedName}/url") + Observable> classifyImageUrl(@Path("projectId") UUID projectId, @Path("publishedName") String publishedName, @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); } /** - * Predict an image without saving the result. + * Detect objects in an image without saving the result. * - * @param projectId The project id - * @param imageData the InputStream value - * @param predictImageWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 0MB. + * @param detectImageWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 predictImageWithNoStore(UUID projectId, byte[] imageData, PredictImageWithNoStoreOptionalParameter predictImageWithNoStoreOptionalParameter) { - return predictImageWithNoStoreWithServiceResponseAsync(projectId, imageData, predictImageWithNoStoreOptionalParameter).toBlocking().single().body(); + public ImagePrediction detectImageWithNoStore(UUID projectId, String publishedName, byte[] imageData, DetectImageWithNoStoreOptionalParameter detectImageWithNoStoreOptionalParameter) { + return detectImageWithNoStoreWithServiceResponseAsync(projectId, publishedName, imageData, detectImageWithNoStoreOptionalParameter).toBlocking().single().body(); } /** - * Predict an image without saving the result. + * Detect objects in an image without saving the result. * - * @param projectId The project id - * @param imageData the InputStream value - * @param predictImageWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 0MB. + * @param detectImageWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API * @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 predictImageWithNoStoreAsync(UUID projectId, byte[] imageData, PredictImageWithNoStoreOptionalParameter predictImageWithNoStoreOptionalParameter, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(predictImageWithNoStoreWithServiceResponseAsync(projectId, imageData, predictImageWithNoStoreOptionalParameter), serviceCallback); + public ServiceFuture detectImageWithNoStoreAsync(UUID projectId, String publishedName, byte[] imageData, DetectImageWithNoStoreOptionalParameter detectImageWithNoStoreOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(detectImageWithNoStoreWithServiceResponseAsync(projectId, publishedName, imageData, detectImageWithNoStoreOptionalParameter), serviceCallback); } /** - * Predict an image without saving the result. + * Detect objects in an image without saving the result. * - * @param projectId The project id - * @param imageData the InputStream value - * @param predictImageWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 0MB. + * @param detectImageWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ImagePrediction object */ - public Observable predictImageWithNoStoreAsync(UUID projectId, byte[] imageData, PredictImageWithNoStoreOptionalParameter predictImageWithNoStoreOptionalParameter) { - return predictImageWithNoStoreWithServiceResponseAsync(projectId, imageData, predictImageWithNoStoreOptionalParameter).map(new Func1, ImagePrediction>() { + public Observable detectImageWithNoStoreAsync(UUID projectId, String publishedName, byte[] imageData, DetectImageWithNoStoreOptionalParameter detectImageWithNoStoreOptionalParameter) { + return detectImageWithNoStoreWithServiceResponseAsync(projectId, publishedName, imageData, detectImageWithNoStoreOptionalParameter).map(new Func1, ImagePrediction>() { @Override public ImagePrediction call(ServiceResponse response) { return response.body(); @@ -131,58 +156,70 @@ public ImagePrediction call(ServiceResponse response) { } /** - * Predict an image without saving the result. + * Detect objects in an image without saving the result. * - * @param projectId The project id - * @param imageData the InputStream value - * @param predictImageWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 0MB. + * @param detectImageWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ImagePrediction object */ - public Observable> predictImageWithNoStoreWithServiceResponseAsync(UUID projectId, byte[] imageData, PredictImageWithNoStoreOptionalParameter predictImageWithNoStoreOptionalParameter) { + public Observable> detectImageWithNoStoreWithServiceResponseAsync(UUID projectId, String publishedName, byte[] imageData, DetectImageWithNoStoreOptionalParameter detectImageWithNoStoreOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } + if (publishedName == null) { + throw new IllegalArgumentException("Parameter publishedName is required and cannot be null."); + } if (imageData == null) { throw new IllegalArgumentException("Parameter imageData is required and cannot be null."); } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - final UUID iterationId = predictImageWithNoStoreOptionalParameter != null ? predictImageWithNoStoreOptionalParameter.iterationId() : null; - final String application = predictImageWithNoStoreOptionalParameter != null ? predictImageWithNoStoreOptionalParameter.application() : null; + final String application = detectImageWithNoStoreOptionalParameter != null ? detectImageWithNoStoreOptionalParameter.application() : null; - return predictImageWithNoStoreWithServiceResponseAsync(projectId, imageData, iterationId, application); + return detectImageWithNoStoreWithServiceResponseAsync(projectId, publishedName, imageData, application); } /** - * Predict an image without saving the result. + * Detect objects in an image without saving the result. * - * @param projectId The project id - * @param imageData the InputStream value - * @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 application Optional. Specifies the name of application using the endpoint + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 0MB. + * @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> predictImageWithNoStoreWithServiceResponseAsync(UUID projectId, byte[] imageData, UUID iterationId, String application) { + public Observable> detectImageWithNoStoreWithServiceResponseAsync(UUID projectId, String publishedName, byte[] imageData, String application) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } + if (publishedName == null) { + throw new IllegalArgumentException("Parameter publishedName is required and cannot be null."); + } if (imageData == null) { throw new IllegalArgumentException("Parameter imageData is required and cannot be null."); } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); RequestBody imageDataConverted = RequestBody.create(MediaType.parse("multipart/form-data"), imageData); - return service.predictImageWithNoStore(projectId, iterationId, application, imageDataConverted, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) + return service.detectImageWithNoStore(projectId, publishedName, application, imageDataConverted, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = predictImageWithNoStoreDelegate(response); + ServiceResponse clientResponse = detectImageWithNoStoreDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -191,68 +228,68 @@ public Observable> call(Response }); } - private ServiceResponse predictImageWithNoStoreDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse detectImageWithNoStoreDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(CustomVisionErrorException.class) .build(response); } @Override - public PredictionsPredictImageWithNoStoreParameters predictImageWithNoStore() { - return new PredictionsPredictImageWithNoStoreParameters(this); + public PredictionsDetectImageWithNoStoreParameters detectImageWithNoStore() { + return new PredictionsDetectImageWithNoStoreParameters(this); } /** - * Internal class implementing PredictionsPredictImageWithNoStoreDefinition. + * Internal class implementing PredictionsDetectImageWithNoStoreDefinition. */ - class PredictionsPredictImageWithNoStoreParameters implements PredictionsPredictImageWithNoStoreDefinition { + class PredictionsDetectImageWithNoStoreParameters implements PredictionsDetectImageWithNoStoreDefinition { private PredictionsImpl parent; private UUID projectId; + private String publishedName; private byte[] imageData; - private UUID iterationId; private String application; /** * Constructor. * @param parent the parent object. */ - PredictionsPredictImageWithNoStoreParameters(PredictionsImpl parent) { + PredictionsDetectImageWithNoStoreParameters(PredictionsImpl parent) { this.parent = parent; } @Override - public PredictionsPredictImageWithNoStoreParameters withProjectId(UUID projectId) { + public PredictionsDetectImageWithNoStoreParameters withProjectId(UUID projectId) { this.projectId = projectId; return this; } @Override - public PredictionsPredictImageWithNoStoreParameters withImageData(byte[] imageData) { - this.imageData = imageData; + public PredictionsDetectImageWithNoStoreParameters withPublishedName(String publishedName) { + this.publishedName = publishedName; return this; } @Override - public PredictionsPredictImageWithNoStoreParameters withIterationId(UUID iterationId) { - this.iterationId = iterationId; + public PredictionsDetectImageWithNoStoreParameters withImageData(byte[] imageData) { + this.imageData = imageData; return this; } @Override - public PredictionsPredictImageWithNoStoreParameters withApplication(String application) { + public PredictionsDetectImageWithNoStoreParameters withApplication(String application) { this.application = application; return this; } @Override public ImagePrediction execute() { - return predictImageWithNoStoreWithServiceResponseAsync(projectId, imageData, iterationId, application).toBlocking().single().body(); + return detectImageWithNoStoreWithServiceResponseAsync(projectId, publishedName, imageData, application).toBlocking().single().body(); } @Override public Observable executeAsync() { - return predictImageWithNoStoreWithServiceResponseAsync(projectId, imageData, iterationId, application).map(new Func1, ImagePrediction>() { + return detectImageWithNoStoreWithServiceResponseAsync(projectId, publishedName, imageData, application).map(new Func1, ImagePrediction>() { @Override public ImagePrediction call(ServiceResponse response) { return response.body(); @@ -263,42 +300,48 @@ public ImagePrediction call(ServiceResponse response) { /** - * Predict an image url without saving the result. + * Detect objects in an image url without saving the result. * - * @param projectId The project id - * @param predictImageUrlWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param url Url of the image. + * @param detectImageUrlWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 predictImageUrlWithNoStore(UUID projectId, PredictImageUrlWithNoStoreOptionalParameter predictImageUrlWithNoStoreOptionalParameter) { - return predictImageUrlWithNoStoreWithServiceResponseAsync(projectId, predictImageUrlWithNoStoreOptionalParameter).toBlocking().single().body(); + public ImagePrediction detectImageUrlWithNoStore(UUID projectId, String publishedName, String url, DetectImageUrlWithNoStoreOptionalParameter detectImageUrlWithNoStoreOptionalParameter) { + return detectImageUrlWithNoStoreWithServiceResponseAsync(projectId, publishedName, url, detectImageUrlWithNoStoreOptionalParameter).toBlocking().single().body(); } /** - * Predict an image url without saving the result. + * Detect objects in an image url without saving the result. * - * @param projectId The project id - * @param predictImageUrlWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param url Url of the image. + * @param detectImageUrlWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API * @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 predictImageUrlWithNoStoreAsync(UUID projectId, PredictImageUrlWithNoStoreOptionalParameter predictImageUrlWithNoStoreOptionalParameter, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(predictImageUrlWithNoStoreWithServiceResponseAsync(projectId, predictImageUrlWithNoStoreOptionalParameter), serviceCallback); + public ServiceFuture detectImageUrlWithNoStoreAsync(UUID projectId, String publishedName, String url, DetectImageUrlWithNoStoreOptionalParameter detectImageUrlWithNoStoreOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(detectImageUrlWithNoStoreWithServiceResponseAsync(projectId, publishedName, url, detectImageUrlWithNoStoreOptionalParameter), serviceCallback); } /** - * Predict an image url without saving the result. + * Detect objects in an image url without saving the result. * - * @param projectId The project id - * @param predictImageUrlWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param url Url of the image. + * @param detectImageUrlWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ImagePrediction object */ - public Observable predictImageUrlWithNoStoreAsync(UUID projectId, PredictImageUrlWithNoStoreOptionalParameter predictImageUrlWithNoStoreOptionalParameter) { - return predictImageUrlWithNoStoreWithServiceResponseAsync(projectId, predictImageUrlWithNoStoreOptionalParameter).map(new Func1, ImagePrediction>() { + public Observable detectImageUrlWithNoStoreAsync(UUID projectId, String publishedName, String url, DetectImageUrlWithNoStoreOptionalParameter detectImageUrlWithNoStoreOptionalParameter) { + return detectImageUrlWithNoStoreWithServiceResponseAsync(projectId, publishedName, url, detectImageUrlWithNoStoreOptionalParameter).map(new Func1, ImagePrediction>() { @Override public ImagePrediction call(ServiceResponse response) { return response.body(); @@ -307,53 +350,71 @@ public ImagePrediction call(ServiceResponse response) { } /** - * Predict an image url without saving the result. + * Detect objects in an image url without saving the result. * - * @param projectId The project id - * @param predictImageUrlWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param url Url of the image. + * @param detectImageUrlWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ImagePrediction object */ - public Observable> predictImageUrlWithNoStoreWithServiceResponseAsync(UUID projectId, PredictImageUrlWithNoStoreOptionalParameter predictImageUrlWithNoStoreOptionalParameter) { + public Observable> detectImageUrlWithNoStoreWithServiceResponseAsync(UUID projectId, String publishedName, String url, DetectImageUrlWithNoStoreOptionalParameter detectImageUrlWithNoStoreOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } + if (publishedName == null) { + throw new IllegalArgumentException("Parameter publishedName is required and cannot be null."); + } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - final UUID iterationId = predictImageUrlWithNoStoreOptionalParameter != null ? predictImageUrlWithNoStoreOptionalParameter.iterationId() : null; - final String application = predictImageUrlWithNoStoreOptionalParameter != null ? predictImageUrlWithNoStoreOptionalParameter.application() : null; - final String url = predictImageUrlWithNoStoreOptionalParameter != null ? predictImageUrlWithNoStoreOptionalParameter.url() : null; + if (url == null) { + throw new IllegalArgumentException("Parameter url is required and cannot be null."); + } + final String application = detectImageUrlWithNoStoreOptionalParameter != null ? detectImageUrlWithNoStoreOptionalParameter.application() : null; - return predictImageUrlWithNoStoreWithServiceResponseAsync(projectId, iterationId, application, url); + return detectImageUrlWithNoStoreWithServiceResponseAsync(projectId, publishedName, url, application); } /** - * Predict an image url without saving the result. + * Detect objects in an image url without saving the result. * - * @param projectId The project id - * @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 application Optional. Specifies the name of application using the endpoint - * @param url the String value + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param url Url of the image. + * @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> predictImageUrlWithNoStoreWithServiceResponseAsync(UUID projectId, UUID iterationId, String application, String url) { + public Observable> detectImageUrlWithNoStoreWithServiceResponseAsync(UUID projectId, String publishedName, String url, String application) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } + if (publishedName == null) { + throw new IllegalArgumentException("Parameter publishedName is required and cannot be null."); + } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } + if (url == null) { + throw new IllegalArgumentException("Parameter url is required and cannot be null."); + } ImageUrl imageUrl = new ImageUrl(); imageUrl.withUrl(url); - return service.predictImageUrlWithNoStore(projectId, iterationId, application, this.client.apiKey(), this.client.acceptLanguage(), imageUrl, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.detectImageUrlWithNoStore(projectId, publishedName, application, this.client.apiKey(), this.client.acceptLanguage(), imageUrl, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = predictImageUrlWithNoStoreDelegate(response); + ServiceResponse clientResponse = detectImageUrlWithNoStoreDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -362,68 +423,68 @@ public Observable> call(Response }); } - private ServiceResponse predictImageUrlWithNoStoreDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse detectImageUrlWithNoStoreDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(CustomVisionErrorException.class) .build(response); } @Override - public PredictionsPredictImageUrlWithNoStoreParameters predictImageUrlWithNoStore() { - return new PredictionsPredictImageUrlWithNoStoreParameters(this); + public PredictionsDetectImageUrlWithNoStoreParameters detectImageUrlWithNoStore() { + return new PredictionsDetectImageUrlWithNoStoreParameters(this); } /** - * Internal class implementing PredictionsPredictImageUrlWithNoStoreDefinition. + * Internal class implementing PredictionsDetectImageUrlWithNoStoreDefinition. */ - class PredictionsPredictImageUrlWithNoStoreParameters implements PredictionsPredictImageUrlWithNoStoreDefinition { + class PredictionsDetectImageUrlWithNoStoreParameters implements PredictionsDetectImageUrlWithNoStoreDefinition { private PredictionsImpl parent; private UUID projectId; - private UUID iterationId; - private String application; + private String publishedName; private String url; + private String application; /** * Constructor. * @param parent the parent object. */ - PredictionsPredictImageUrlWithNoStoreParameters(PredictionsImpl parent) { + PredictionsDetectImageUrlWithNoStoreParameters(PredictionsImpl parent) { this.parent = parent; } @Override - public PredictionsPredictImageUrlWithNoStoreParameters withProjectId(UUID projectId) { + public PredictionsDetectImageUrlWithNoStoreParameters withProjectId(UUID projectId) { this.projectId = projectId; return this; } @Override - public PredictionsPredictImageUrlWithNoStoreParameters withIterationId(UUID iterationId) { - this.iterationId = iterationId; + public PredictionsDetectImageUrlWithNoStoreParameters withPublishedName(String publishedName) { + this.publishedName = publishedName; return this; } @Override - public PredictionsPredictImageUrlWithNoStoreParameters withApplication(String application) { - this.application = application; + public PredictionsDetectImageUrlWithNoStoreParameters withUrl(String url) { + this.url = url; return this; } @Override - public PredictionsPredictImageUrlWithNoStoreParameters withUrl(String url) { - this.url = url; + public PredictionsDetectImageUrlWithNoStoreParameters withApplication(String application) { + this.application = application; return this; } @Override public ImagePrediction execute() { - return predictImageUrlWithNoStoreWithServiceResponseAsync(projectId, iterationId, application, url).toBlocking().single().body(); + return detectImageUrlWithNoStoreWithServiceResponseAsync(projectId, publishedName, url, application).toBlocking().single().body(); } @Override public Observable executeAsync() { - return predictImageUrlWithNoStoreWithServiceResponseAsync(projectId, iterationId, application, url).map(new Func1, ImagePrediction>() { + return detectImageUrlWithNoStoreWithServiceResponseAsync(projectId, publishedName, url, application).map(new Func1, ImagePrediction>() { @Override public ImagePrediction call(ServiceResponse response) { return response.body(); @@ -434,45 +495,48 @@ public ImagePrediction call(ServiceResponse response) { /** - * Predict an image and saves the result. + * Detect objects in an image and saves the result. * - * @param projectId The project id - * @param imageData the InputStream value - * @param predictImageOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 4MB. + * @param detectImageOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 predictImage(UUID projectId, byte[] imageData, PredictImageOptionalParameter predictImageOptionalParameter) { - return predictImageWithServiceResponseAsync(projectId, imageData, predictImageOptionalParameter).toBlocking().single().body(); + public ImagePrediction detectImage(UUID projectId, String publishedName, byte[] imageData, DetectImageOptionalParameter detectImageOptionalParameter) { + return detectImageWithServiceResponseAsync(projectId, publishedName, imageData, detectImageOptionalParameter).toBlocking().single().body(); } /** - * Predict an image and saves the result. + * Detect objects in an image and saves the result. * - * @param projectId The project id - * @param imageData the InputStream value - * @param predictImageOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 4MB. + * @param detectImageOptionalParameter the object representing the optional parameters to be set before calling this API * @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 predictImageAsync(UUID projectId, byte[] imageData, PredictImageOptionalParameter predictImageOptionalParameter, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(predictImageWithServiceResponseAsync(projectId, imageData, predictImageOptionalParameter), serviceCallback); + public ServiceFuture detectImageAsync(UUID projectId, String publishedName, byte[] imageData, DetectImageOptionalParameter detectImageOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(detectImageWithServiceResponseAsync(projectId, publishedName, imageData, detectImageOptionalParameter), serviceCallback); } /** - * Predict an image and saves the result. + * Detect objects in an image and saves the result. * - * @param projectId The project id - * @param imageData the InputStream value - * @param predictImageOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 4MB. + * @param detectImageOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ImagePrediction object */ - public Observable predictImageAsync(UUID projectId, byte[] imageData, PredictImageOptionalParameter predictImageOptionalParameter) { - return predictImageWithServiceResponseAsync(projectId, imageData, predictImageOptionalParameter).map(new Func1, ImagePrediction>() { + public Observable detectImageAsync(UUID projectId, String publishedName, byte[] imageData, DetectImageOptionalParameter detectImageOptionalParameter) { + return detectImageWithServiceResponseAsync(projectId, publishedName, imageData, detectImageOptionalParameter).map(new Func1, ImagePrediction>() { @Override public ImagePrediction call(ServiceResponse response) { return response.body(); @@ -481,58 +545,70 @@ public ImagePrediction call(ServiceResponse response) { } /** - * Predict an image and saves the result. + * Detect objects in an image and saves the result. * - * @param projectId The project id - * @param imageData the InputStream value - * @param predictImageOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 4MB. + * @param detectImageOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ImagePrediction object */ - public Observable> predictImageWithServiceResponseAsync(UUID projectId, byte[] imageData, PredictImageOptionalParameter predictImageOptionalParameter) { + public Observable> detectImageWithServiceResponseAsync(UUID projectId, String publishedName, byte[] imageData, DetectImageOptionalParameter detectImageOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } + if (publishedName == null) { + throw new IllegalArgumentException("Parameter publishedName is required and cannot be null."); + } if (imageData == null) { throw new IllegalArgumentException("Parameter imageData is required and cannot be null."); } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - final UUID iterationId = predictImageOptionalParameter != null ? predictImageOptionalParameter.iterationId() : null; - final String application = predictImageOptionalParameter != null ? predictImageOptionalParameter.application() : null; + final String application = detectImageOptionalParameter != null ? detectImageOptionalParameter.application() : null; - return predictImageWithServiceResponseAsync(projectId, imageData, iterationId, application); + return detectImageWithServiceResponseAsync(projectId, publishedName, imageData, application); } /** - * Predict an image and saves the result. + * Detect objects in an image and saves the result. * - * @param projectId The project id - * @param imageData the InputStream value - * @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 application Optional. Specifies the name of application using the endpoint + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 4MB. + * @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> predictImageWithServiceResponseAsync(UUID projectId, byte[] imageData, UUID iterationId, String application) { + public Observable> detectImageWithServiceResponseAsync(UUID projectId, String publishedName, byte[] imageData, String application) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } + if (publishedName == null) { + throw new IllegalArgumentException("Parameter publishedName is required and cannot be null."); + } if (imageData == null) { throw new IllegalArgumentException("Parameter imageData is required and cannot be null."); } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); RequestBody imageDataConverted = RequestBody.create(MediaType.parse("multipart/form-data"), imageData); - return service.predictImage(projectId, iterationId, application, imageDataConverted, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) + return service.detectImage(projectId, publishedName, application, imageDataConverted, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = predictImageDelegate(response); + ServiceResponse clientResponse = detectImageDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -541,68 +617,68 @@ public Observable> call(Response }); } - private ServiceResponse predictImageDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse detectImageDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(CustomVisionErrorException.class) .build(response); } @Override - public PredictionsPredictImageParameters predictImage() { - return new PredictionsPredictImageParameters(this); + public PredictionsDetectImageParameters detectImage() { + return new PredictionsDetectImageParameters(this); } /** - * Internal class implementing PredictionsPredictImageDefinition. + * Internal class implementing PredictionsDetectImageDefinition. */ - class PredictionsPredictImageParameters implements PredictionsPredictImageDefinition { + class PredictionsDetectImageParameters implements PredictionsDetectImageDefinition { private PredictionsImpl parent; private UUID projectId; + private String publishedName; private byte[] imageData; - private UUID iterationId; private String application; /** * Constructor. * @param parent the parent object. */ - PredictionsPredictImageParameters(PredictionsImpl parent) { + PredictionsDetectImageParameters(PredictionsImpl parent) { this.parent = parent; } @Override - public PredictionsPredictImageParameters withProjectId(UUID projectId) { + public PredictionsDetectImageParameters withProjectId(UUID projectId) { this.projectId = projectId; return this; } @Override - public PredictionsPredictImageParameters withImageData(byte[] imageData) { - this.imageData = imageData; + public PredictionsDetectImageParameters withPublishedName(String publishedName) { + this.publishedName = publishedName; return this; } @Override - public PredictionsPredictImageParameters withIterationId(UUID iterationId) { - this.iterationId = iterationId; + public PredictionsDetectImageParameters withImageData(byte[] imageData) { + this.imageData = imageData; return this; } @Override - public PredictionsPredictImageParameters withApplication(String application) { + public PredictionsDetectImageParameters withApplication(String application) { this.application = application; return this; } @Override public ImagePrediction execute() { - return predictImageWithServiceResponseAsync(projectId, imageData, iterationId, application).toBlocking().single().body(); + return detectImageWithServiceResponseAsync(projectId, publishedName, imageData, application).toBlocking().single().body(); } @Override public Observable executeAsync() { - return predictImageWithServiceResponseAsync(projectId, imageData, iterationId, application).map(new Func1, ImagePrediction>() { + return detectImageWithServiceResponseAsync(projectId, publishedName, imageData, application).map(new Func1, ImagePrediction>() { @Override public ImagePrediction call(ServiceResponse response) { return response.body(); @@ -613,42 +689,48 @@ public ImagePrediction call(ServiceResponse response) { /** - * Predict an image url and saves the result. + * Detect objects in an image url and saves the result. * - * @param projectId The project id - * @param predictImageUrlOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param url Url of the image. + * @param detectImageUrlOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 predictImageUrl(UUID projectId, PredictImageUrlOptionalParameter predictImageUrlOptionalParameter) { - return predictImageUrlWithServiceResponseAsync(projectId, predictImageUrlOptionalParameter).toBlocking().single().body(); + public ImagePrediction detectImageUrl(UUID projectId, String publishedName, String url, DetectImageUrlOptionalParameter detectImageUrlOptionalParameter) { + return detectImageUrlWithServiceResponseAsync(projectId, publishedName, url, detectImageUrlOptionalParameter).toBlocking().single().body(); } /** - * Predict an image url and saves the result. + * Detect objects in an image url and saves the result. * - * @param projectId The project id - * @param predictImageUrlOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param url Url of the image. + * @param detectImageUrlOptionalParameter the object representing the optional parameters to be set before calling this API * @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 predictImageUrlAsync(UUID projectId, PredictImageUrlOptionalParameter predictImageUrlOptionalParameter, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(predictImageUrlWithServiceResponseAsync(projectId, predictImageUrlOptionalParameter), serviceCallback); + public ServiceFuture detectImageUrlAsync(UUID projectId, String publishedName, String url, DetectImageUrlOptionalParameter detectImageUrlOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(detectImageUrlWithServiceResponseAsync(projectId, publishedName, url, detectImageUrlOptionalParameter), serviceCallback); } /** - * Predict an image url and saves the result. + * Detect objects in an image url and saves the result. * - * @param projectId The project id - * @param predictImageUrlOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param url Url of the image. + * @param detectImageUrlOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ImagePrediction object */ - public Observable predictImageUrlAsync(UUID projectId, PredictImageUrlOptionalParameter predictImageUrlOptionalParameter) { - return predictImageUrlWithServiceResponseAsync(projectId, predictImageUrlOptionalParameter).map(new Func1, ImagePrediction>() { + public Observable detectImageUrlAsync(UUID projectId, String publishedName, String url, DetectImageUrlOptionalParameter detectImageUrlOptionalParameter) { + return detectImageUrlWithServiceResponseAsync(projectId, publishedName, url, detectImageUrlOptionalParameter).map(new Func1, ImagePrediction>() { @Override public ImagePrediction call(ServiceResponse response) { return response.body(); @@ -657,53 +739,71 @@ public ImagePrediction call(ServiceResponse response) { } /** - * Predict an image url and saves the result. + * Detect objects in an image url and saves the result. * - * @param projectId The project id - * @param predictImageUrlOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param url Url of the image. + * @param detectImageUrlOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ImagePrediction object */ - public Observable> predictImageUrlWithServiceResponseAsync(UUID projectId, PredictImageUrlOptionalParameter predictImageUrlOptionalParameter) { + public Observable> detectImageUrlWithServiceResponseAsync(UUID projectId, String publishedName, String url, DetectImageUrlOptionalParameter detectImageUrlOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } + if (publishedName == null) { + throw new IllegalArgumentException("Parameter publishedName is required and cannot be null."); + } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - final UUID iterationId = predictImageUrlOptionalParameter != null ? predictImageUrlOptionalParameter.iterationId() : null; - final String application = predictImageUrlOptionalParameter != null ? predictImageUrlOptionalParameter.application() : null; - final String url = predictImageUrlOptionalParameter != null ? predictImageUrlOptionalParameter.url() : null; + if (url == null) { + throw new IllegalArgumentException("Parameter url is required and cannot be null."); + } + final String application = detectImageUrlOptionalParameter != null ? detectImageUrlOptionalParameter.application() : null; - return predictImageUrlWithServiceResponseAsync(projectId, iterationId, application, url); + return detectImageUrlWithServiceResponseAsync(projectId, publishedName, url, application); } /** - * Predict an image url and saves the result. + * Detect objects in an image url and saves the result. * - * @param projectId The project id - * @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 application Optional. Specifies the name of application using the endpoint - * @param url the String value + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param url Url of the image. + * @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> predictImageUrlWithServiceResponseAsync(UUID projectId, UUID iterationId, String application, String url) { + public Observable> detectImageUrlWithServiceResponseAsync(UUID projectId, String publishedName, String url, String application) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } + if (publishedName == null) { + throw new IllegalArgumentException("Parameter publishedName is required and cannot be null."); + } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } + if (url == null) { + throw new IllegalArgumentException("Parameter url is required and cannot be null."); + } ImageUrl imageUrl = new ImageUrl(); imageUrl.withUrl(url); - return service.predictImageUrl(projectId, iterationId, application, this.client.apiKey(), this.client.acceptLanguage(), imageUrl, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.detectImageUrl(projectId, publishedName, application, this.client.apiKey(), this.client.acceptLanguage(), imageUrl, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = predictImageUrlDelegate(response); + ServiceResponse clientResponse = detectImageUrlDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -712,68 +812,846 @@ public Observable> call(Response }); } - private ServiceResponse predictImageUrlDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse detectImageUrlDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(CustomVisionErrorException.class) .build(response); } @Override - public PredictionsPredictImageUrlParameters predictImageUrl() { - return new PredictionsPredictImageUrlParameters(this); + public PredictionsDetectImageUrlParameters detectImageUrl() { + return new PredictionsDetectImageUrlParameters(this); } /** - * Internal class implementing PredictionsPredictImageUrlDefinition. + * Internal class implementing PredictionsDetectImageUrlDefinition. */ - class PredictionsPredictImageUrlParameters implements PredictionsPredictImageUrlDefinition { + class PredictionsDetectImageUrlParameters implements PredictionsDetectImageUrlDefinition { private PredictionsImpl parent; private UUID projectId; - private UUID iterationId; - private String application; + private String publishedName; private String url; + private String application; /** * Constructor. * @param parent the parent object. */ - PredictionsPredictImageUrlParameters(PredictionsImpl parent) { + PredictionsDetectImageUrlParameters(PredictionsImpl parent) { this.parent = parent; } @Override - public PredictionsPredictImageUrlParameters withProjectId(UUID projectId) { + public PredictionsDetectImageUrlParameters withProjectId(UUID projectId) { this.projectId = projectId; return this; } @Override - public PredictionsPredictImageUrlParameters withIterationId(UUID iterationId) { - this.iterationId = iterationId; + public PredictionsDetectImageUrlParameters withPublishedName(String publishedName) { + this.publishedName = publishedName; + return this; + } + + @Override + public PredictionsDetectImageUrlParameters withUrl(String url) { + this.url = url; return this; } @Override - public PredictionsPredictImageUrlParameters withApplication(String application) { + public PredictionsDetectImageUrlParameters withApplication(String application) { this.application = application; return this; } @Override - public PredictionsPredictImageUrlParameters withUrl(String url) { - this.url = url; + public ImagePrediction execute() { + return detectImageUrlWithServiceResponseAsync(projectId, publishedName, url, application).toBlocking().single().body(); + } + + @Override + public Observable executeAsync() { + return detectImageUrlWithServiceResponseAsync(projectId, publishedName, url, 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 publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 0MB. + * @param classifyImageWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 publishedName, byte[] imageData, ClassifyImageWithNoStoreOptionalParameter classifyImageWithNoStoreOptionalParameter) { + return classifyImageWithNoStoreWithServiceResponseAsync(projectId, publishedName, imageData, classifyImageWithNoStoreOptionalParameter).toBlocking().single().body(); + } + + /** + * Classify an image without saving the result. + * + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 0MB. + * @param classifyImageWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 publishedName, byte[] imageData, ClassifyImageWithNoStoreOptionalParameter classifyImageWithNoStoreOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(classifyImageWithNoStoreWithServiceResponseAsync(projectId, publishedName, imageData, classifyImageWithNoStoreOptionalParameter), serviceCallback); + } + + /** + * Classify an image without saving the result. + * + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 0MB. + * @param classifyImageWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable classifyImageWithNoStoreAsync(UUID projectId, String publishedName, byte[] imageData, ClassifyImageWithNoStoreOptionalParameter classifyImageWithNoStoreOptionalParameter) { + return classifyImageWithNoStoreWithServiceResponseAsync(projectId, publishedName, imageData, classifyImageWithNoStoreOptionalParameter).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 publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 0MB. + * @param classifyImageWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable> classifyImageWithNoStoreWithServiceResponseAsync(UUID projectId, String publishedName, byte[] imageData, ClassifyImageWithNoStoreOptionalParameter classifyImageWithNoStoreOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (publishedName == null) { + throw new IllegalArgumentException("Parameter publishedName is required and cannot be null."); + } + if (imageData == null) { + throw new IllegalArgumentException("Parameter imageData is required and cannot be null."); + } + if (this.client.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); + } + final String application = classifyImageWithNoStoreOptionalParameter != null ? classifyImageWithNoStoreOptionalParameter.application() : null; + + return classifyImageWithNoStoreWithServiceResponseAsync(projectId, publishedName, imageData, application); + } + + /** + * Classify an image without saving the result. + * + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 0MB. + * @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 publishedName, byte[] imageData, String application) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (publishedName == null) { + throw new IllegalArgumentException("Parameter publishedName is required and cannot be null."); + } + if (imageData == null) { + throw new IllegalArgumentException("Parameter imageData is required and cannot be null."); + } + if (this.client.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + RequestBody imageDataConverted = RequestBody.create(MediaType.parse("multipart/form-data"), imageData); + return service.classifyImageWithNoStore(projectId, publishedName, application, imageDataConverted, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.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.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) + .build(response); + } + + @Override + public PredictionsClassifyImageWithNoStoreParameters classifyImageWithNoStore() { + return new PredictionsClassifyImageWithNoStoreParameters(this); + } + + /** + * Internal class implementing PredictionsClassifyImageWithNoStoreDefinition. + */ + class PredictionsClassifyImageWithNoStoreParameters implements PredictionsClassifyImageWithNoStoreDefinition { + private PredictionsImpl parent; + private UUID projectId; + private String publishedName; + private byte[] imageData; + private String application; + + /** + * Constructor. + * @param parent the parent object. + */ + PredictionsClassifyImageWithNoStoreParameters(PredictionsImpl parent) { + this.parent = parent; + } + + @Override + public PredictionsClassifyImageWithNoStoreParameters withProjectId(UUID projectId) { + this.projectId = projectId; + return this; + } + + @Override + public PredictionsClassifyImageWithNoStoreParameters withPublishedName(String publishedName) { + this.publishedName = publishedName; + return this; + } + + @Override + public PredictionsClassifyImageWithNoStoreParameters withImageData(byte[] imageData) { + this.imageData = imageData; + return this; + } + + @Override + public PredictionsClassifyImageWithNoStoreParameters withApplication(String application) { + this.application = application; + return this; + } + + @Override + public ImagePrediction execute() { + return classifyImageWithNoStoreWithServiceResponseAsync(projectId, publishedName, imageData, application).toBlocking().single().body(); + } + + @Override + public Observable executeAsync() { + return classifyImageWithNoStoreWithServiceResponseAsync(projectId, publishedName, imageData, application).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 publishedName Specifies the name of the model to evaluate against. + * @param url Url of the image. + * @param classifyImageUrlWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 publishedName, String url, ClassifyImageUrlWithNoStoreOptionalParameter classifyImageUrlWithNoStoreOptionalParameter) { + return classifyImageUrlWithNoStoreWithServiceResponseAsync(projectId, publishedName, url, classifyImageUrlWithNoStoreOptionalParameter).toBlocking().single().body(); + } + + /** + * Classify an image url without saving the result. + * + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param url Url of the image. + * @param classifyImageUrlWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 publishedName, String url, ClassifyImageUrlWithNoStoreOptionalParameter classifyImageUrlWithNoStoreOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(classifyImageUrlWithNoStoreWithServiceResponseAsync(projectId, publishedName, url, classifyImageUrlWithNoStoreOptionalParameter), serviceCallback); + } + + /** + * Classify an image url without saving the result. + * + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param url Url of the image. + * @param classifyImageUrlWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable classifyImageUrlWithNoStoreAsync(UUID projectId, String publishedName, String url, ClassifyImageUrlWithNoStoreOptionalParameter classifyImageUrlWithNoStoreOptionalParameter) { + return classifyImageUrlWithNoStoreWithServiceResponseAsync(projectId, publishedName, url, classifyImageUrlWithNoStoreOptionalParameter).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 publishedName Specifies the name of the model to evaluate against. + * @param url Url of the image. + * @param classifyImageUrlWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable> classifyImageUrlWithNoStoreWithServiceResponseAsync(UUID projectId, String publishedName, String url, ClassifyImageUrlWithNoStoreOptionalParameter classifyImageUrlWithNoStoreOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (publishedName == null) { + throw new IllegalArgumentException("Parameter publishedName is required and cannot be null."); + } + if (this.client.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); + } + if (url == null) { + throw new IllegalArgumentException("Parameter url is required and cannot be null."); + } + final String application = classifyImageUrlWithNoStoreOptionalParameter != null ? classifyImageUrlWithNoStoreOptionalParameter.application() : null; + + return classifyImageUrlWithNoStoreWithServiceResponseAsync(projectId, publishedName, url, application); + } + + /** + * Classify an image url without saving the result. + * + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param url Url of the image. + * @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> classifyImageUrlWithNoStoreWithServiceResponseAsync(UUID projectId, String publishedName, String url, String application) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (publishedName == null) { + throw new IllegalArgumentException("Parameter publishedName is required and cannot be null."); + } + if (this.client.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); + } + if (url == null) { + throw new IllegalArgumentException("Parameter url is required and cannot be null."); + } + ImageUrl imageUrl = new ImageUrl(); + imageUrl.withUrl(url); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.classifyImageUrlWithNoStore(projectId, publishedName, application, this.client.apiKey(), this.client.acceptLanguage(), imageUrl, parameterizedHost, this.client.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.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) + .build(response); + } + + @Override + public PredictionsClassifyImageUrlWithNoStoreParameters classifyImageUrlWithNoStore() { + return new PredictionsClassifyImageUrlWithNoStoreParameters(this); + } + + /** + * Internal class implementing PredictionsClassifyImageUrlWithNoStoreDefinition. + */ + class PredictionsClassifyImageUrlWithNoStoreParameters implements PredictionsClassifyImageUrlWithNoStoreDefinition { + private PredictionsImpl parent; + private UUID projectId; + private String publishedName; + private String url; + private String application; + + /** + * Constructor. + * @param parent the parent object. + */ + PredictionsClassifyImageUrlWithNoStoreParameters(PredictionsImpl parent) { + this.parent = parent; + } + + @Override + public PredictionsClassifyImageUrlWithNoStoreParameters withProjectId(UUID projectId) { + this.projectId = projectId; + return this; + } + + @Override + public PredictionsClassifyImageUrlWithNoStoreParameters withPublishedName(String publishedName) { + this.publishedName = publishedName; + return this; + } + + @Override + public PredictionsClassifyImageUrlWithNoStoreParameters withUrl(String url) { + this.url = url; + return this; + } + + @Override + public PredictionsClassifyImageUrlWithNoStoreParameters withApplication(String application) { + this.application = application; + return this; + } + + @Override + public ImagePrediction execute() { + return classifyImageUrlWithNoStoreWithServiceResponseAsync(projectId, publishedName, url, application).toBlocking().single().body(); + } + + @Override + public Observable executeAsync() { + return classifyImageUrlWithNoStoreWithServiceResponseAsync(projectId, publishedName, url, 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 publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 4MB. + * @param classifyImageOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 publishedName, byte[] imageData, ClassifyImageOptionalParameter classifyImageOptionalParameter) { + return classifyImageWithServiceResponseAsync(projectId, publishedName, imageData, classifyImageOptionalParameter).toBlocking().single().body(); + } + + /** + * Classify an image and saves the result. + * + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 4MB. + * @param classifyImageOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 publishedName, byte[] imageData, ClassifyImageOptionalParameter classifyImageOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(classifyImageWithServiceResponseAsync(projectId, publishedName, imageData, classifyImageOptionalParameter), serviceCallback); + } + + /** + * Classify an image and saves the result. + * + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 4MB. + * @param classifyImageOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable classifyImageAsync(UUID projectId, String publishedName, byte[] imageData, ClassifyImageOptionalParameter classifyImageOptionalParameter) { + return classifyImageWithServiceResponseAsync(projectId, publishedName, imageData, classifyImageOptionalParameter).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 publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 4MB. + * @param classifyImageOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable> classifyImageWithServiceResponseAsync(UUID projectId, String publishedName, byte[] imageData, ClassifyImageOptionalParameter classifyImageOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (publishedName == null) { + throw new IllegalArgumentException("Parameter publishedName is required and cannot be null."); + } + if (imageData == null) { + throw new IllegalArgumentException("Parameter imageData is required and cannot be null."); + } + if (this.client.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); + } + final String application = classifyImageOptionalParameter != null ? classifyImageOptionalParameter.application() : null; + + return classifyImageWithServiceResponseAsync(projectId, publishedName, imageData, application); + } + + /** + * Classify an image and saves the result. + * + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 4MB. + * @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 publishedName, byte[] imageData, String application) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (publishedName == null) { + throw new IllegalArgumentException("Parameter publishedName is required and cannot be null."); + } + if (imageData == null) { + throw new IllegalArgumentException("Parameter imageData is required and cannot be null."); + } + if (this.client.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + RequestBody imageDataConverted = RequestBody.create(MediaType.parse("multipart/form-data"), imageData); + return service.classifyImage(projectId, publishedName, application, imageDataConverted, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.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.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) + .build(response); + } + + @Override + public PredictionsClassifyImageParameters classifyImage() { + return new PredictionsClassifyImageParameters(this); + } + + /** + * Internal class implementing PredictionsClassifyImageDefinition. + */ + class PredictionsClassifyImageParameters implements PredictionsClassifyImageDefinition { + private PredictionsImpl parent; + private UUID projectId; + private String publishedName; + private byte[] imageData; + private String application; + + /** + * Constructor. + * @param parent the parent object. + */ + PredictionsClassifyImageParameters(PredictionsImpl parent) { + this.parent = parent; + } + + @Override + public PredictionsClassifyImageParameters withProjectId(UUID projectId) { + this.projectId = projectId; + return this; + } + + @Override + public PredictionsClassifyImageParameters withPublishedName(String publishedName) { + this.publishedName = publishedName; + return this; + } + + @Override + public PredictionsClassifyImageParameters withImageData(byte[] imageData) { + this.imageData = imageData; + return this; + } + + @Override + public PredictionsClassifyImageParameters withApplication(String application) { + this.application = application; + return this; + } + + @Override + public ImagePrediction execute() { + return classifyImageWithServiceResponseAsync(projectId, publishedName, imageData, application).toBlocking().single().body(); + } + + @Override + public Observable executeAsync() { + return classifyImageWithServiceResponseAsync(projectId, publishedName, imageData, application).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 publishedName Specifies the name of the model to evaluate against. + * @param url Url of the image. + * @param classifyImageUrlOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 publishedName, String url, ClassifyImageUrlOptionalParameter classifyImageUrlOptionalParameter) { + return classifyImageUrlWithServiceResponseAsync(projectId, publishedName, url, classifyImageUrlOptionalParameter).toBlocking().single().body(); + } + + /** + * Classify an image url and saves the result. + * + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param url Url of the image. + * @param classifyImageUrlOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 publishedName, String url, ClassifyImageUrlOptionalParameter classifyImageUrlOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(classifyImageUrlWithServiceResponseAsync(projectId, publishedName, url, classifyImageUrlOptionalParameter), serviceCallback); + } + + /** + * Classify an image url and saves the result. + * + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param url Url of the image. + * @param classifyImageUrlOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable classifyImageUrlAsync(UUID projectId, String publishedName, String url, ClassifyImageUrlOptionalParameter classifyImageUrlOptionalParameter) { + return classifyImageUrlWithServiceResponseAsync(projectId, publishedName, url, classifyImageUrlOptionalParameter).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 publishedName Specifies the name of the model to evaluate against. + * @param url Url of the image. + * @param classifyImageUrlOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable> classifyImageUrlWithServiceResponseAsync(UUID projectId, String publishedName, String url, ClassifyImageUrlOptionalParameter classifyImageUrlOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (publishedName == null) { + throw new IllegalArgumentException("Parameter publishedName is required and cannot be null."); + } + if (this.client.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); + } + if (url == null) { + throw new IllegalArgumentException("Parameter url is required and cannot be null."); + } + final String application = classifyImageUrlOptionalParameter != null ? classifyImageUrlOptionalParameter.application() : null; + + return classifyImageUrlWithServiceResponseAsync(projectId, publishedName, url, application); + } + + /** + * Classify an image url and saves the result. + * + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param url Url of the image. + * @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> classifyImageUrlWithServiceResponseAsync(UUID projectId, String publishedName, String url, String application) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (publishedName == null) { + throw new IllegalArgumentException("Parameter publishedName is required and cannot be null."); + } + if (this.client.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); + } + if (url == null) { + throw new IllegalArgumentException("Parameter url is required and cannot be null."); + } + ImageUrl imageUrl = new ImageUrl(); + imageUrl.withUrl(url); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.classifyImageUrl(projectId, publishedName, application, this.client.apiKey(), this.client.acceptLanguage(), imageUrl, parameterizedHost, this.client.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.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) + .build(response); + } + + @Override + public PredictionsClassifyImageUrlParameters classifyImageUrl() { + return new PredictionsClassifyImageUrlParameters(this); + } + + /** + * Internal class implementing PredictionsClassifyImageUrlDefinition. + */ + class PredictionsClassifyImageUrlParameters implements PredictionsClassifyImageUrlDefinition { + private PredictionsImpl parent; + private UUID projectId; + private String publishedName; + private String url; + private String application; + + /** + * Constructor. + * @param parent the parent object. + */ + PredictionsClassifyImageUrlParameters(PredictionsImpl parent) { + this.parent = parent; + } + + @Override + public PredictionsClassifyImageUrlParameters withProjectId(UUID projectId) { + this.projectId = projectId; + return this; + } + + @Override + public PredictionsClassifyImageUrlParameters withPublishedName(String publishedName) { + this.publishedName = publishedName; + return this; + } + + @Override + public PredictionsClassifyImageUrlParameters withUrl(String url) { + this.url = url; + return this; + } + + @Override + public PredictionsClassifyImageUrlParameters withApplication(String application) { + this.application = application; return this; } @Override public ImagePrediction execute() { - return predictImageUrlWithServiceResponseAsync(projectId, iterationId, application, url).toBlocking().single().body(); + return classifyImageUrlWithServiceResponseAsync(projectId, publishedName, url, application).toBlocking().single().body(); } @Override public Observable executeAsync() { - return predictImageUrlWithServiceResponseAsync(projectId, iterationId, application, url).map(new Func1, ImagePrediction>() { + return classifyImageUrlWithServiceResponseAsync(projectId, publishedName, url, application).map(new Func1, ImagePrediction>() { @Override public ImagePrediction call(ServiceResponse response) { return response.body(); diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/PredictImageOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ClassifyImageOptionalParameter.java similarity index 55% rename from sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/PredictImageOptionalParameter.java rename to sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ClassifyImageOptionalParameter.java index 168100eb079f..307b1abf3c8f 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/PredictImageOptionalParameter.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ClassifyImageOptionalParameter.java @@ -8,19 +8,11 @@ package com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models; -import java.util.UUID; /** - * The PredictImageOptionalParameter model. + * The ClassifyImageOptionalParameter model. */ -public class PredictImageOptionalParameter { - /** - * Optional. Specifies the id of a particular iteration to evaluate - * against. - * The default iteration for the project will be used when not specified. - */ - private UUID iterationId; - +public class ClassifyImageOptionalParameter { /** * Optional. Specifies the name of application using the endpoint. */ @@ -31,26 +23,6 @@ public class PredictImageOptionalParameter { */ private String thisclientacceptLanguage; - /** - * Get the iterationId value. - * - * @return the iterationId value - */ - public UUID iterationId() { - return this.iterationId; - } - - /** - * Set the iterationId value. - * - * @param iterationId the iterationId value to set - * @return the PredictImageOptionalParameter object itself. - */ - public PredictImageOptionalParameter withIterationId(UUID iterationId) { - this.iterationId = iterationId; - return this; - } - /** * Get the application value. * @@ -64,9 +36,9 @@ public String application() { * Set the application value. * * @param application the application value to set - * @return the PredictImageOptionalParameter object itself. + * @return the ClassifyImageOptionalParameter object itself. */ - public PredictImageOptionalParameter withApplication(String application) { + public ClassifyImageOptionalParameter withApplication(String application) { this.application = application; return this; } @@ -84,9 +56,9 @@ public String thisclientacceptLanguage() { * Set the thisclientacceptLanguage value. * * @param thisclientacceptLanguage the thisclientacceptLanguage value to set - * @return the PredictImageOptionalParameter object itself. + * @return the ClassifyImageOptionalParameter object itself. */ - public PredictImageOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + public ClassifyImageOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { this.thisclientacceptLanguage = thisclientacceptLanguage; return this; } diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/PredictImageWithNoStoreOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ClassifyImageUrlOptionalParameter.java similarity index 53% rename from sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/PredictImageWithNoStoreOptionalParameter.java rename to sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ClassifyImageUrlOptionalParameter.java index e5235494089b..6d8eb4e0c3d7 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/PredictImageWithNoStoreOptionalParameter.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ClassifyImageUrlOptionalParameter.java @@ -8,19 +8,11 @@ package com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models; -import java.util.UUID; /** - * The PredictImageWithNoStoreOptionalParameter model. + * The ClassifyImageUrlOptionalParameter model. */ -public class PredictImageWithNoStoreOptionalParameter { - /** - * Optional. Specifies the id of a particular iteration to evaluate - * against. - * The default iteration for the project will be used when not specified. - */ - private UUID iterationId; - +public class ClassifyImageUrlOptionalParameter { /** * Optional. Specifies the name of application using the endpoint. */ @@ -31,26 +23,6 @@ public class PredictImageWithNoStoreOptionalParameter { */ private String thisclientacceptLanguage; - /** - * Get the iterationId value. - * - * @return the iterationId value - */ - public UUID iterationId() { - return this.iterationId; - } - - /** - * Set the iterationId value. - * - * @param iterationId the iterationId value to set - * @return the PredictImageWithNoStoreOptionalParameter object itself. - */ - public PredictImageWithNoStoreOptionalParameter withIterationId(UUID iterationId) { - this.iterationId = iterationId; - return this; - } - /** * Get the application value. * @@ -64,9 +36,9 @@ public String application() { * Set the application value. * * @param application the application value to set - * @return the PredictImageWithNoStoreOptionalParameter object itself. + * @return the ClassifyImageUrlOptionalParameter object itself. */ - public PredictImageWithNoStoreOptionalParameter withApplication(String application) { + public ClassifyImageUrlOptionalParameter withApplication(String application) { this.application = application; return this; } @@ -84,9 +56,9 @@ public String thisclientacceptLanguage() { * Set the thisclientacceptLanguage value. * * @param thisclientacceptLanguage the thisclientacceptLanguage value to set - * @return the PredictImageWithNoStoreOptionalParameter object itself. + * @return the ClassifyImageUrlOptionalParameter object itself. */ - public PredictImageWithNoStoreOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + public ClassifyImageUrlOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { this.thisclientacceptLanguage = thisclientacceptLanguage; return this; } diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ClassifyImageUrlWithNoStoreOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ClassifyImageUrlWithNoStoreOptionalParameter.java new file mode 100644 index 000000000000..31bb767d00f2 --- /dev/null +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ClassifyImageUrlWithNoStoreOptionalParameter.java @@ -0,0 +1,66 @@ +/** + * 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; + + +/** + * The ClassifyImageUrlWithNoStoreOptionalParameter model. + */ +public class ClassifyImageUrlWithNoStoreOptionalParameter { + /** + * Optional. Specifies the name of application using the endpoint. + */ + private String application; + + /** + * Gets or sets the preferred language for the response. + */ + private String thisclientacceptLanguage; + + /** + * Get the application value. + * + * @return the application value + */ + public String application() { + return this.application; + } + + /** + * Set the application value. + * + * @param application the application value to set + * @return the ClassifyImageUrlWithNoStoreOptionalParameter object itself. + */ + public ClassifyImageUrlWithNoStoreOptionalParameter withApplication(String application) { + this.application = application; + return this; + } + + /** + * Get the thisclientacceptLanguage value. + * + * @return the thisclientacceptLanguage value + */ + public String thisclientacceptLanguage() { + return this.thisclientacceptLanguage; + } + + /** + * Set the thisclientacceptLanguage value. + * + * @param thisclientacceptLanguage the thisclientacceptLanguage value to set + * @return the ClassifyImageUrlWithNoStoreOptionalParameter object itself. + */ + public ClassifyImageUrlWithNoStoreOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ClassifyImageWithNoStoreOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ClassifyImageWithNoStoreOptionalParameter.java new file mode 100644 index 000000000000..fc36ddcf7771 --- /dev/null +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ClassifyImageWithNoStoreOptionalParameter.java @@ -0,0 +1,66 @@ +/** + * 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; + + +/** + * The ClassifyImageWithNoStoreOptionalParameter model. + */ +public class ClassifyImageWithNoStoreOptionalParameter { + /** + * Optional. Specifies the name of application using the endpoint. + */ + private String application; + + /** + * Gets or sets the preferred language for the response. + */ + private String thisclientacceptLanguage; + + /** + * Get the application value. + * + * @return the application value + */ + public String application() { + return this.application; + } + + /** + * Set the application value. + * + * @param application the application value to set + * @return the ClassifyImageWithNoStoreOptionalParameter object itself. + */ + public ClassifyImageWithNoStoreOptionalParameter withApplication(String application) { + this.application = application; + return this; + } + + /** + * Get the thisclientacceptLanguage value. + * + * @return the thisclientacceptLanguage value + */ + public String thisclientacceptLanguage() { + return this.thisclientacceptLanguage; + } + + /** + * Set the thisclientacceptLanguage value. + * + * @param thisclientacceptLanguage the thisclientacceptLanguage value to set + * @return the ClassifyImageWithNoStoreOptionalParameter object itself. + */ + public ClassifyImageWithNoStoreOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/CustomVisionError.java b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/CustomVisionError.java new file mode 100644 index 000000000000..a08e32d38567 --- /dev/null +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/CustomVisionError.java @@ -0,0 +1,135 @@ +/** + * 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 { + /** + * The error code. Possible values include: 'NoError', 'BadRequest', + * 'BadRequestExceededBatchSize', 'BadRequestNotSupported', + * 'BadRequestInvalidIds', 'BadRequestProjectName', + * 'BadRequestProjectNameNotUnique', 'BadRequestProjectDescription', + * 'BadRequestProjectUnknownDomain', + * 'BadRequestProjectUnknownClassification', + * 'BadRequestProjectUnsupportedDomainTypeChange', + * 'BadRequestProjectUnsupportedExportPlatform', 'BadRequestIterationName', + * 'BadRequestIterationNameNotUnique', 'BadRequestIterationDescription', + * 'BadRequestIterationIsNotTrained', + * 'BadRequestWorkspaceCannotBeModified', + * 'BadRequestWorkspaceNotDeletable', 'BadRequestTagName', + * 'BadRequestTagNameNotUnique', 'BadRequestTagDescription', + * 'BadRequestTagType', 'BadRequestMultipleNegativeTag', + * 'BadRequestImageTags', 'BadRequestImageRegions', + * 'BadRequestNegativeAndRegularTagOnSameImage', + * 'BadRequestRequiredParamIsNull', 'BadRequestIterationIsPublished', + * 'BadRequestInvalidPublishName', 'BadRequestInvalidPublishTarget', + * 'BadRequestUnpublishFailed', 'BadRequestSubscriptionApi', + * 'BadRequestExceedProjectLimit', + * 'BadRequestExceedIterationPerProjectLimit', + * 'BadRequestExceedTagPerProjectLimit', + * 'BadRequestExceedTagPerImageLimit', 'BadRequestExceededQuota', + * 'BadRequestCannotMigrateProjectWithName', 'BadRequestNotLimitedTrial', + * 'BadRequestImageBatch', 'BadRequestImageStream', 'BadRequestImageUrl', + * 'BadRequestImageFormat', 'BadRequestImageSizeBytes', + * 'BadRequestImageExceededCount', 'BadRequestTrainingNotNeeded', + * 'BadRequestTrainingNotNeededButTrainingPipelineUpdated', + * 'BadRequestTrainingValidationFailed', + * 'BadRequestClassificationTrainingValidationFailed', + * 'BadRequestMultiClassClassificationTrainingValidationFailed', + * 'BadRequestMultiLabelClassificationTrainingValidationFailed', + * 'BadRequestDetectionTrainingValidationFailed', + * 'BadRequestTrainingAlreadyInProgress', + * 'BadRequestDetectionTrainingNotAllowNegativeTag', + * 'BadRequestInvalidEmailAddress', + * 'BadRequestDomainNotSupportedForAdvancedTraining', + * 'BadRequestExportPlatformNotSupportedForAdvancedTraining', + * 'BadRequestReservedBudgetInHoursNotEnoughForAdvancedTraining', + * 'BadRequestExportValidationFailed', 'BadRequestExportAlreadyInProgress', + * 'BadRequestPredictionIdsMissing', + * 'BadRequestPredictionIdsExceededCount', + * 'BadRequestPredictionTagsExceededCount', + * 'BadRequestPredictionResultsExceededCount', + * 'BadRequestPredictionInvalidApplicationName', + * 'BadRequestPredictionInvalidQueryParameters', 'BadRequestInvalid', + * 'UnsupportedMediaType', 'Forbidden', 'ForbiddenUser', + * 'ForbiddenUserResource', 'ForbiddenUserSignupDisabled', + * 'ForbiddenUserSignupAllowanceExceeded', 'ForbiddenUserDoesNotExist', + * 'ForbiddenUserDisabled', 'ForbiddenUserInsufficientCapability', + * 'ForbiddenDRModeEnabled', '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 CustomVisionErrorCodes code; + + /** + * A message explaining the error reported by the service. + */ + @JsonProperty(value = "message", required = true) + private String message; + + /** + * Get the code value. + * + * @return the code value + */ + public CustomVisionErrorCodes code() { + return this.code; + } + + /** + * Set the code value. + * + * @param code the code value to set + * @return the CustomVisionError object itself. + */ + public CustomVisionError withCode(CustomVisionErrorCodes 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/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/CustomVisionErrorCodes.java b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/CustomVisionErrorCodes.java new file mode 100644 index 000000000000..0cddaf7852c5 --- /dev/null +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/CustomVisionErrorCodes.java @@ -0,0 +1,371 @@ +/** + * 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 java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for CustomVisionErrorCodes. + */ +public final class CustomVisionErrorCodes extends ExpandableStringEnum { + /** Static value NoError for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes NO_ERROR = fromString("NoError"); + + /** Static value BadRequest for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST = fromString("BadRequest"); + + /** Static value BadRequestExceededBatchSize for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_EXCEEDED_BATCH_SIZE = fromString("BadRequestExceededBatchSize"); + + /** Static value BadRequestNotSupported for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_NOT_SUPPORTED = fromString("BadRequestNotSupported"); + + /** Static value BadRequestInvalidIds for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_INVALID_IDS = fromString("BadRequestInvalidIds"); + + /** Static value BadRequestProjectName for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_PROJECT_NAME = fromString("BadRequestProjectName"); + + /** Static value BadRequestProjectNameNotUnique for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_PROJECT_NAME_NOT_UNIQUE = fromString("BadRequestProjectNameNotUnique"); + + /** Static value BadRequestProjectDescription for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_PROJECT_DESCRIPTION = fromString("BadRequestProjectDescription"); + + /** Static value BadRequestProjectUnknownDomain for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_PROJECT_UNKNOWN_DOMAIN = fromString("BadRequestProjectUnknownDomain"); + + /** Static value BadRequestProjectUnknownClassification for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_PROJECT_UNKNOWN_CLASSIFICATION = fromString("BadRequestProjectUnknownClassification"); + + /** Static value BadRequestProjectUnsupportedDomainTypeChange for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_PROJECT_UNSUPPORTED_DOMAIN_TYPE_CHANGE = fromString("BadRequestProjectUnsupportedDomainTypeChange"); + + /** Static value BadRequestProjectUnsupportedExportPlatform for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_PROJECT_UNSUPPORTED_EXPORT_PLATFORM = fromString("BadRequestProjectUnsupportedExportPlatform"); + + /** Static value BadRequestIterationName for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_ITERATION_NAME = fromString("BadRequestIterationName"); + + /** Static value BadRequestIterationNameNotUnique for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_ITERATION_NAME_NOT_UNIQUE = fromString("BadRequestIterationNameNotUnique"); + + /** Static value BadRequestIterationDescription for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_ITERATION_DESCRIPTION = fromString("BadRequestIterationDescription"); + + /** Static value BadRequestIterationIsNotTrained for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_ITERATION_IS_NOT_TRAINED = fromString("BadRequestIterationIsNotTrained"); + + /** Static value BadRequestWorkspaceCannotBeModified for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_WORKSPACE_CANNOT_BE_MODIFIED = fromString("BadRequestWorkspaceCannotBeModified"); + + /** Static value BadRequestWorkspaceNotDeletable for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_WORKSPACE_NOT_DELETABLE = fromString("BadRequestWorkspaceNotDeletable"); + + /** Static value BadRequestTagName for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_TAG_NAME = fromString("BadRequestTagName"); + + /** Static value BadRequestTagNameNotUnique for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_TAG_NAME_NOT_UNIQUE = fromString("BadRequestTagNameNotUnique"); + + /** Static value BadRequestTagDescription for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_TAG_DESCRIPTION = fromString("BadRequestTagDescription"); + + /** Static value BadRequestTagType for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_TAG_TYPE = fromString("BadRequestTagType"); + + /** Static value BadRequestMultipleNegativeTag for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_MULTIPLE_NEGATIVE_TAG = fromString("BadRequestMultipleNegativeTag"); + + /** Static value BadRequestImageTags for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_IMAGE_TAGS = fromString("BadRequestImageTags"); + + /** Static value BadRequestImageRegions for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_IMAGE_REGIONS = fromString("BadRequestImageRegions"); + + /** Static value BadRequestNegativeAndRegularTagOnSameImage for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_NEGATIVE_AND_REGULAR_TAG_ON_SAME_IMAGE = fromString("BadRequestNegativeAndRegularTagOnSameImage"); + + /** Static value BadRequestRequiredParamIsNull for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_REQUIRED_PARAM_IS_NULL = fromString("BadRequestRequiredParamIsNull"); + + /** Static value BadRequestIterationIsPublished for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_ITERATION_IS_PUBLISHED = fromString("BadRequestIterationIsPublished"); + + /** Static value BadRequestInvalidPublishName for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_INVALID_PUBLISH_NAME = fromString("BadRequestInvalidPublishName"); + + /** Static value BadRequestInvalidPublishTarget for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_INVALID_PUBLISH_TARGET = fromString("BadRequestInvalidPublishTarget"); + + /** Static value BadRequestUnpublishFailed for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_UNPUBLISH_FAILED = fromString("BadRequestUnpublishFailed"); + + /** Static value BadRequestSubscriptionApi for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_SUBSCRIPTION_API = fromString("BadRequestSubscriptionApi"); + + /** Static value BadRequestExceedProjectLimit for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_EXCEED_PROJECT_LIMIT = fromString("BadRequestExceedProjectLimit"); + + /** Static value BadRequestExceedIterationPerProjectLimit for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_EXCEED_ITERATION_PER_PROJECT_LIMIT = fromString("BadRequestExceedIterationPerProjectLimit"); + + /** Static value BadRequestExceedTagPerProjectLimit for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_EXCEED_TAG_PER_PROJECT_LIMIT = fromString("BadRequestExceedTagPerProjectLimit"); + + /** Static value BadRequestExceedTagPerImageLimit for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_EXCEED_TAG_PER_IMAGE_LIMIT = fromString("BadRequestExceedTagPerImageLimit"); + + /** Static value BadRequestExceededQuota for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_EXCEEDED_QUOTA = fromString("BadRequestExceededQuota"); + + /** Static value BadRequestCannotMigrateProjectWithName for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_CANNOT_MIGRATE_PROJECT_WITH_NAME = fromString("BadRequestCannotMigrateProjectWithName"); + + /** Static value BadRequestNotLimitedTrial for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_NOT_LIMITED_TRIAL = fromString("BadRequestNotLimitedTrial"); + + /** Static value BadRequestImageBatch for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_IMAGE_BATCH = fromString("BadRequestImageBatch"); + + /** Static value BadRequestImageStream for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_IMAGE_STREAM = fromString("BadRequestImageStream"); + + /** Static value BadRequestImageUrl for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_IMAGE_URL = fromString("BadRequestImageUrl"); + + /** Static value BadRequestImageFormat for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_IMAGE_FORMAT = fromString("BadRequestImageFormat"); + + /** Static value BadRequestImageSizeBytes for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_IMAGE_SIZE_BYTES = fromString("BadRequestImageSizeBytes"); + + /** Static value BadRequestImageExceededCount for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_IMAGE_EXCEEDED_COUNT = fromString("BadRequestImageExceededCount"); + + /** Static value BadRequestTrainingNotNeeded for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_TRAINING_NOT_NEEDED = fromString("BadRequestTrainingNotNeeded"); + + /** Static value BadRequestTrainingNotNeededButTrainingPipelineUpdated for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_TRAINING_NOT_NEEDED_BUT_TRAINING_PIPELINE_UPDATED = fromString("BadRequestTrainingNotNeededButTrainingPipelineUpdated"); + + /** Static value BadRequestTrainingValidationFailed for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_TRAINING_VALIDATION_FAILED = fromString("BadRequestTrainingValidationFailed"); + + /** Static value BadRequestClassificationTrainingValidationFailed for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_CLASSIFICATION_TRAINING_VALIDATION_FAILED = fromString("BadRequestClassificationTrainingValidationFailed"); + + /** Static value BadRequestMultiClassClassificationTrainingValidationFailed for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_MULTI_CLASS_CLASSIFICATION_TRAINING_VALIDATION_FAILED = fromString("BadRequestMultiClassClassificationTrainingValidationFailed"); + + /** Static value BadRequestMultiLabelClassificationTrainingValidationFailed for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_MULTI_LABEL_CLASSIFICATION_TRAINING_VALIDATION_FAILED = fromString("BadRequestMultiLabelClassificationTrainingValidationFailed"); + + /** Static value BadRequestDetectionTrainingValidationFailed for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_DETECTION_TRAINING_VALIDATION_FAILED = fromString("BadRequestDetectionTrainingValidationFailed"); + + /** Static value BadRequestTrainingAlreadyInProgress for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_TRAINING_ALREADY_IN_PROGRESS = fromString("BadRequestTrainingAlreadyInProgress"); + + /** Static value BadRequestDetectionTrainingNotAllowNegativeTag for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_DETECTION_TRAINING_NOT_ALLOW_NEGATIVE_TAG = fromString("BadRequestDetectionTrainingNotAllowNegativeTag"); + + /** Static value BadRequestInvalidEmailAddress for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_INVALID_EMAIL_ADDRESS = fromString("BadRequestInvalidEmailAddress"); + + /** Static value BadRequestDomainNotSupportedForAdvancedTraining for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_DOMAIN_NOT_SUPPORTED_FOR_ADVANCED_TRAINING = fromString("BadRequestDomainNotSupportedForAdvancedTraining"); + + /** Static value BadRequestExportPlatformNotSupportedForAdvancedTraining for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_EXPORT_PLATFORM_NOT_SUPPORTED_FOR_ADVANCED_TRAINING = fromString("BadRequestExportPlatformNotSupportedForAdvancedTraining"); + + /** Static value BadRequestReservedBudgetInHoursNotEnoughForAdvancedTraining for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_RESERVED_BUDGET_IN_HOURS_NOT_ENOUGH_FOR_ADVANCED_TRAINING = fromString("BadRequestReservedBudgetInHoursNotEnoughForAdvancedTraining"); + + /** Static value BadRequestExportValidationFailed for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_EXPORT_VALIDATION_FAILED = fromString("BadRequestExportValidationFailed"); + + /** Static value BadRequestExportAlreadyInProgress for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_EXPORT_ALREADY_IN_PROGRESS = fromString("BadRequestExportAlreadyInProgress"); + + /** Static value BadRequestPredictionIdsMissing for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_PREDICTION_IDS_MISSING = fromString("BadRequestPredictionIdsMissing"); + + /** Static value BadRequestPredictionIdsExceededCount for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_PREDICTION_IDS_EXCEEDED_COUNT = fromString("BadRequestPredictionIdsExceededCount"); + + /** Static value BadRequestPredictionTagsExceededCount for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_PREDICTION_TAGS_EXCEEDED_COUNT = fromString("BadRequestPredictionTagsExceededCount"); + + /** Static value BadRequestPredictionResultsExceededCount for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_PREDICTION_RESULTS_EXCEEDED_COUNT = fromString("BadRequestPredictionResultsExceededCount"); + + /** Static value BadRequestPredictionInvalidApplicationName for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_PREDICTION_INVALID_APPLICATION_NAME = fromString("BadRequestPredictionInvalidApplicationName"); + + /** Static value BadRequestPredictionInvalidQueryParameters for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_PREDICTION_INVALID_QUERY_PARAMETERS = fromString("BadRequestPredictionInvalidQueryParameters"); + + /** Static value BadRequestInvalid for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_INVALID = fromString("BadRequestInvalid"); + + /** Static value UnsupportedMediaType for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes UNSUPPORTED_MEDIA_TYPE = fromString("UnsupportedMediaType"); + + /** Static value Forbidden for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes FORBIDDEN = fromString("Forbidden"); + + /** Static value ForbiddenUser for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes FORBIDDEN_USER = fromString("ForbiddenUser"); + + /** Static value ForbiddenUserResource for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes FORBIDDEN_USER_RESOURCE = fromString("ForbiddenUserResource"); + + /** Static value ForbiddenUserSignupDisabled for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes FORBIDDEN_USER_SIGNUP_DISABLED = fromString("ForbiddenUserSignupDisabled"); + + /** Static value ForbiddenUserSignupAllowanceExceeded for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes FORBIDDEN_USER_SIGNUP_ALLOWANCE_EXCEEDED = fromString("ForbiddenUserSignupAllowanceExceeded"); + + /** Static value ForbiddenUserDoesNotExist for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes FORBIDDEN_USER_DOES_NOT_EXIST = fromString("ForbiddenUserDoesNotExist"); + + /** Static value ForbiddenUserDisabled for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes FORBIDDEN_USER_DISABLED = fromString("ForbiddenUserDisabled"); + + /** Static value ForbiddenUserInsufficientCapability for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes FORBIDDEN_USER_INSUFFICIENT_CAPABILITY = fromString("ForbiddenUserInsufficientCapability"); + + /** Static value ForbiddenDRModeEnabled for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes FORBIDDEN_DRMODE_ENABLED = fromString("ForbiddenDRModeEnabled"); + + /** Static value ForbiddenInvalid for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes FORBIDDEN_INVALID = fromString("ForbiddenInvalid"); + + /** Static value NotFound for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes NOT_FOUND = fromString("NotFound"); + + /** Static value NotFoundProject for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes NOT_FOUND_PROJECT = fromString("NotFoundProject"); + + /** Static value NotFoundProjectDefaultIteration for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes NOT_FOUND_PROJECT_DEFAULT_ITERATION = fromString("NotFoundProjectDefaultIteration"); + + /** Static value NotFoundIteration for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes NOT_FOUND_ITERATION = fromString("NotFoundIteration"); + + /** Static value NotFoundIterationPerformance for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes NOT_FOUND_ITERATION_PERFORMANCE = fromString("NotFoundIterationPerformance"); + + /** Static value NotFoundTag for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes NOT_FOUND_TAG = fromString("NotFoundTag"); + + /** Static value NotFoundImage for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes NOT_FOUND_IMAGE = fromString("NotFoundImage"); + + /** Static value NotFoundDomain for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes NOT_FOUND_DOMAIN = fromString("NotFoundDomain"); + + /** Static value NotFoundApimSubscription for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes NOT_FOUND_APIM_SUBSCRIPTION = fromString("NotFoundApimSubscription"); + + /** Static value NotFoundInvalid for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes NOT_FOUND_INVALID = fromString("NotFoundInvalid"); + + /** Static value Conflict for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes CONFLICT = fromString("Conflict"); + + /** Static value ConflictInvalid for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes CONFLICT_INVALID = fromString("ConflictInvalid"); + + /** Static value ErrorUnknown for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_UNKNOWN = fromString("ErrorUnknown"); + + /** Static value ErrorProjectInvalidWorkspace for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_PROJECT_INVALID_WORKSPACE = fromString("ErrorProjectInvalidWorkspace"); + + /** Static value ErrorProjectInvalidPipelineConfiguration for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_PROJECT_INVALID_PIPELINE_CONFIGURATION = fromString("ErrorProjectInvalidPipelineConfiguration"); + + /** Static value ErrorProjectInvalidDomain for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_PROJECT_INVALID_DOMAIN = fromString("ErrorProjectInvalidDomain"); + + /** Static value ErrorProjectTrainingRequestFailed for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_PROJECT_TRAINING_REQUEST_FAILED = fromString("ErrorProjectTrainingRequestFailed"); + + /** Static value ErrorProjectExportRequestFailed for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_PROJECT_EXPORT_REQUEST_FAILED = fromString("ErrorProjectExportRequestFailed"); + + /** Static value ErrorFeaturizationServiceUnavailable for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_FEATURIZATION_SERVICE_UNAVAILABLE = fromString("ErrorFeaturizationServiceUnavailable"); + + /** Static value ErrorFeaturizationQueueTimeout for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_FEATURIZATION_QUEUE_TIMEOUT = fromString("ErrorFeaturizationQueueTimeout"); + + /** Static value ErrorFeaturizationInvalidFeaturizer for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_FEATURIZATION_INVALID_FEATURIZER = fromString("ErrorFeaturizationInvalidFeaturizer"); + + /** Static value ErrorFeaturizationAugmentationUnavailable for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_FEATURIZATION_AUGMENTATION_UNAVAILABLE = fromString("ErrorFeaturizationAugmentationUnavailable"); + + /** Static value ErrorFeaturizationUnrecognizedJob for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_FEATURIZATION_UNRECOGNIZED_JOB = fromString("ErrorFeaturizationUnrecognizedJob"); + + /** Static value ErrorFeaturizationAugmentationError for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_FEATURIZATION_AUGMENTATION_ERROR = fromString("ErrorFeaturizationAugmentationError"); + + /** Static value ErrorExporterInvalidPlatform for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_EXPORTER_INVALID_PLATFORM = fromString("ErrorExporterInvalidPlatform"); + + /** Static value ErrorExporterInvalidFeaturizer for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_EXPORTER_INVALID_FEATURIZER = fromString("ErrorExporterInvalidFeaturizer"); + + /** Static value ErrorExporterInvalidClassifier for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_EXPORTER_INVALID_CLASSIFIER = fromString("ErrorExporterInvalidClassifier"); + + /** Static value ErrorPredictionServiceUnavailable for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_PREDICTION_SERVICE_UNAVAILABLE = fromString("ErrorPredictionServiceUnavailable"); + + /** Static value ErrorPredictionModelNotFound for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_PREDICTION_MODEL_NOT_FOUND = fromString("ErrorPredictionModelNotFound"); + + /** Static value ErrorPredictionModelNotCached for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_PREDICTION_MODEL_NOT_CACHED = fromString("ErrorPredictionModelNotCached"); + + /** Static value ErrorPrediction for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_PREDICTION = fromString("ErrorPrediction"); + + /** Static value ErrorPredictionStorage for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_PREDICTION_STORAGE = fromString("ErrorPredictionStorage"); + + /** Static value ErrorRegionProposal for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_REGION_PROPOSAL = fromString("ErrorRegionProposal"); + + /** Static value ErrorInvalid for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_INVALID = fromString("ErrorInvalid"); + + /** + * Creates or finds a CustomVisionErrorCodes from its string representation. + * @param name a name to look for + * @return the corresponding CustomVisionErrorCodes + */ + @JsonCreator + public static CustomVisionErrorCodes fromString(String name) { + return fromString(name, CustomVisionErrorCodes.class); + } + + /** + * @return known CustomVisionErrorCodes values + */ + public static Collection values() { + return values(CustomVisionErrorCodes.class); + } +} diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/CustomVisionErrorException.java b/sdk/cognitiveservices/ms-azure-cs-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/sdk/cognitiveservices/ms-azure-cs-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/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/DetectImageOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/DetectImageOptionalParameter.java new file mode 100644 index 000000000000..d15dc04fcb34 --- /dev/null +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/DetectImageOptionalParameter.java @@ -0,0 +1,66 @@ +/** + * 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; + + +/** + * The DetectImageOptionalParameter model. + */ +public class DetectImageOptionalParameter { + /** + * Optional. Specifies the name of application using the endpoint. + */ + private String application; + + /** + * Gets or sets the preferred language for the response. + */ + private String thisclientacceptLanguage; + + /** + * Get the application value. + * + * @return the application value + */ + public String application() { + return this.application; + } + + /** + * Set the application value. + * + * @param application the application value to set + * @return the DetectImageOptionalParameter object itself. + */ + public DetectImageOptionalParameter withApplication(String application) { + this.application = application; + return this; + } + + /** + * Get the thisclientacceptLanguage value. + * + * @return the thisclientacceptLanguage value + */ + public String thisclientacceptLanguage() { + return this.thisclientacceptLanguage; + } + + /** + * Set the thisclientacceptLanguage value. + * + * @param thisclientacceptLanguage the thisclientacceptLanguage value to set + * @return the DetectImageOptionalParameter object itself. + */ + public DetectImageOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/DetectImageUrlOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/DetectImageUrlOptionalParameter.java new file mode 100644 index 000000000000..1a8e114ed794 --- /dev/null +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/DetectImageUrlOptionalParameter.java @@ -0,0 +1,66 @@ +/** + * 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; + + +/** + * The DetectImageUrlOptionalParameter model. + */ +public class DetectImageUrlOptionalParameter { + /** + * Optional. Specifies the name of application using the endpoint. + */ + private String application; + + /** + * Gets or sets the preferred language for the response. + */ + private String thisclientacceptLanguage; + + /** + * Get the application value. + * + * @return the application value + */ + public String application() { + return this.application; + } + + /** + * Set the application value. + * + * @param application the application value to set + * @return the DetectImageUrlOptionalParameter object itself. + */ + public DetectImageUrlOptionalParameter withApplication(String application) { + this.application = application; + return this; + } + + /** + * Get the thisclientacceptLanguage value. + * + * @return the thisclientacceptLanguage value + */ + public String thisclientacceptLanguage() { + return this.thisclientacceptLanguage; + } + + /** + * Set the thisclientacceptLanguage value. + * + * @param thisclientacceptLanguage the thisclientacceptLanguage value to set + * @return the DetectImageUrlOptionalParameter object itself. + */ + public DetectImageUrlOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/DetectImageUrlWithNoStoreOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/DetectImageUrlWithNoStoreOptionalParameter.java new file mode 100644 index 000000000000..32dccff93851 --- /dev/null +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/DetectImageUrlWithNoStoreOptionalParameter.java @@ -0,0 +1,66 @@ +/** + * 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; + + +/** + * The DetectImageUrlWithNoStoreOptionalParameter model. + */ +public class DetectImageUrlWithNoStoreOptionalParameter { + /** + * Optional. Specifies the name of application using the endpoint. + */ + private String application; + + /** + * Gets or sets the preferred language for the response. + */ + private String thisclientacceptLanguage; + + /** + * Get the application value. + * + * @return the application value + */ + public String application() { + return this.application; + } + + /** + * Set the application value. + * + * @param application the application value to set + * @return the DetectImageUrlWithNoStoreOptionalParameter object itself. + */ + public DetectImageUrlWithNoStoreOptionalParameter withApplication(String application) { + this.application = application; + return this; + } + + /** + * Get the thisclientacceptLanguage value. + * + * @return the thisclientacceptLanguage value + */ + public String thisclientacceptLanguage() { + return this.thisclientacceptLanguage; + } + + /** + * Set the thisclientacceptLanguage value. + * + * @param thisclientacceptLanguage the thisclientacceptLanguage value to set + * @return the DetectImageUrlWithNoStoreOptionalParameter object itself. + */ + public DetectImageUrlWithNoStoreOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/DetectImageWithNoStoreOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/DetectImageWithNoStoreOptionalParameter.java new file mode 100644 index 000000000000..5ef5ce2657ff --- /dev/null +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/DetectImageWithNoStoreOptionalParameter.java @@ -0,0 +1,66 @@ +/** + * 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; + + +/** + * The DetectImageWithNoStoreOptionalParameter model. + */ +public class DetectImageWithNoStoreOptionalParameter { + /** + * Optional. Specifies the name of application using the endpoint. + */ + private String application; + + /** + * Gets or sets the preferred language for the response. + */ + private String thisclientacceptLanguage; + + /** + * Get the application value. + * + * @return the application value + */ + public String application() { + return this.application; + } + + /** + * Set the application value. + * + * @param application the application value to set + * @return the DetectImageWithNoStoreOptionalParameter object itself. + */ + public DetectImageWithNoStoreOptionalParameter withApplication(String application) { + this.application = application; + return this; + } + + /** + * Get the thisclientacceptLanguage value. + * + * @return the thisclientacceptLanguage value + */ + public String thisclientacceptLanguage() { + return this.thisclientacceptLanguage; + } + + /** + * Set the thisclientacceptLanguage value. + * + * @param thisclientacceptLanguage the thisclientacceptLanguage value to set + * @return the DetectImageWithNoStoreOptionalParameter object itself. + */ + public DetectImageWithNoStoreOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/PredictImageUrlOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/PredictImageUrlOptionalParameter.java deleted file mode 100644 index f43803123183..000000000000 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/PredictImageUrlOptionalParameter.java +++ /dev/null @@ -1,119 +0,0 @@ -/** - * 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 java.util.UUID; - -/** - * The PredictImageUrlOptionalParameter model. - */ -public class PredictImageUrlOptionalParameter { - /** - * Optional. Specifies the id of a particular iteration to evaluate - * against. - * The default iteration for the project will be used when not specified. - */ - private UUID iterationId; - - /** - * Optional. Specifies the name of application using the endpoint. - */ - private String application; - - /** - * The url property. - */ - private String url; - - /** - * Gets or sets the preferred language for the response. - */ - private String thisclientacceptLanguage; - - /** - * Get the iterationId value. - * - * @return the iterationId value - */ - public UUID iterationId() { - return this.iterationId; - } - - /** - * Set the iterationId value. - * - * @param iterationId the iterationId value to set - * @return the PredictImageUrlOptionalParameter object itself. - */ - public PredictImageUrlOptionalParameter withIterationId(UUID iterationId) { - this.iterationId = iterationId; - return this; - } - - /** - * Get the application value. - * - * @return the application value - */ - public String application() { - return this.application; - } - - /** - * Set the application value. - * - * @param application the application value to set - * @return the PredictImageUrlOptionalParameter object itself. - */ - public PredictImageUrlOptionalParameter withApplication(String application) { - this.application = application; - return this; - } - - /** - * Get the url value. - * - * @return the url value - */ - public String url() { - return this.url; - } - - /** - * Set the url value. - * - * @param url the url value to set - * @return the PredictImageUrlOptionalParameter object itself. - */ - public PredictImageUrlOptionalParameter withUrl(String url) { - this.url = url; - return this; - } - - /** - * Get the thisclientacceptLanguage value. - * - * @return the thisclientacceptLanguage value - */ - public String thisclientacceptLanguage() { - return this.thisclientacceptLanguage; - } - - /** - * Set the thisclientacceptLanguage value. - * - * @param thisclientacceptLanguage the thisclientacceptLanguage value to set - * @return the PredictImageUrlOptionalParameter object itself. - */ - public PredictImageUrlOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { - this.thisclientacceptLanguage = thisclientacceptLanguage; - return this; - } - -} diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/PredictImageUrlWithNoStoreOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/PredictImageUrlWithNoStoreOptionalParameter.java deleted file mode 100644 index 9a9bf26f8407..000000000000 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/PredictImageUrlWithNoStoreOptionalParameter.java +++ /dev/null @@ -1,119 +0,0 @@ -/** - * 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 java.util.UUID; - -/** - * The PredictImageUrlWithNoStoreOptionalParameter model. - */ -public class PredictImageUrlWithNoStoreOptionalParameter { - /** - * Optional. Specifies the id of a particular iteration to evaluate - * against. - * The default iteration for the project will be used when not specified. - */ - private UUID iterationId; - - /** - * Optional. Specifies the name of application using the endpoint. - */ - private String application; - - /** - * The url property. - */ - private String url; - - /** - * Gets or sets the preferred language for the response. - */ - private String thisclientacceptLanguage; - - /** - * Get the iterationId value. - * - * @return the iterationId value - */ - public UUID iterationId() { - return this.iterationId; - } - - /** - * Set the iterationId value. - * - * @param iterationId the iterationId value to set - * @return the PredictImageUrlWithNoStoreOptionalParameter object itself. - */ - public PredictImageUrlWithNoStoreOptionalParameter withIterationId(UUID iterationId) { - this.iterationId = iterationId; - return this; - } - - /** - * Get the application value. - * - * @return the application value - */ - public String application() { - return this.application; - } - - /** - * Set the application value. - * - * @param application the application value to set - * @return the PredictImageUrlWithNoStoreOptionalParameter object itself. - */ - public PredictImageUrlWithNoStoreOptionalParameter withApplication(String application) { - this.application = application; - return this; - } - - /** - * Get the url value. - * - * @return the url value - */ - public String url() { - return this.url; - } - - /** - * Set the url value. - * - * @param url the url value to set - * @return the PredictImageUrlWithNoStoreOptionalParameter object itself. - */ - public PredictImageUrlWithNoStoreOptionalParameter withUrl(String url) { - this.url = url; - return this; - } - - /** - * Get the thisclientacceptLanguage value. - * - * @return the thisclientacceptLanguage value - */ - public String thisclientacceptLanguage() { - return this.thisclientacceptLanguage; - } - - /** - * Set the thisclientacceptLanguage value. - * - * @param thisclientacceptLanguage the thisclientacceptLanguage value to set - * @return the PredictImageUrlWithNoStoreOptionalParameter object itself. - */ - public PredictImageUrlWithNoStoreOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { - this.thisclientacceptLanguage = thisclientacceptLanguage; - return this; - } - -} diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/pom.xml b/sdk/cognitiveservices/ms-azure-cs-customvision-training/pom.xml index 48dfa47e0712..215fa1de5555 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/pom.xml +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/pom.xml @@ -14,7 +14,7 @@ ../../../pom.data.xml azure-cognitiveservices-customvision-training - 1.1.0-preview.1 + 1.1.0-preview.2 jar Microsoft Azure SDK for Cognitive Service Custom Vision Training This package contains Microsoft Cognitive Service Custom Vision Training SDK. @@ -88,4 +88,4 @@ - \ No newline at end of file + diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/TrainingApi.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/CustomVisionTrainingClient.java similarity index 74% rename from sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/TrainingApi.java rename to sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/CustomVisionTrainingClient.java index 9e411daf1695..8471c0482dde 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/TrainingApi.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/CustomVisionTrainingClient.java @@ -12,9 +12,9 @@ import com.microsoft.rest.RestClient; /** - * The interface for TrainingApi class. + * The interface for CustomVisionTrainingClient class. */ -public interface TrainingApi { +public interface CustomVisionTrainingClient { /** * Gets the REST client. * @@ -36,19 +36,34 @@ public interface TrainingApi { String userAgent(); /** - * Gets . + * Gets API key.. * * @return the apiKey value. */ String apiKey(); /** - * Sets . + * Sets API key.. * * @param apiKey the apiKey value. * @return the service client itself */ - TrainingApi withApiKey(String apiKey); + 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 Gets or sets the preferred language for the response.. @@ -63,7 +78,7 @@ public interface TrainingApi { * @param acceptLanguage the acceptLanguage value. * @return the service client itself */ - TrainingApi withAcceptLanguage(String acceptLanguage); + CustomVisionTrainingClient withAcceptLanguage(String acceptLanguage); /** * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. @@ -78,7 +93,7 @@ public interface TrainingApi { * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. * @return the service client itself */ - TrainingApi withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout); + CustomVisionTrainingClient withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout); /** * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. @@ -93,7 +108,7 @@ public interface TrainingApi { * @param generateClientRequestId the generateClientRequestId value. * @return the service client itself */ - TrainingApi withGenerateClientRequestId(boolean generateClientRequestId); + CustomVisionTrainingClient withGenerateClientRequestId(boolean generateClientRequestId); /** * Gets the Trainings object to access its operations. diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/CustomVisionTrainingManager.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/CustomVisionTrainingManager.java index 89b9f5daca58..c641c165b8e8 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/CustomVisionTrainingManager.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/CustomVisionTrainingManager.java @@ -6,7 +6,7 @@ package com.microsoft.azure.cognitiveservices.vision.customvision.training; -import com.microsoft.azure.cognitiveservices.vision.customvision.training.implementation.TrainingApiImpl; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.implementation.CustomVisionTrainingClientImpl; import com.microsoft.rest.RestClient; import com.microsoft.rest.credentials.ServiceClientCredentials; import okhttp3.OkHttpClient; @@ -21,7 +21,7 @@ public class CustomVisionTrainingManager { * @param apiKey the Custom Vision Training API key * @return the Computer Vision Training API client */ - public static TrainingApi authenticate(String apiKey) { + public static CustomVisionTrainingClient authenticate(String apiKey) { return authenticate("https://southcentralus.api.cognitive.microsoft.com/customvision/v2.1/Training/", apiKey); } @@ -32,7 +32,7 @@ public static TrainingApi authenticate(String apiKey) { * @param apiKey the Custom Vision Training API key * @return the Custom Vision Training API client */ - public static TrainingApi authenticate(String baseUrl, final String apiKey) { + public static CustomVisionTrainingClient authenticate(String baseUrl, final String apiKey) { ServiceClientCredentials serviceClientCredentials = new ServiceClientCredentials() { @Override public void applyCredentialsFilter(OkHttpClient.Builder builder) { @@ -48,7 +48,7 @@ public void applyCredentialsFilter(OkHttpClient.Builder builder) { * @param apiKey the Custom Vision Training API key * @return the Computer Vision Training API client */ - public static TrainingApi authenticate(ServiceClientCredentials credentials, final String apiKey) { + public static CustomVisionTrainingClient authenticate(ServiceClientCredentials credentials, final String apiKey) { return authenticate("https://southcentralus.api.cognitive.microsoft.com/customvision/v2.1/Training/", credentials, apiKey); } @@ -60,8 +60,8 @@ public static TrainingApi authenticate(ServiceClientCredentials credentials, fin * @param apiKey the Custom Vision Training API key * @return the Custom Vision Training API client */ - public static TrainingApi authenticate(String baseUrl, ServiceClientCredentials credentials, final String apiKey) { - return new TrainingApiImpl(baseUrl, credentials).withApiKey(apiKey); + public static CustomVisionTrainingClient authenticate(String baseUrl, ServiceClientCredentials credentials, final String apiKey) { + return new CustomVisionTrainingClientImpl(baseUrl, credentials).withApiKey(apiKey); } /** @@ -71,7 +71,7 @@ public static TrainingApi authenticate(String baseUrl, ServiceClientCredentials * @param apiKey the Custom Vision Training API key * @return the Custom Vision Training API client */ - public static TrainingApi authenticate(RestClient restClient, final String apiKey) { - return new TrainingApiImpl(restClient).withApiKey(apiKey); + public static CustomVisionTrainingClient authenticate(RestClient restClient, final String apiKey) { + return new CustomVisionTrainingClientImpl(restClient).withApiKey(apiKey); } } diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/Trainings.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/Trainings.java index 0e05ac114c5a..820b347f01fe 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/Trainings.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/Trainings.java @@ -8,27 +8,25 @@ package com.microsoft.azure.cognitiveservices.vision.customvision.training; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.CreateImageRegionsOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.CreateImageTagsOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.CreateImagesFromDataOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.CreateProjectOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.CreateTagOptionalParameter; -import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.GetTagsOptionalParameter; -import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.GetTagOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.CustomVisionErrorException; +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.ExportIterationOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.GetImagePerformanceCountOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.GetImagePerformancesOptionalParameter; -import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.GetIterationPerformanceOptionalParameter; -import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.CreateProjectOptionalParameter; -import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.QuickTestImageOptionalParameter; -import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.QuickTestImageUrlOptionalParameter; -import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.CreateImageRegionsOptionalParameter; -import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.CreateImageTagsOptionalParameter; -import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.CreateImagesFromDataOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.GetImagesByIdsOptionalParameter; -import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.GetUntaggedImageCountOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.GetIterationPerformanceOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.GetTagOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.GetTaggedImageCountOptionalParameter; -import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.GetUntaggedImagesOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.GetTaggedImagesOptionalParameter; -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.GetTagsOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.GetUntaggedImageCountOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.GetUntaggedImagesOptionalParameter; 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; @@ -46,10 +44,14 @@ 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.QuickTestImageOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.QuickTestImageUrlOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.Tag; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.TrainProjectOptionalParameter; +import rx.Observable; + import java.util.List; import java.util.UUID; -import rx.Observable; /** * An instance of this class provides access to all the operations defined @@ -63,11 +65,10 @@ public interface Trainings { * @param name The tag name. * @param createTagOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 Tag object if successful. */ - @Deprecated Tag createTag(UUID projectId, String name, CreateTagOptionalParameter createTagOptionalParameter); /** @@ -79,7 +80,6 @@ public interface Trainings { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the Tag object */ - @Deprecated Observable createTagAsync(UUID projectId, String name, CreateTagOptionalParameter createTagOptionalParameter); /** @@ -127,6 +127,13 @@ interface WithAllOptions { */ TrainingsCreateTagDefinitionStages.WithExecute withDescription(String description); + /** + * Optional type for the tag. Possible values include: 'Regular', 'Negative'. + * + * @return next definition stage + */ + TrainingsCreateTagDefinitionStages.WithExecute withType(String type); + } /** @@ -164,11 +171,10 @@ interface TrainingsCreateTagDefinition extends * @param projectId The project id. * @param getTagsOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 List<Tag> object if successful. */ - @Deprecated List getTags(UUID projectId, GetTagsOptionalParameter getTagsOptionalParameter); /** @@ -179,7 +185,6 @@ interface TrainingsCreateTagDefinition extends * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<Tag> object */ - @Deprecated Observable> getTagsAsync(UUID projectId, GetTagsOptionalParameter getTagsOptionalParameter); /** @@ -254,7 +259,7 @@ interface TrainingsGetTagsDefinition extends * @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 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 Tag object if successful. */ @@ -279,7 +284,7 @@ interface TrainingsGetTagsDefinition extends * @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 CustomVisionErrorException 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); @@ -302,11 +307,10 @@ interface TrainingsGetTagsDefinition extends * @param tagId The tag id. * @param getTagOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 Tag object if successful. */ - @Deprecated Tag getTag(UUID projectId, UUID tagId, GetTagOptionalParameter getTagOptionalParameter); /** @@ -318,7 +322,6 @@ interface TrainingsGetTagsDefinition extends * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the Tag object */ - @Deprecated Observable getTagAsync(UUID projectId, UUID tagId, GetTagOptionalParameter getTagOptionalParameter); /** @@ -402,15 +405,13 @@ interface TrainingsGetTagDefinition extends * * @param projectId The project id. * @param iterationId The iteration id. - * @param platform The target platform (coreml or tensorflow). Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', - * 'ONNX'. + * @param platform The target platform. Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX', 'VAIDK'. * @param exportIterationOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 Export object if successful. */ - @Deprecated Export exportIteration(UUID projectId, UUID iterationId, String platform, ExportIterationOptionalParameter exportIterationOptionalParameter); /** @@ -418,13 +419,11 @@ interface TrainingsGetTagDefinition extends * * @param projectId The project id. * @param iterationId The iteration id. - * @param platform The target platform (coreml or tensorflow). Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', - * 'ONNX'. + * @param platform The target platform. Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX', 'VAIDK'. * @param exportIterationOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the Export object */ - @Deprecated Observable exportIterationAsync(UUID projectId, UUID iterationId, String platform, ExportIterationOptionalParameter exportIterationOptionalParameter); /** @@ -465,8 +464,7 @@ interface WithIterationId { */ interface WithPlatform { /** - * The target platform (coreml or tensorflow). Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', - * 'ONNX'. + * The target platform. Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX', 'VAIDK'. * * @return next definition stage */ @@ -478,8 +476,7 @@ interface WithPlatform { */ interface WithAllOptions { /** - * The flavor of the target platform (Windows, Linux, ARM, or GPU). Possible values include: 'Linux', - * 'Windows'. + * The flavor of the target platform. Possible values include: 'Linux', 'Windows', 'ONNX10', 'ONNX12', 'ARM'. * * @return next definition stage */ @@ -524,7 +521,7 @@ interface TrainingsExportIterationDefinition extends * @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 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 List<Export> object if successful. */ @@ -541,52 +538,185 @@ interface TrainingsExportIterationDefinition extends Observable> getExportsAsync(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. + * Unpublish a specific iteration. * * @param projectId The project id. - * @param iterationId The iteration id. Defaults to workspace. - * @param getImagePerformanceCountOptionalParameter the object representing the optional parameters to be set before calling this API + * @param iterationId The iteration id. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 int object if successful. */ - @Deprecated - int getImagePerformanceCount(UUID projectId, UUID iterationId, GetImagePerformanceCountOptionalParameter getImagePerformanceCountOptionalParameter); + void unpublishIteration(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. + * Unpublish a specific iteration. * * @param projectId The project id. - * @param iterationId The iteration id. Defaults to workspace. - * @param getImagePerformanceCountOptionalParameter the object representing the optional parameters to be set before calling this API + * @param iterationId The iteration id. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the int object + * @return a representation of the deferred computation of this call if successful. */ - @Deprecated - Observable getImagePerformanceCountAsync(UUID projectId, UUID iterationId, GetImagePerformanceCountOptionalParameter getImagePerformanceCountOptionalParameter); + Observable unpublishIterationAsync(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. + * Publish a specific iteration. * - * @return the first stage of the getImagePerformanceCount call + * @param projectId The project id. + * @param iterationId The iteration id. + * @param publishName The name to give the published iteration. + * @param predictionId The id of the prediction resource to publish to. + * @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 boolean object if successful. */ - TrainingsGetImagePerformanceCountDefinitionStages.WithProjectId getImagePerformanceCount(); + boolean publishIteration(UUID projectId, UUID iterationId, String publishName, String predictionId); /** - * Grouping of getImagePerformanceCount definition stages. + * Publish a specific iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @param publishName The name to give the published iteration. + * @param predictionId The id of the prediction resource to publish to. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the boolean object */ - interface TrainingsGetImagePerformanceCountDefinitionStages { + Observable publishIterationAsync(UUID projectId, UUID iterationId, String publishName, String predictionId); + + + + /** + * Update a specific iteration. + * + * @param projectId Project id. + * @param iterationId Iteration id. + * @param name Gets or sets the name of the iteration. + * @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 Iteration object if successful. + */ + Iteration updateIteration(UUID projectId, UUID iterationId, String name); + + /** + * Update a specific iteration. + * + * @param projectId Project id. + * @param iterationId Iteration id. + * @param name Gets or sets the name of the iteration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Iteration object + */ + Observable updateIterationAsync(UUID projectId, UUID iterationId, String name); + + + + /** + * 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 CustomVisionErrorException 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return a representation of the deferred computation of this call if successful. + */ + Observable deleteIterationAsync(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 + * @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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Iteration object + */ + Observable getIterationAsync(UUID projectId, UUID iterationId); + + + + /** + * Get iterations for the project. + * + * @param projectId The project id. + * @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 List<Iteration> object if successful. + */ + List getIterations(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> getIterationsAsync(UUID projectId); + + + /** + * Queues project for training. + * + * @param projectId The project id. + * @param trainProjectOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 Iteration object if successful. + */ + Iteration trainProject(UUID projectId, TrainProjectOptionalParameter trainProjectOptionalParameter); + + /** + * Queues project for training. + * + * @param projectId The project id. + * @param trainProjectOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Iteration object + */ + Observable trainProjectAsync(UUID projectId, TrainProjectOptionalParameter trainProjectOptionalParameter); + + /** + * Queues project for training. + * + * @return the first stage of the trainProject call + */ + TrainingsTrainProjectDefinitionStages.WithProjectId trainProject(); + + /** + * Grouping of trainProject definition stages. + */ + interface TrainingsTrainProjectDefinitionStages { /** * The stage of the definition to be specify projectId. */ @@ -596,135 +726,182 @@ interface WithProjectId { * * @return next definition stage */ - WithIterationId withProjectId(UUID projectId); + TrainingsTrainProjectDefinitionStages.WithExecute withProjectId(UUID projectId); } + /** - * The stage of the definition to be specify iterationId. + * The stage of the definition which allows for any other optional settings to be specified. */ - interface WithIterationId { + interface WithAllOptions { /** - * The iteration id. Defaults to workspace. + * The type of training to use to train the project (default: Regular). Possible values include: 'Regular', + * 'Advanced'. * * @return next definition stage */ - TrainingsGetImagePerformanceCountDefinitionStages.WithExecute withIterationId(UUID iterationId); - } + TrainingsTrainProjectDefinitionStages.WithExecute withTrainingType(String trainingType); - /** - * The stage of the definition which allows for any other optional settings to be specified. - */ - interface WithAllOptions { /** - * A list of tags ids to filter the images to count. Defaults to all tags when null. + * The number of hours reserved as budget for training (if applicable). + * + * @return next definition stage + */ + TrainingsTrainProjectDefinitionStages.WithExecute withReservedBudgetInHours(Integer reservedBudgetInHours); + + /** + * Whether to force train even if dataset and configuration does not change (default: false). + * + * @return next definition stage + */ + TrainingsTrainProjectDefinitionStages.WithExecute withForceTrain(Boolean forceTrain); + + /** + * The email address to send notification to when training finishes (default: null). * * @return next definition stage */ - TrainingsGetImagePerformanceCountDefinitionStages.WithExecute withTagIds(List tagIds); + TrainingsTrainProjectDefinitionStages.WithExecute withNotificationEmailAddress(String notificationEmailAddress); } /** * The last stage of the definition which will make the operation call. */ - interface WithExecute extends TrainingsGetImagePerformanceCountDefinitionStages.WithAllOptions { + interface WithExecute extends TrainingsTrainProjectDefinitionStages.WithAllOptions { /** * Execute the request. * - * @return the int object if successful. + * @return the Iteration object if successful. */ - int execute(); + Iteration execute(); /** * Execute the request asynchronously. * - * @return the observable to the int object + * @return the observable to the Iteration object */ - Observable executeAsync(); + Observable executeAsync(); } } /** - * The entirety of getImagePerformanceCount definition. + * The entirety of trainProject definition. */ - interface TrainingsGetImagePerformanceCountDefinition extends - TrainingsGetImagePerformanceCountDefinitionStages.WithProjectId, - TrainingsGetImagePerformanceCountDefinitionStages.WithIterationId, - TrainingsGetImagePerformanceCountDefinitionStages.WithExecute { + interface TrainingsTrainProjectDefinition extends + TrainingsTrainProjectDefinitionStages.WithProjectId, + TrainingsTrainProjectDefinitionStages.WithExecute { } + /** - * 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. + * Update a specific project. * - * @param projectId The project id. - * @param iterationId The iteration id. Defaults to workspace. - * @param getImagePerformancesOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 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 List<ImagePerformance> object if successful. + * @return the Project object if successful. */ - @Deprecated - List getImagePerformances(UUID projectId, UUID iterationId, GetImagePerformancesOptionalParameter getImagePerformancesOptionalParameter); + Project updateProject(UUID projectId, Project updatedProject); /** - * 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. + * Update a specific project. * - * @param projectId The project id. - * @param iterationId The iteration id. Defaults to workspace. - * @param getImagePerformancesOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 List<ImagePerformance> object + * @return the observable to the Project object */ - @Deprecated - Observable> getImagePerformancesAsync(UUID projectId, UUID iterationId, GetImagePerformancesOptionalParameter getImagePerformancesOptionalParameter); + Observable updateProjectAsync(UUID projectId, Project updatedProject); + + /** - * 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. + * Delete a specific project. * - * @return the first stage of the getImagePerformances call + * @param projectId The project id. + * @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 */ - TrainingsGetImagePerformancesDefinitionStages.WithProjectId getImagePerformances(); + void deleteProject(UUID projectId); /** - * Grouping of getImagePerformances definition stages. + * Delete a specific project. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return a representation of the deferred computation of this call if successful. */ - interface TrainingsGetImagePerformancesDefinitionStages { - /** - * The stage of the definition to be specify projectId. - */ - interface WithProjectId { - /** - * The project id. - * - * @return next definition stage - */ - WithIterationId withProjectId(UUID projectId); - } + Observable deleteProjectAsync(UUID projectId); + + + + /** + * Get a specific project. + * + * @param projectId The id of the project to get. + * @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 Project object if successful. + */ + Project getProject(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 getProjectAsync(UUID projectId); + + + /** + * Create a project. + * + * @param name Name of the project. + * @param createProjectOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 Project object if successful. + */ + Project createProject(String name, CreateProjectOptionalParameter createProjectOptionalParameter); + + /** + * Create a project. + * + * @param name Name of the project. + * @param createProjectOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Project object + */ + Observable createProjectAsync(String name, CreateProjectOptionalParameter createProjectOptionalParameter); + + /** + * Create a project. + * + * @return the first stage of the createProject call + */ + TrainingsCreateProjectDefinitionStages.WithName createProject(); + + /** + * Grouping of createProject definition stages. + */ + interface TrainingsCreateProjectDefinitionStages { /** - * The stage of the definition to be specify iterationId. + * The stage of the definition to be specify name. */ - interface WithIterationId { + interface WithName { /** - * The iteration id. Defaults to workspace. + * Name of the project. * * @return next definition stage */ - TrainingsGetImagePerformancesDefinitionStages.WithExecute withIterationId(UUID iterationId); + TrainingsCreateProjectDefinitionStages.WithExecute withName(String name); } /** @@ -732,107 +909,133 @@ interface WithIterationId { */ interface WithAllOptions { /** - * A list of tags ids to filter the images. Defaults to all tagged images when null. Limited to 20. + * The description of the project. * * @return next definition stage */ - TrainingsGetImagePerformancesDefinitionStages.WithExecute withTagIds(List tagIds); + TrainingsCreateProjectDefinitionStages.WithExecute withDescription(String description); /** - * The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest'. + * The id of the domain to use for this project. Defaults to General. * * @return next definition stage */ - TrainingsGetImagePerformancesDefinitionStages.WithExecute withOrderBy(String orderBy); + TrainingsCreateProjectDefinitionStages.WithExecute withDomainId(UUID domainId); /** - * Maximum number of images to return. Defaults to 50, limited to 256. + * The type of classifier to create for this project. Possible values include: 'Multiclass', 'Multilabel'. * * @return next definition stage */ - TrainingsGetImagePerformancesDefinitionStages.WithExecute withTake(Integer take); + TrainingsCreateProjectDefinitionStages.WithExecute withClassificationType(String classificationType); /** - * Number of images to skip before beginning the image batch. Defaults to 0. + * List of platforms the trained model is intending exporting to. * * @return next definition stage */ - TrainingsGetImagePerformancesDefinitionStages.WithExecute withSkip(Integer skip); + TrainingsCreateProjectDefinitionStages.WithExecute withTargetExportPlatforms(List targetExportPlatforms); } /** * The last stage of the definition which will make the operation call. */ - interface WithExecute extends TrainingsGetImagePerformancesDefinitionStages.WithAllOptions { + interface WithExecute extends TrainingsCreateProjectDefinitionStages.WithAllOptions { /** * Execute the request. * - * @return the List<ImagePerformance> object if successful. + * @return the Project object if successful. */ - List execute(); + Project execute(); /** * Execute the request asynchronously. * - * @return the observable to the List<ImagePerformance> object + * @return the observable to the Project object */ - Observable> executeAsync(); + Observable executeAsync(); } } /** - * The entirety of getImagePerformances definition. + * The entirety of createProject definition. */ - interface TrainingsGetImagePerformancesDefinition extends - TrainingsGetImagePerformancesDefinitionStages.WithProjectId, - TrainingsGetImagePerformancesDefinitionStages.WithIterationId, - TrainingsGetImagePerformancesDefinitionStages.WithExecute { + interface TrainingsCreateProjectDefinition extends + TrainingsCreateProjectDefinitionStages.WithName, + TrainingsCreateProjectDefinitionStages.WithExecute { } + /** - * Get detailed performance information about an iteration. + * Get your projects. * - * @param projectId The id of the project the iteration belongs to. - * @param iterationId The id of the iteration to get. - * @param getIterationPerformanceOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 IterationPerformance object if successful. + * @return the List<Project> object if successful. */ - @Deprecated - IterationPerformance getIterationPerformance(UUID projectId, UUID iterationId, GetIterationPerformanceOptionalParameter getIterationPerformanceOptionalParameter); + List getProjects(); /** - * Get detailed performance information about an iteration. + * Get your projects. * - * @param projectId The id of the project the iteration belongs to. - * @param iterationId The id of the iteration to get. - * @param getIterationPerformanceOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the IterationPerformance object + * @return the observable to the List<Project> object */ - @Deprecated - Observable getIterationPerformanceAsync(UUID projectId, UUID iterationId, GetIterationPerformanceOptionalParameter getIterationPerformanceOptionalParameter); + Observable> getProjectsAsync(); + /** - * Get detailed performance information about an iteration. + * 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. * - * @return the first stage of the getIterationPerformance call + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param getImagePerformanceCountOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 int object if successful. */ - TrainingsGetIterationPerformanceDefinitionStages.WithProjectId getIterationPerformance(); + int getImagePerformanceCount(UUID projectId, UUID iterationId, GetImagePerformanceCountOptionalParameter getImagePerformanceCountOptionalParameter); /** - * Grouping of getIterationPerformance definition stages. + * 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 getImagePerformanceCountOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the int object */ - interface TrainingsGetIterationPerformanceDefinitionStages { + Observable getImagePerformanceCountAsync(UUID projectId, UUID iterationId, GetImagePerformanceCountOptionalParameter getImagePerformanceCountOptionalParameter); + + /** + * 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. + * + * @return the first stage of the getImagePerformanceCount call + */ + TrainingsGetImagePerformanceCountDefinitionStages.WithProjectId getImagePerformanceCount(); + + /** + * Grouping of getImagePerformanceCount definition stages. + */ + interface TrainingsGetImagePerformanceCountDefinitionStages { /** * The stage of the definition to be specify projectId. */ interface WithProjectId { /** - * The id of the project the iteration belongs to. + * The project id. * * @return next definition stage */ @@ -843,11 +1046,11 @@ interface WithProjectId { */ interface WithIterationId { /** - * The id of the iteration to get. + * The iteration id. Defaults to workspace. * * @return next definition stage */ - TrainingsGetIterationPerformanceDefinitionStages.WithExecute withIterationId(UUID iterationId); + TrainingsGetImagePerformanceCountDefinitionStages.WithExecute withIterationId(UUID iterationId); } /** @@ -855,380 +1058,332 @@ interface WithIterationId { */ interface WithAllOptions { /** - * The threshold used to determine true predictions. - * - * @return next definition stage - */ - TrainingsGetIterationPerformanceDefinitionStages.WithExecute withThreshold(Double threshold); - - /** - * If applicable, the bounding box overlap threshold used to determine true predictions. + * A list of tags ids to filter the images to count. Defaults to all tags when null. * * @return next definition stage */ - TrainingsGetIterationPerformanceDefinitionStages.WithExecute withOverlapThreshold(Double overlapThreshold); + TrainingsGetImagePerformanceCountDefinitionStages.WithExecute withTagIds(List tagIds); } /** * The last stage of the definition which will make the operation call. */ - interface WithExecute extends TrainingsGetIterationPerformanceDefinitionStages.WithAllOptions { + interface WithExecute extends TrainingsGetImagePerformanceCountDefinitionStages.WithAllOptions { /** * Execute the request. * - * @return the IterationPerformance object if successful. + * @return the int object if successful. */ - IterationPerformance execute(); + int execute(); /** * Execute the request asynchronously. * - * @return the observable to the IterationPerformance object + * @return the observable to the int object */ - Observable executeAsync(); + Observable executeAsync(); } } /** - * The entirety of getIterationPerformance definition. + * The entirety of getImagePerformanceCount definition. */ - interface TrainingsGetIterationPerformanceDefinition extends - TrainingsGetIterationPerformanceDefinitionStages.WithProjectId, - TrainingsGetIterationPerformanceDefinitionStages.WithIterationId, - TrainingsGetIterationPerformanceDefinitionStages.WithExecute { + interface TrainingsGetImagePerformanceCountDefinition extends + TrainingsGetImagePerformanceCountDefinitionStages.WithProjectId, + TrainingsGetImagePerformanceCountDefinitionStages.WithIterationId, + TrainingsGetImagePerformanceCountDefinitionStages.WithExecute { } - /** - * Update a specific iteration. + * 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 Project id. - * @param iterationId Iteration id. - * @param updatedIteration The updated iteration model. + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param getImagePerformancesOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 Iteration object if successful. + * @return the List<ImagePerformance> object if successful. */ - Iteration updateIteration(UUID projectId, UUID iterationId, Iteration updatedIteration); + List getImagePerformances(UUID projectId, UUID iterationId, GetImagePerformancesOptionalParameter getImagePerformancesOptionalParameter); /** - * Update a specific iteration. + * 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 Project id. - * @param iterationId Iteration id. - * @param updatedIteration The updated iteration model. + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param getImagePerformancesOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the Iteration object + * @return the observable to the List<ImagePerformance> object */ - Observable updateIterationAsync(UUID projectId, UUID iterationId, Iteration updatedIteration); - - + Observable> getImagePerformancesAsync(UUID projectId, UUID iterationId, GetImagePerformancesOptionalParameter getImagePerformancesOptionalParameter); /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return a representation of the deferred computation of this call if successful. - */ - Observable deleteIterationAsync(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 - * @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. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the Iteration object - */ - Observable getIterationAsync(UUID projectId, UUID iterationId); - - - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<Iteration> object - */ - Observable> getIterationsAsync(UUID projectId); - - - - /** - * Update a specific project. + * 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 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. + * @return the first stage of the getImagePerformances call */ - Project updateProject(UUID projectId, Project updatedProject); + TrainingsGetImagePerformancesDefinitionStages.WithProjectId getImagePerformances(); /** - * 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 + * Grouping of getImagePerformances definition stages. */ - Observable updateProjectAsync(UUID projectId, Project updatedProject); + interface TrainingsGetImagePerformancesDefinitionStages { + /** + * The stage of the definition to be specify projectId. + */ + interface WithProjectId { + /** + * The project id. + * + * @return next definition stage + */ + WithIterationId withProjectId(UUID projectId); + } + /** + * The stage of the definition to be specify iterationId. + */ + interface WithIterationId { + /** + * The iteration id. Defaults to workspace. + * + * @return next definition stage + */ + TrainingsGetImagePerformancesDefinitionStages.WithExecute withIterationId(UUID iterationId); + } + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + interface WithAllOptions { + /** + * A list of tags ids to filter the images. Defaults to all tagged images when null. Limited to 20. + * + * @return next definition stage + */ + TrainingsGetImagePerformancesDefinitionStages.WithExecute withTagIds(List tagIds); + /** + * The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest'. + * + * @return next definition stage + */ + TrainingsGetImagePerformancesDefinitionStages.WithExecute withOrderBy(String orderBy); - /** - * 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); + /** + * Maximum number of images to return. Defaults to 50, limited to 256. + * + * @return next definition stage + */ + TrainingsGetImagePerformancesDefinitionStages.WithExecute withTake(Integer take); - /** - * Delete a specific project. - * - * @param projectId The project id. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return a representation of the deferred computation of this call if successful. - */ - Observable deleteProjectAsync(UUID projectId); + /** + * Number of images to skip before beginning the image batch. Defaults to 0. + * + * @return next definition stage + */ + TrainingsGetImagePerformancesDefinitionStages.WithExecute withSkip(Integer skip); + } + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends TrainingsGetImagePerformancesDefinitionStages.WithAllOptions { + /** + * Execute the request. + * + * @return the List<ImagePerformance> object if successful. + */ + List execute(); - /** - * 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); + /** + * Execute the request asynchronously. + * + * @return the observable to the List<ImagePerformance> object + */ + Observable> executeAsync(); + } + } /** - * 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 + * The entirety of getImagePerformances definition. */ - Observable getProjectAsync(UUID projectId); - + interface TrainingsGetImagePerformancesDefinition extends + TrainingsGetImagePerformancesDefinitionStages.WithProjectId, + TrainingsGetImagePerformancesDefinitionStages.WithIterationId, + TrainingsGetImagePerformancesDefinitionStages.WithExecute { + } /** - * Create a project. + * Get detailed performance information about an iteration. * - * @param name Name of the project. - * @param createProjectOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The id of the project the iteration belongs to. + * @param iterationId The id of the iteration to get. + * @param getIterationPerformanceOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 Project object if successful. + * @return the IterationPerformance object if successful. */ - @Deprecated - Project createProject(String name, CreateProjectOptionalParameter createProjectOptionalParameter); + IterationPerformance getIterationPerformance(UUID projectId, UUID iterationId, GetIterationPerformanceOptionalParameter getIterationPerformanceOptionalParameter); /** - * Create a project. + * Get detailed performance information about an iteration. * - * @param name Name of the project. - * @param createProjectOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The id of the project the iteration belongs to. + * @param iterationId The id of the iteration to get. + * @param getIterationPerformanceOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the Project object + * @return the observable to the IterationPerformance object */ - @Deprecated - Observable createProjectAsync(String name, CreateProjectOptionalParameter createProjectOptionalParameter); + Observable getIterationPerformanceAsync(UUID projectId, UUID iterationId, GetIterationPerformanceOptionalParameter getIterationPerformanceOptionalParameter); /** - * Create a project. + * Get detailed performance information about an iteration. * - * @return the first stage of the createProject call + * @return the first stage of the getIterationPerformance call */ - TrainingsCreateProjectDefinitionStages.WithName createProject(); + TrainingsGetIterationPerformanceDefinitionStages.WithProjectId getIterationPerformance(); /** - * Grouping of createProject definition stages. + * Grouping of getIterationPerformance definition stages. */ - interface TrainingsCreateProjectDefinitionStages { + interface TrainingsGetIterationPerformanceDefinitionStages { /** - * The stage of the definition to be specify name. + * The stage of the definition to be specify projectId. */ - interface WithName { + interface WithProjectId { /** - * Name of the project. + * The id of the project the iteration belongs to. * * @return next definition stage */ - TrainingsCreateProjectDefinitionStages.WithExecute withName(String name); + WithIterationId withProjectId(UUID projectId); } - /** - * The stage of the definition which allows for any other optional settings to be specified. + * The stage of the definition to be specify iterationId. */ - interface WithAllOptions { + interface WithIterationId { /** - * The description of the project. + * The id of the iteration to get. * * @return next definition stage */ - TrainingsCreateProjectDefinitionStages.WithExecute withDescription(String description); + TrainingsGetIterationPerformanceDefinitionStages.WithExecute withIterationId(UUID iterationId); + } + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + interface WithAllOptions { /** - * The id of the domain to use for this project. Defaults to General. + * The threshold used to determine true predictions. * * @return next definition stage */ - TrainingsCreateProjectDefinitionStages.WithExecute withDomainId(UUID domainId); + TrainingsGetIterationPerformanceDefinitionStages.WithExecute withThreshold(Double threshold); /** - * The type of classifier to create for this project. Possible values include: 'Multiclass', 'Multilabel'. + * If applicable, the bounding box overlap threshold used to determine true predictions. * * @return next definition stage */ - TrainingsCreateProjectDefinitionStages.WithExecute withClassificationType(String classificationType); + TrainingsGetIterationPerformanceDefinitionStages.WithExecute withOverlapThreshold(Double overlapThreshold); } /** * The last stage of the definition which will make the operation call. */ - interface WithExecute extends TrainingsCreateProjectDefinitionStages.WithAllOptions { + interface WithExecute extends TrainingsGetIterationPerformanceDefinitionStages.WithAllOptions { /** * Execute the request. * - * @return the Project object if successful. + * @return the IterationPerformance object if successful. */ - Project execute(); + IterationPerformance execute(); /** * Execute the request asynchronously. * - * @return the observable to the Project object + * @return the observable to the IterationPerformance object */ - Observable executeAsync(); + Observable executeAsync(); } } /** - * The entirety of createProject definition. + * The entirety of getIterationPerformance definition. */ - interface TrainingsCreateProjectDefinition extends - TrainingsCreateProjectDefinitionStages.WithName, - TrainingsCreateProjectDefinitionStages.WithExecute { + interface TrainingsGetIterationPerformanceDefinition extends + TrainingsGetIterationPerformanceDefinitionStages.WithProjectId, + TrainingsGetIterationPerformanceDefinitionStages.WithIterationId, + TrainingsGetIterationPerformanceDefinitionStages.WithExecute { } /** - * 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. - * - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<Project> object - */ - Observable> getProjectsAsync(); - - - - /** - * Queues project for training. + * 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 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 Iteration object if successful. + * @return the PredictionQueryResult object if successful. */ - Iteration trainProject(UUID projectId); + PredictionQueryResult queryPredictions(UUID projectId, PredictionQueryToken query); /** - * Queues project for training. + * 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 Iteration object + * @return the observable to the PredictionQueryResult object */ - Observable trainProjectAsync(UUID projectId); + Observable queryPredictionsAsync(UUID projectId, PredictionQueryToken query); /** * Quick test an image. * * @param projectId The project id. - * @param imageData the InputStream value. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 6MB. * @param quickTestImageOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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. */ - @Deprecated ImagePrediction quickTestImage(UUID projectId, byte[] imageData, QuickTestImageOptionalParameter quickTestImageOptionalParameter); /** * Quick test an image. * * @param projectId The project id. - * @param imageData the InputStream value. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 6MB. * @param quickTestImageOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ImagePrediction object */ - @Deprecated Observable quickTestImageAsync(UUID projectId, byte[] imageData, QuickTestImageOptionalParameter quickTestImageOptionalParameter); /** @@ -1258,7 +1413,7 @@ interface WithProjectId { */ interface WithImageData { /** - * + * Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 6MB. * * @return next definition stage */ @@ -1312,25 +1467,25 @@ interface TrainingsQuickTestImageDefinition extends * Quick test an image url. * * @param projectId The project to evaluate against. + * @param url Url of the image. * @param quickTestImageUrlOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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. */ - @Deprecated - ImagePrediction quickTestImageUrl(UUID projectId, QuickTestImageUrlOptionalParameter quickTestImageUrlOptionalParameter); + ImagePrediction quickTestImageUrl(UUID projectId, String url, QuickTestImageUrlOptionalParameter quickTestImageUrlOptionalParameter); /** * Quick test an image url. * * @param projectId The project to evaluate against. + * @param url Url of the image. * @param quickTestImageUrlOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ImagePrediction object */ - @Deprecated - Observable quickTestImageUrlAsync(UUID projectId, QuickTestImageUrlOptionalParameter quickTestImageUrlOptionalParameter); + Observable quickTestImageUrlAsync(UUID projectId, String url, QuickTestImageUrlOptionalParameter quickTestImageUrlOptionalParameter); /** * Quick test an image url. @@ -1352,7 +1507,18 @@ interface WithProjectId { * * @return next definition stage */ - TrainingsQuickTestImageUrlDefinitionStages.WithExecute withProjectId(UUID projectId); + WithUrl withProjectId(UUID projectId); + } + /** + * The stage of the definition to be specify url. + */ + interface WithUrl { + /** + * Url of the image. + * + * @return next definition stage + */ + TrainingsQuickTestImageUrlDefinitionStages.WithExecute withUrl(String url); } /** @@ -1367,13 +1533,6 @@ interface WithAllOptions { */ TrainingsQuickTestImageUrlDefinitionStages.WithExecute withIterationId(UUID iterationId); - /** - * - * - * @return next definition stage - */ - TrainingsQuickTestImageUrlDefinitionStages.WithExecute withUrl(String url); - } /** @@ -1401,44 +1560,21 @@ interface WithExecute extends TrainingsQuickTestImageUrlDefinitionStages.WithAll */ interface TrainingsQuickTestImageUrlDefinition extends TrainingsQuickTestImageUrlDefinitionStages.WithProjectId, + TrainingsQuickTestImageUrlDefinitionStages.WithUrl, TrainingsQuickTestImageUrlDefinitionStages.WithExecute { } - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PredictionQueryResult object - */ - Observable queryPredictionsAsync(UUID projectId, PredictionQueryToken query); - - - /** * 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 CustomVisionErrorException 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); + void deletePrediction(UUID projectId, List ids); /** * Delete a set of predicted images and their associated prediction results. @@ -1448,7 +1584,7 @@ interface TrainingsQuickTestImageUrlDefinition extends * @throws IllegalArgumentException thrown if parameters fail the validation * @return a representation of the deferred computation of this call if successful. */ - Observable deletePredictionAsync(UUID projectId, List ids); + Observable deletePredictionAsync(UUID projectId, List ids); @@ -1460,7 +1596,7 @@ interface TrainingsQuickTestImageUrlDefinition extends * @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 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 ImageRegionProposal object if successful. */ @@ -1481,71 +1617,259 @@ interface TrainingsQuickTestImageUrlDefinition extends /** - * Delete a set of image regions. + * 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 regionIds Regions to delete. Limited to 64. + * @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 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 ImageCreateSummary object if successful. */ - void deleteImageRegions(UUID projectId, List regionIds); + ImageCreateSummary createImagesFromPredictions(UUID projectId, ImageIdCreateBatch batch); /** - * Delete a set of image regions. + * 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 regionIds Regions to delete. Limited to 64. + * @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 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 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageCreateSummary object + */ + Observable createImagesFromUrlsAsync(UUID projectId, ImageUrlCreateBatch 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 + * @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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageCreateSummary object + */ + Observable createImagesFromFilesAsync(UUID projectId, ImageFileCreateBatch batch); + + + + /** + * 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 CustomVisionErrorException 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. * @throws IllegalArgumentException thrown if parameters fail the validation * @return a representation of the deferred computation of this call if successful. */ - Observable deleteImageRegionsAsync(UUID projectId, List regionIds); + Observable deleteImagesAsync(UUID projectId, List imageIds); + + + /** + * 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. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 6MB. + * @param createImagesFromDataOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 ImageCreateSummary object if successful. + */ + ImageCreateSummary createImagesFromData(UUID projectId, byte[] imageData, CreateImagesFromDataOptionalParameter createImagesFromDataOptionalParameter); + + /** + * 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. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 6MB. + * @param createImagesFromDataOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageCreateSummary object + */ + Observable createImagesFromDataAsync(UUID projectId, byte[] imageData, CreateImagesFromDataOptionalParameter createImagesFromDataOptionalParameter); + + /** + * 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. + * + * @return the first stage of the createImagesFromData call + */ + TrainingsCreateImagesFromDataDefinitionStages.WithProjectId createImagesFromData(); + + /** + * Grouping of createImagesFromData definition stages. + */ + interface TrainingsCreateImagesFromDataDefinitionStages { + /** + * The stage of the definition to be specify projectId. + */ + interface WithProjectId { + /** + * The project id. + * + * @return next definition stage + */ + WithImageData withProjectId(UUID projectId); + } + /** + * The stage of the definition to be specify imageData. + */ + interface WithImageData { + /** + * Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 6MB. + * + * @return next definition stage + */ + TrainingsCreateImagesFromDataDefinitionStages.WithExecute withImageData(byte[] imageData); + } + + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + interface WithAllOptions { + /** + * The tags ids with which to tag each image. Limited to 20. + * + * @return next definition stage + */ + TrainingsCreateImagesFromDataDefinitionStages.WithExecute withTagIds(List tagIds); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends TrainingsCreateImagesFromDataDefinitionStages.WithAllOptions { + /** + * Execute the request. + * + * @return the ImageCreateSummary object if successful. + */ + ImageCreateSummary execute(); + + /** + * Execute the request asynchronously. + * + * @return the observable to the ImageCreateSummary object + */ + Observable executeAsync(); + } + } + /** + * The entirety of createImagesFromData definition. + */ + interface TrainingsCreateImagesFromDataDefinition extends + TrainingsCreateImagesFromDataDefinitionStages.WithProjectId, + TrainingsCreateImagesFromDataDefinitionStages.WithImageData, + TrainingsCreateImagesFromDataDefinitionStages.WithExecute { + } /** - * 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. + * 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 createImageRegionsOptionalParameter the object representing the optional parameters to be set before calling this API + * @param getImagesByIdsOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 ImageRegionCreateSummary object if successful. + * @return the List<Image> object if successful. */ - @Deprecated - ImageRegionCreateSummary createImageRegions(UUID projectId, CreateImageRegionsOptionalParameter createImageRegionsOptionalParameter); + List getImagesByIds(UUID projectId, GetImagesByIdsOptionalParameter getImagesByIdsOptionalParameter); /** - * 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. + * 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 createImageRegionsOptionalParameter the object representing the optional parameters to be set before calling this API + * @param getImagesByIdsOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ImageRegionCreateSummary object + * @return the observable to the List<Image> object */ - @Deprecated - Observable createImageRegionsAsync(UUID projectId, CreateImageRegionsOptionalParameter createImageRegionsOptionalParameter); + Observable> getImagesByIdsAsync(UUID projectId, GetImagesByIdsOptionalParameter getImagesByIdsOptionalParameter); /** - * 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. + * 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. * - * @return the first stage of the createImageRegions call + * @return the first stage of the getImagesByIds call */ - TrainingsCreateImageRegionsDefinitionStages.WithProjectId createImageRegions(); + TrainingsGetImagesByIdsDefinitionStages.WithProjectId getImagesByIds(); /** - * Grouping of createImageRegions definition stages. + * Grouping of getImagesByIds definition stages. */ - interface TrainingsCreateImageRegionsDefinitionStages { + interface TrainingsGetImagesByIdsDefinitionStages { /** * The stage of the definition to be specify projectId. */ @@ -1555,7 +1879,7 @@ interface WithProjectId { * * @return next definition stage */ - TrainingsCreateImageRegionsDefinitionStages.WithExecute withProjectId(UUID projectId); + TrainingsGetImagesByIdsDefinitionStages.WithExecute withProjectId(UUID projectId); } /** @@ -1563,102 +1887,213 @@ interface WithProjectId { */ interface WithAllOptions { /** + * The list of image ids to retrieve. Limited to 256. * + * @return next definition stage + */ + TrainingsGetImagesByIdsDefinitionStages.WithExecute withImageIds(List imageIds); + + /** + * The iteration id. Defaults to workspace. * * @return next definition stage */ - TrainingsCreateImageRegionsDefinitionStages.WithExecute withRegions(List regions); + TrainingsGetImagesByIdsDefinitionStages.WithExecute withIterationId(UUID iterationId); } /** * The last stage of the definition which will make the operation call. */ - interface WithExecute extends TrainingsCreateImageRegionsDefinitionStages.WithAllOptions { + interface WithExecute extends TrainingsGetImagesByIdsDefinitionStages.WithAllOptions { /** * Execute the request. * - * @return the ImageRegionCreateSummary object if successful. + * @return the List<Image> object if successful. */ - ImageRegionCreateSummary execute(); + List execute(); /** * Execute the request asynchronously. * - * @return the observable to the ImageRegionCreateSummary object + * @return the observable to the List<Image> object */ - Observable executeAsync(); + Observable> executeAsync(); } } /** - * The entirety of createImageRegions definition. + * The entirety of getImagesByIds definition. */ - interface TrainingsCreateImageRegionsDefinition extends - TrainingsCreateImageRegionsDefinitionStages.WithProjectId, - TrainingsCreateImageRegionsDefinitionStages.WithExecute { + interface TrainingsGetImagesByIdsDefinition extends + TrainingsGetImagesByIdsDefinitionStages.WithProjectId, + TrainingsGetImagesByIdsDefinitionStages.WithExecute { } - /** - * Remove a set of tags from a set of images. + * 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 imageIds Image ids. Limited to 64 images. - * @param tagIds Tags to be deleted from the specified images. Limted to 20 tags. + * @param getUntaggedImagesOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 List<Image> object if successful. */ - void deleteImageTags(UUID projectId, List imageIds, List tagIds); + List getUntaggedImages(UUID projectId, GetUntaggedImagesOptionalParameter getUntaggedImagesOptionalParameter); /** - * Remove a set of tags from a set of images. + * 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 imageIds Image ids. Limited to 64 images. - * @param tagIds Tags to be deleted from the specified images. Limted to 20 tags. + * @param getUntaggedImagesOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return a representation of the deferred computation of this call if successful. + * @return the observable to the List<Image> object */ - Observable deleteImageTagsAsync(UUID projectId, List imageIds, List tagIds); + Observable> getUntaggedImagesAsync(UUID projectId, GetUntaggedImagesOptionalParameter getUntaggedImagesOptionalParameter); + /** + * 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. + * + * @return the first stage of the getUntaggedImages call + */ + TrainingsGetUntaggedImagesDefinitionStages.WithProjectId getUntaggedImages(); /** - * Associate a set of images with a set of tags. + * Grouping of getUntaggedImages definition stages. + */ + interface TrainingsGetUntaggedImagesDefinitionStages { + /** + * The stage of the definition to be specify projectId. + */ + interface WithProjectId { + /** + * The project id. + * + * @return next definition stage + */ + TrainingsGetUntaggedImagesDefinitionStages.WithExecute withProjectId(UUID projectId); + } + + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + interface WithAllOptions { + /** + * The iteration id. Defaults to workspace. + * + * @return next definition stage + */ + TrainingsGetUntaggedImagesDefinitionStages.WithExecute withIterationId(UUID iterationId); + + /** + * The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest'. + * + * @return next definition stage + */ + TrainingsGetUntaggedImagesDefinitionStages.WithExecute withOrderBy(String orderBy); + + /** + * Maximum number of images to return. Defaults to 50, limited to 256. + * + * @return next definition stage + */ + TrainingsGetUntaggedImagesDefinitionStages.WithExecute withTake(Integer take); + + /** + * Number of images to skip before beginning the image batch. Defaults to 0. + * + * @return next definition stage + */ + TrainingsGetUntaggedImagesDefinitionStages.WithExecute withSkip(Integer skip); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends TrainingsGetUntaggedImagesDefinitionStages.WithAllOptions { + /** + * Execute the request. + * + * @return the List<Image> object if successful. + */ + List execute(); + + /** + * Execute the request asynchronously. + * + * @return the observable to the List<Image> object + */ + Observable> executeAsync(); + } + } + + /** + * The entirety of getUntaggedImages definition. + */ + interface TrainingsGetUntaggedImagesDefinition extends + TrainingsGetUntaggedImagesDefinitionStages.WithProjectId, + TrainingsGetUntaggedImagesDefinitionStages.WithExecute { + } + + /** + * 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 createImageTagsOptionalParameter the object representing the optional parameters to be set before calling this API + * @param getTaggedImagesOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 ImageTagCreateSummary object if successful. + * @return the List<Image> object if successful. */ - @Deprecated - ImageTagCreateSummary createImageTags(UUID projectId, CreateImageTagsOptionalParameter createImageTagsOptionalParameter); + List getTaggedImages(UUID projectId, GetTaggedImagesOptionalParameter getTaggedImagesOptionalParameter); /** - * Associate a set of images with a set of tags. + * 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 createImageTagsOptionalParameter the object representing the optional parameters to be set before calling this API + * @param getTaggedImagesOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ImageTagCreateSummary object + * @return the observable to the List<Image> object */ - @Deprecated - Observable createImageTagsAsync(UUID projectId, CreateImageTagsOptionalParameter createImageTagsOptionalParameter); + Observable> getTaggedImagesAsync(UUID projectId, GetTaggedImagesOptionalParameter getTaggedImagesOptionalParameter); /** - * Associate a set of images with a set of tags. + * 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. * - * @return the first stage of the createImageTags call + * @return the first stage of the getTaggedImages call */ - TrainingsCreateImageTagsDefinitionStages.WithProjectId createImageTags(); + TrainingsGetTaggedImagesDefinitionStages.WithProjectId getTaggedImages(); /** - * Grouping of createImageTags definition stages. + * Grouping of getTaggedImages definition stages. */ - interface TrainingsCreateImageTagsDefinitionStages { + interface TrainingsGetTaggedImagesDefinitionStages { /** * The stage of the definition to be specify projectId. */ @@ -1668,7 +2103,7 @@ interface WithProjectId { * * @return next definition stage */ - TrainingsCreateImageTagsDefinitionStages.WithExecute withProjectId(UUID projectId); + TrainingsGetTaggedImagesDefinitionStages.WithExecute withProjectId(UUID projectId); } /** @@ -1676,192 +2111,135 @@ interface WithProjectId { */ interface WithAllOptions { /** - * + * The iteration id. Defaults to workspace. + * + * @return next definition stage + */ + TrainingsGetTaggedImagesDefinitionStages.WithExecute withIterationId(UUID iterationId); + + /** + * A list of tags ids to filter the images. Defaults to all tagged images when null. Limited to 20. + * + * @return next definition stage + */ + TrainingsGetTaggedImagesDefinitionStages.WithExecute withTagIds(List tagIds); + + /** + * The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest'. + * + * @return next definition stage + */ + TrainingsGetTaggedImagesDefinitionStages.WithExecute withOrderBy(String orderBy); + + /** + * Maximum number of images to return. Defaults to 50, limited to 256. + * + * @return next definition stage + */ + TrainingsGetTaggedImagesDefinitionStages.WithExecute withTake(Integer take); + + /** + * Number of images to skip before beginning the image batch. Defaults to 0. * * @return next definition stage */ - TrainingsCreateImageTagsDefinitionStages.WithExecute withTags(List tags); + TrainingsGetTaggedImagesDefinitionStages.WithExecute withSkip(Integer skip); } /** * The last stage of the definition which will make the operation call. */ - interface WithExecute extends TrainingsCreateImageTagsDefinitionStages.WithAllOptions { + interface WithExecute extends TrainingsGetTaggedImagesDefinitionStages.WithAllOptions { /** * Execute the request. * - * @return the ImageTagCreateSummary object if successful. + * @return the List<Image> object if successful. */ - ImageTagCreateSummary execute(); + List execute(); /** * Execute the request asynchronously. * - * @return the observable to the ImageTagCreateSummary object + * @return the observable to the List<Image> object */ - Observable executeAsync(); + Observable> executeAsync(); } } /** - * The entirety of createImageTags definition. + * The entirety of getTaggedImages definition. */ - interface TrainingsCreateImageTagsDefinition extends - TrainingsCreateImageTagsDefinitionStages.WithProjectId, - TrainingsCreateImageTagsDefinitionStages.WithExecute { + interface TrainingsGetTaggedImagesDefinition extends + TrainingsGetTaggedImagesDefinitionStages.WithProjectId, + TrainingsGetTaggedImagesDefinitionStages.WithExecute { } /** - * 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. Limted 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. Limted 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 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. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ImageCreateSummary object - */ - Observable createImagesFromUrlsAsync(UUID projectId, ImageUrlCreateBatch 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 - * @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. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ImageCreateSummary object - */ - Observable createImagesFromFilesAsync(UUID projectId, ImageFileCreateBatch batch); - - - - /** - * Delete images from the set of training images. + * Delete a set of image regions. * * @param projectId The project id. - * @param imageIds Ids of the images to be deleted. Limted to 256 images per batch. + * @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 CustomVisionErrorException 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); + void deleteImageRegions(UUID projectId, List regionIds); /** - * Delete images from the set of training images. + * Delete a set of image regions. * * @param projectId The project id. - * @param imageIds Ids of the images to be deleted. Limted to 256 images per batch. + * @param regionIds Regions to delete. Limited to 64. * @throws IllegalArgumentException thrown if parameters fail the validation * @return a representation of the deferred computation of this call if successful. */ - Observable deleteImagesAsync(UUID projectId, List imageIds); + Observable deleteImageRegionsAsync(UUID projectId, List regionIds); /** - * 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. + * 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 imageData the InputStream value. - * @param createImagesFromDataOptionalParameter the object representing the optional parameters to be set before calling this API + * @param createImageRegionsOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 ImageCreateSummary object if successful. + * @return the ImageRegionCreateSummary object if successful. */ - @Deprecated - ImageCreateSummary createImagesFromData(UUID projectId, byte[] imageData, CreateImagesFromDataOptionalParameter createImagesFromDataOptionalParameter); + ImageRegionCreateSummary createImageRegions(UUID projectId, CreateImageRegionsOptionalParameter createImageRegionsOptionalParameter); /** - * 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. + * 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 imageData the InputStream value. - * @param createImagesFromDataOptionalParameter the object representing the optional parameters to be set before calling this API + * @param createImageRegionsOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ImageCreateSummary object + * @return the observable to the ImageRegionCreateSummary object */ - @Deprecated - Observable createImagesFromDataAsync(UUID projectId, byte[] imageData, CreateImagesFromDataOptionalParameter createImagesFromDataOptionalParameter); + Observable createImageRegionsAsync(UUID projectId, CreateImageRegionsOptionalParameter createImageRegionsOptionalParameter); /** - * 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. + * 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. * - * @return the first stage of the createImagesFromData call + * @return the first stage of the createImageRegions call */ - TrainingsCreateImagesFromDataDefinitionStages.WithProjectId createImagesFromData(); + TrainingsCreateImageRegionsDefinitionStages.WithProjectId createImageRegions(); /** - * Grouping of createImagesFromData definition stages. + * Grouping of createImageRegions definition stages. */ - interface TrainingsCreateImagesFromDataDefinitionStages { + interface TrainingsCreateImageRegionsDefinitionStages { /** * The stage of the definition to be specify projectId. */ @@ -1871,18 +2249,7 @@ interface WithProjectId { * * @return next definition stage */ - WithImageData withProjectId(UUID projectId); - } - /** - * The stage of the definition to be specify imageData. - */ - interface WithImageData { - /** - * - * - * @return next definition stage - */ - TrainingsCreateImagesFromDataDefinitionStages.WithExecute withImageData(byte[] imageData); + TrainingsCreateImageRegionsDefinitionStages.WithExecute withProjectId(UUID projectId); } /** @@ -1890,87 +2257,100 @@ interface WithImageData { */ interface WithAllOptions { /** - * The tags ids with which to tag each image. Limited to 20. + * * * @return next definition stage */ - TrainingsCreateImagesFromDataDefinitionStages.WithExecute withTagIds(List tagIds); + TrainingsCreateImageRegionsDefinitionStages.WithExecute withRegions(List regions); } /** * The last stage of the definition which will make the operation call. */ - interface WithExecute extends TrainingsCreateImagesFromDataDefinitionStages.WithAllOptions { + interface WithExecute extends TrainingsCreateImageRegionsDefinitionStages.WithAllOptions { /** * Execute the request. * - * @return the ImageCreateSummary object if successful. + * @return the ImageRegionCreateSummary object if successful. */ - ImageCreateSummary execute(); + ImageRegionCreateSummary execute(); /** * Execute the request asynchronously. * - * @return the observable to the ImageCreateSummary object + * @return the observable to the ImageRegionCreateSummary object */ - Observable executeAsync(); + Observable executeAsync(); } } /** - * The entirety of createImagesFromData definition. + * The entirety of createImageRegions definition. */ - interface TrainingsCreateImagesFromDataDefinition extends - TrainingsCreateImagesFromDataDefinitionStages.WithProjectId, - TrainingsCreateImagesFromDataDefinitionStages.WithImageData, - TrainingsCreateImagesFromDataDefinitionStages.WithExecute { + interface TrainingsCreateImageRegionsDefinition extends + TrainingsCreateImageRegionsDefinitionStages.WithProjectId, + TrainingsCreateImageRegionsDefinitionStages.WithExecute { } + /** - * 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. + * Remove a set of tags from a set of images. * * @param projectId The project id. - * @param getImagesByIdsOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 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 List<Image> object if successful. */ - @Deprecated - List getImagesByIds(UUID projectId, GetImagesByIdsOptionalParameter getImagesByIdsOptionalParameter); + void deleteImageTags(UUID projectId, List imageIds, List tagIds); /** - * 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. + * Remove a set of tags from a set of images. * * @param projectId The project id. - * @param getImagesByIdsOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 observable to the List<Image> object + * @return a representation of the deferred computation of this call if successful. */ - @Deprecated - Observable> getImagesByIdsAsync(UUID projectId, GetImagesByIdsOptionalParameter getImagesByIdsOptionalParameter); + Observable deleteImageTagsAsync(UUID projectId, List imageIds, List tagIds); + /** - * 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. + * Associate a set of images with a set of tags. * - * @return the first stage of the getImagesByIds call + * @param projectId The project id. + * @param createImageTagsOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 ImageTagCreateSummary object if successful. */ - TrainingsGetImagesByIdsDefinitionStages.WithProjectId getImagesByIds(); + ImageTagCreateSummary createImageTags(UUID projectId, CreateImageTagsOptionalParameter createImageTagsOptionalParameter); /** - * Grouping of getImagesByIds definition stages. + * Associate a set of images with a set of tags. + * + * @param projectId The project id. + * @param createImageTagsOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageTagCreateSummary object */ - interface TrainingsGetImagesByIdsDefinitionStages { + Observable createImageTagsAsync(UUID projectId, CreateImageTagsOptionalParameter createImageTagsOptionalParameter); + + /** + * Associate a set of images with a set of tags. + * + * @return the first stage of the createImageTags call + */ + TrainingsCreateImageTagsDefinitionStages.WithProjectId createImageTags(); + + /** + * Grouping of createImageTags definition stages. + */ + interface TrainingsCreateImageTagsDefinitionStages { /** * The stage of the definition to be specify projectId. */ @@ -1980,7 +2360,7 @@ interface WithProjectId { * * @return next definition stage */ - TrainingsGetImagesByIdsDefinitionStages.WithExecute withProjectId(UUID projectId); + TrainingsCreateImageTagsDefinitionStages.WithExecute withProjectId(UUID projectId); } /** @@ -1988,47 +2368,40 @@ interface WithProjectId { */ interface WithAllOptions { /** - * The list of image ids to retrieve. Limited to 256. - * - * @return next definition stage - */ - TrainingsGetImagesByIdsDefinitionStages.WithExecute withImageIds(List imageIds); - - /** - * The iteration id. Defaults to workspace. + * Image Tag entries to include in this batch. * * @return next definition stage */ - TrainingsGetImagesByIdsDefinitionStages.WithExecute withIterationId(UUID iterationId); + TrainingsCreateImageTagsDefinitionStages.WithExecute withTags(List tags); } /** * The last stage of the definition which will make the operation call. */ - interface WithExecute extends TrainingsGetImagesByIdsDefinitionStages.WithAllOptions { + interface WithExecute extends TrainingsCreateImageTagsDefinitionStages.WithAllOptions { /** * Execute the request. * - * @return the List<Image> object if successful. + * @return the ImageTagCreateSummary object if successful. */ - List execute(); + ImageTagCreateSummary execute(); /** * Execute the request asynchronously. * - * @return the observable to the List<Image> object + * @return the observable to the ImageTagCreateSummary object */ - Observable> executeAsync(); + Observable executeAsync(); } } /** - * The entirety of getImagesByIds definition. + * The entirety of createImageTags definition. */ - interface TrainingsGetImagesByIdsDefinition extends - TrainingsGetImagesByIdsDefinitionStages.WithProjectId, - TrainingsGetImagesByIdsDefinitionStages.WithExecute { + interface TrainingsCreateImageTagsDefinition extends + TrainingsCreateImageTagsDefinitionStages.WithProjectId, + TrainingsCreateImageTagsDefinitionStages.WithExecute { } /** @@ -2040,11 +2413,10 @@ interface TrainingsGetImagesByIdsDefinition extends * @param projectId The project id. * @param getUntaggedImageCountOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 int object if successful. */ - @Deprecated int getUntaggedImageCount(UUID projectId, GetUntaggedImageCountOptionalParameter getUntaggedImageCountOptionalParameter); /** @@ -2058,7 +2430,6 @@ interface TrainingsGetImagesByIdsDefinition extends * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the int object */ - @Deprecated Observable getUntaggedImageCountAsync(UUID projectId, GetUntaggedImageCountOptionalParameter getUntaggedImageCountOptionalParameter); /** @@ -2136,11 +2507,10 @@ interface TrainingsGetUntaggedImageCountDefinition extends * @param projectId The project id. * @param getTaggedImageCountOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 int object if successful. */ - @Deprecated int getTaggedImageCount(UUID projectId, GetTaggedImageCountOptionalParameter getTaggedImageCountOptionalParameter); /** @@ -2153,7 +2523,6 @@ interface TrainingsGetUntaggedImageCountDefinition extends * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the int object */ - @Deprecated Observable getTaggedImageCountAsync(UUID projectId, GetTaggedImageCountOptionalParameter getTaggedImageCountOptionalParameter); /** @@ -2197,7 +2566,7 @@ interface WithAllOptions { * * @return next definition stage */ - TrainingsGetTaggedImageCountDefinitionStages.WithExecute withTagIds(List tagIds); + TrainingsGetTaggedImageCountDefinitionStages.WithExecute withTagIds(List tagIds); } @@ -2229,262 +2598,13 @@ interface TrainingsGetTaggedImageCountDefinition extends TrainingsGetTaggedImageCountDefinitionStages.WithExecute { } - /** - * 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 getUntaggedImagesOptionalParameter the object representing the optional parameters to be set before calling this API - * @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. - */ - @Deprecated - List getUntaggedImages(UUID projectId, GetUntaggedImagesOptionalParameter getUntaggedImagesOptionalParameter); - - /** - * 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 getUntaggedImagesOptionalParameter the object representing the optional parameters to be set before calling this API - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<Image> object - */ - @Deprecated - Observable> getUntaggedImagesAsync(UUID projectId, GetUntaggedImagesOptionalParameter getUntaggedImagesOptionalParameter); - - /** - * 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. - * - * @return the first stage of the getUntaggedImages call - */ - TrainingsGetUntaggedImagesDefinitionStages.WithProjectId getUntaggedImages(); - - /** - * Grouping of getUntaggedImages definition stages. - */ - interface TrainingsGetUntaggedImagesDefinitionStages { - /** - * The stage of the definition to be specify projectId. - */ - interface WithProjectId { - /** - * The project id. - * - * @return next definition stage - */ - TrainingsGetUntaggedImagesDefinitionStages.WithExecute withProjectId(UUID projectId); - } - - /** - * The stage of the definition which allows for any other optional settings to be specified. - */ - interface WithAllOptions { - /** - * The iteration id. Defaults to workspace. - * - * @return next definition stage - */ - TrainingsGetUntaggedImagesDefinitionStages.WithExecute withIterationId(UUID iterationId); - - /** - * The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest'. - * - * @return next definition stage - */ - TrainingsGetUntaggedImagesDefinitionStages.WithExecute withOrderBy(String orderBy); - - /** - * Maximum number of images to return. Defaults to 50, limited to 256. - * - * @return next definition stage - */ - TrainingsGetUntaggedImagesDefinitionStages.WithExecute withTake(Integer take); - - /** - * Number of images to skip before beginning the image batch. Defaults to 0. - * - * @return next definition stage - */ - TrainingsGetUntaggedImagesDefinitionStages.WithExecute withSkip(Integer skip); - - } - - /** - * The last stage of the definition which will make the operation call. - */ - interface WithExecute extends TrainingsGetUntaggedImagesDefinitionStages.WithAllOptions { - /** - * Execute the request. - * - * @return the List<Image> object if successful. - */ - List execute(); - - /** - * Execute the request asynchronously. - * - * @return the observable to the List<Image> object - */ - Observable> executeAsync(); - } - } - - /** - * The entirety of getUntaggedImages definition. - */ - interface TrainingsGetUntaggedImagesDefinition extends - TrainingsGetUntaggedImagesDefinitionStages.WithProjectId, - TrainingsGetUntaggedImagesDefinitionStages.WithExecute { - } - - /** - * 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 getTaggedImagesOptionalParameter the object representing the optional parameters to be set before calling this API - * @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. - */ - @Deprecated - List getTaggedImages(UUID projectId, GetTaggedImagesOptionalParameter getTaggedImagesOptionalParameter); - - /** - * 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 getTaggedImagesOptionalParameter the object representing the optional parameters to be set before calling this API - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<Image> object - */ - @Deprecated - Observable> getTaggedImagesAsync(UUID projectId, GetTaggedImagesOptionalParameter getTaggedImagesOptionalParameter); - - /** - * 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. - * - * @return the first stage of the getTaggedImages call - */ - TrainingsGetTaggedImagesDefinitionStages.WithProjectId getTaggedImages(); - - /** - * Grouping of getTaggedImages definition stages. - */ - interface TrainingsGetTaggedImagesDefinitionStages { - /** - * The stage of the definition to be specify projectId. - */ - interface WithProjectId { - /** - * The project id. - * - * @return next definition stage - */ - TrainingsGetTaggedImagesDefinitionStages.WithExecute withProjectId(UUID projectId); - } - - /** - * The stage of the definition which allows for any other optional settings to be specified. - */ - interface WithAllOptions { - /** - * The iteration id. Defaults to workspace. - * - * @return next definition stage - */ - TrainingsGetTaggedImagesDefinitionStages.WithExecute withIterationId(UUID iterationId); - - /** - * A list of tags ids to filter the images. Defaults to all tagged images when null. Limited to 20. - * - * @return next definition stage - */ - TrainingsGetTaggedImagesDefinitionStages.WithExecute withTagIds(List tagIds); - - /** - * The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest'. - * - * @return next definition stage - */ - TrainingsGetTaggedImagesDefinitionStages.WithExecute withOrderBy(String orderBy); - - /** - * Maximum number of images to return. Defaults to 50, limited to 256. - * - * @return next definition stage - */ - TrainingsGetTaggedImagesDefinitionStages.WithExecute withTake(Integer take); - - /** - * Number of images to skip before beginning the image batch. Defaults to 0. - * - * @return next definition stage - */ - TrainingsGetTaggedImagesDefinitionStages.WithExecute withSkip(Integer skip); - - } - - /** - * The last stage of the definition which will make the operation call. - */ - interface WithExecute extends TrainingsGetTaggedImagesDefinitionStages.WithAllOptions { - /** - * Execute the request. - * - * @return the List<Image> object if successful. - */ - List execute(); - - /** - * Execute the request asynchronously. - * - * @return the observable to the List<Image> object - */ - Observable> executeAsync(); - } - } - - /** - * The entirety of getTaggedImages definition. - */ - interface TrainingsGetTaggedImagesDefinition extends - TrainingsGetTaggedImagesDefinitionStages.WithProjectId, - TrainingsGetTaggedImagesDefinitionStages.WithExecute { - } - /** * 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 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 Domain object if successful. */ @@ -2505,7 +2625,7 @@ interface TrainingsGetTaggedImagesDefinition extends * 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 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 List<Domain> object if successful. */ diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingApiImpl.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/CustomVisionTrainingClientImpl.java similarity index 72% rename from sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingApiImpl.java rename to sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/CustomVisionTrainingClientImpl.java index 6f3f10fcb6b8..ba4edb36f0c3 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingApiImpl.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/CustomVisionTrainingClientImpl.java @@ -10,15 +10,15 @@ import com.microsoft.azure.AzureClient; import com.microsoft.azure.AzureServiceClient; -import com.microsoft.azure.cognitiveservices.vision.customvision.training.TrainingApi; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.CustomVisionTrainingClient; import com.microsoft.azure.cognitiveservices.vision.customvision.training.Trainings; -import com.microsoft.rest.credentials.ServiceClientCredentials; import com.microsoft.rest.RestClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; /** - * Initializes a new instance of the TrainingApiImpl class. + * Initializes a new instance of the CustomVisionTrainingClientImpl class. */ -public class TrainingApiImpl extends AzureServiceClient implements TrainingApi { +public class CustomVisionTrainingClientImpl extends AzureServiceClient implements CustomVisionTrainingClient { /** the {@link AzureClient} used for long running operations. */ private AzureClient azureClient; @@ -30,11 +30,11 @@ public AzureClient getAzureClient() { return this.azureClient; } - /** The API key. */ + /** API key. */ private String apiKey; /** - * Gets the API key. + * Gets API key. * * @return the apiKey value. */ @@ -43,16 +43,39 @@ public String apiKey() { } /** - * Sets the API key. + * Sets API key. * * @param apiKey the apiKey value. * @return the service client itself */ - public TrainingApiImpl withApiKey(String apiKey) { + 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; + } + /** Gets or sets the preferred language for the response. */ private String acceptLanguage; @@ -71,7 +94,7 @@ public String acceptLanguage() { * @param acceptLanguage the acceptLanguage value. * @return the service client itself */ - public TrainingApiImpl withAcceptLanguage(String acceptLanguage) { + public CustomVisionTrainingClientImpl withAcceptLanguage(String acceptLanguage) { this.acceptLanguage = acceptLanguage; return this; } @@ -94,7 +117,7 @@ public int longRunningOperationRetryTimeout() { * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. * @return the service client itself */ - public TrainingApiImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + public CustomVisionTrainingClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; return this; } @@ -117,7 +140,7 @@ public boolean generateClientRequestId() { * @param generateClientRequestId the generateClientRequestId value. * @return the service client itself */ - public TrainingApiImpl withGenerateClientRequestId(boolean generateClientRequestId) { + public CustomVisionTrainingClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { this.generateClientRequestId = generateClientRequestId; return this; } @@ -136,31 +159,31 @@ public Trainings trainings() { } /** - * Initializes an instance of TrainingApi client. + * Initializes an instance of CustomVisionTrainingClient client. * * @param credentials the management credentials for Azure */ - public TrainingApiImpl(ServiceClientCredentials credentials) { - this("https://southcentralus.api.cognitive.microsoft.com/customvision/v2.1/Training", credentials); + public CustomVisionTrainingClientImpl(ServiceClientCredentials credentials) { + this("https://{Endpoint}/customvision/v3.0/training", credentials); } /** - * Initializes an instance of TrainingApi client. + * Initializes an instance of CustomVisionTrainingClient client. * * @param baseUrl the base URL of the host * @param credentials the management credentials for Azure */ - public TrainingApiImpl(String baseUrl, ServiceClientCredentials credentials) { + public CustomVisionTrainingClientImpl(String baseUrl, ServiceClientCredentials credentials) { super(baseUrl, credentials); initialize(); } /** - * Initializes an instance of TrainingApi client. + * Initializes an instance of CustomVisionTrainingClient client. * * @param restClient the REST client to connect to Azure. */ - public TrainingApiImpl(RestClient restClient) { + public CustomVisionTrainingClientImpl(RestClient restClient) { super(restClient); initialize(); } @@ -180,6 +203,6 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "TrainingApi", "2.1"); + return String.format("%s (%s, %s)", super.userAgent(), "CustomVisionTrainingClient", "3.0"); } } diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java index dc65c44bcee9..c23833e1c4ef 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java @@ -8,32 +8,28 @@ 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.cognitiveservices.vision.customvision.training.Trainings; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.CreateImageRegionsOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.CreateImageTagsOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.CreateImagesFromDataOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.CreateProjectOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.CreateTagOptionalParameter; -import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.GetTagsOptionalParameter; -import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.GetTagOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.CustomVisionErrorException; +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.ExportIterationOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.GetImagePerformanceCountOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.GetImagePerformancesOptionalParameter; -import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.GetIterationPerformanceOptionalParameter; -import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.CreateProjectOptionalParameter; -import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.QuickTestImageOptionalParameter; -import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.QuickTestImageUrlOptionalParameter; -import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.CreateImageRegionsOptionalParameter; -import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.CreateImageTagsOptionalParameter; -import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.CreateImagesFromDataOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.GetImagesByIdsOptionalParameter; -import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.GetUntaggedImageCountOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.GetIterationPerformanceOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.GetTagOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.GetTaggedImageCountOptionalParameter; -import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.GetUntaggedImagesOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.GetTaggedImagesOptionalParameter; -import okhttp3.MediaType; -import okhttp3.RequestBody; -import retrofit2.Retrofit; -import com.microsoft.azure.cognitiveservices.vision.customvision.training.Trainings; -import com.google.common.reflect.TypeToken; -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.GetTagsOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.GetUntaggedImageCountOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.GetUntaggedImagesOptionalParameter; 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; @@ -54,30 +50,37 @@ 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.QuickTestImageOptionalParameter; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.QuickTestImageUrlOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.Tag; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.TrainProjectOptionalParameter; import com.microsoft.rest.CollectionFormat; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; import com.microsoft.rest.Validator; -import java.io.IOException; -import java.util.List; -import java.util.UUID; +import okhttp3.MediaType; +import okhttp3.RequestBody; import okhttp3.ResponseBody; +import retrofit2.Response; +import retrofit2.Retrofit; import retrofit2.http.Body; import retrofit2.http.GET; +import retrofit2.http.HTTP; 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.Part; +import retrofit2.http.Path; import retrofit2.http.Query; -import retrofit2.Response; -import rx.functions.Func1; import rx.Observable; +import rx.functions.Func1; + +import java.io.IOException; +import java.util.List; +import java.util.UUID; /** * An instance of this class provides access to all the operations defined @@ -87,7 +90,7 @@ public class TrainingsImpl implements Trainings { /** The Retrofit service to perform REST calls. */ private TrainingsService service; /** The service client containing this operation class. */ - private TrainingApiImpl client; + private CustomVisionTrainingClientImpl client; /** * Initializes an instance of TrainingsImpl. @@ -95,7 +98,7 @@ public class TrainingsImpl implements Trainings { * @param retrofit the Retrofit instance built from a Retrofit Builder. * @param client the instance of the service client containing this operation class. */ - public TrainingsImpl(Retrofit retrofit, TrainingApiImpl client) { + public TrainingsImpl(Retrofit retrofit, CustomVisionTrainingClientImpl client) { this.service = retrofit.create(TrainingsService.class); this.client = client; } @@ -107,167 +110,175 @@ public TrainingsImpl(Retrofit retrofit, TrainingApiImpl client) { interface TrainingsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.Trainings createTag" }) @POST("projects/{projectId}/tags") - Observable> createTag(@Path("projectId") UUID projectId, @Query("name") String name, @Query("description") String description, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + 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); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.Trainings 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("User-Agent") String userAgent); + 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.Trainings 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("User-Agent") String userAgent); + 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.Trainings 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("User-Agent") String userAgent); + 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.Trainings 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("User-Agent") String userAgent); + 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.Trainings 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("User-Agent") String userAgent); + 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.Trainings 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("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.Trainings 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("User-Agent") String userAgent); + 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.Trainings 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("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.Trainings unpublishIteration" }) + @HTTP(path = "projects/{projectId}/iterations/{iterationId}/publish", method = "DELETE", hasBody = true) + Observable> unpublishIteration(@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.Trainings 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("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.Trainings publishIteration" }) + @POST("projects/{projectId}/iterations/{iterationId}/publish") + Observable> publishIteration(@Path("projectId") UUID projectId, @Path("iterationId") UUID iterationId, @Query("publishName") String publishName, @Query("predictionId") String predictionId, @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.Trainings 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("User-Agent") String userAgent); + Observable> updateIteration(@Path("projectId") UUID projectId, @Path("iterationId") UUID iterationId, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Body Iteration updatedIteration, @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.Trainings 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("User-Agent") String userAgent); + 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.Trainings 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("User-Agent") String userAgent); + 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.Trainings getIterations" }) @GET("projects/{projectId}/iterations") - Observable> getIterations(@Path("projectId") UUID projectId, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + 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.Trainings trainProject" }) + @POST("projects/{projectId}/train") + Observable> trainProject(@Path("projectId") UUID projectId, @Query("trainingType") String trainingType, @Query("reservedBudgetInHours") Integer reservedBudgetInHours, @Query("forceTrain") Boolean forceTrain, @Query("notificationEmailAddress") String notificationEmailAddress, @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.Trainings updateProject" }) @PATCH("projects/{projectId}") - Observable> updateProject(@Path("projectId") UUID projectId, @Body Project updatedProject, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + 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.Trainings 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("User-Agent") String userAgent); + 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.Trainings getProject" }) @GET("projects/{projectId}") - Observable> getProject(@Path("projectId") UUID projectId, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + 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.Trainings 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("User-Agent") String userAgent); + Observable> createProject(@Query("name") String name, @Query("description") String description, @Query("domainId") UUID domainId, @Query("classificationType") String classificationType, @Query("targetExportPlatforms") String targetExportPlatforms, @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.Trainings getProjects" }) @GET("projects") - Observable> getProjects(@Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + 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.Trainings trainProject" }) - @POST("projects/{projectId}/train") - Observable> trainProject(@Path("projectId") UUID projectId, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.Trainings 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.Trainings 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.Trainings 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.Trainings 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); @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("User-Agent") String userAgent); + 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.Trainings 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("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.Trainings 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("User-Agent") String userAgent); + 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); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.Trainings 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("User-Agent") String userAgent); + 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.Trainings 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("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.Trainings 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("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.Trainings 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("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.Trainings 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("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.Trainings 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("User-Agent") String userAgent); + @POST("projects/{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.Trainings 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("User-Agent") String userAgent); + 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.Trainings 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("User-Agent") String userAgent); + 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.Trainings 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("User-Agent") String userAgent); + 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.Trainings 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("User-Agent") String userAgent); + 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); @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("User-Agent") String userAgent); + 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.Trainings 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("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.Trainings 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("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.Trainings 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("User-Agent") String userAgent); + 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); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.customvision.training.Trainings 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("User-Agent") String userAgent); + 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.Trainings 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("User-Agent") String userAgent); + 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.Trainings 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.Trainings 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.Trainings 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.Trainings 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.Trainings 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.Trainings 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.Trainings getDomain" }) @GET("domains/{domainId}") - Observable> getDomain(@Path("domainId") UUID domainId, @Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + 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.Trainings getDomains" }) @GET("domains") - Observable> getDomains(@Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getDomains(@Header("Training-Key") String apiKey, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); } @@ -275,11 +286,11 @@ interface TrainingsService { /** * Create a tag for the project. * - * @param projectId The project id - * @param name The tag name + * @param projectId The project id. + * @param name The tag name. * @param createTagOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 Tag object if successful. */ @@ -290,8 +301,8 @@ public Tag createTag(UUID projectId, String name, CreateTagOptionalParameter cre /** * Create a tag for the project. * - * @param projectId The project id - * @param name The tag name + * @param projectId The project id. + * @param name The tag name. * @param createTagOptionalParameter the object representing the optional parameters to be set before calling this API * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -304,8 +315,8 @@ public ServiceFuture createTagAsync(UUID projectId, String name, CreateTagO /** * Create a tag for the project. * - * @param projectId The project id - * @param name The tag name + * @param projectId The project id. + * @param name The tag name. * @param createTagOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the Tag object @@ -322,13 +333,16 @@ public Tag call(ServiceResponse response) { /** * Create a tag for the project. * - * @param projectId The project id - * @param name The tag name + * @param projectId The project id. + * @param name The tag name. * @param createTagOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the Tag object */ public Observable> createTagWithServiceResponseAsync(UUID projectId, String name, CreateTagOptionalParameter createTagOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } @@ -339,20 +353,25 @@ public Observable> createTagWithServiceResponseAsync(UUID p throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } final String description = createTagOptionalParameter != null ? createTagOptionalParameter.description() : null; + final String type = createTagOptionalParameter != null ? createTagOptionalParameter.type() : null; - return createTagWithServiceResponseAsync(projectId, name, description); + return createTagWithServiceResponseAsync(projectId, name, description, 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 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) { + public Observable> createTagWithServiceResponseAsync(UUID projectId, String name, String description, String type) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } @@ -362,7 +381,8 @@ public Observable> createTagWithServiceResponseAsync(UUID p if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - return service.createTag(projectId, name, description, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.createTag(projectId, name, description, type, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -376,10 +396,10 @@ public Observable> call(Response response) { }); } - private ServiceResponse createTagDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse createTagDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(CustomVisionErrorException.class) .build(response); } @@ -396,6 +416,7 @@ class TrainingsCreateTagParameters implements TrainingsCreateTagDefinition { private UUID projectId; private String name; private String description; + private String type; /** * Constructor. @@ -423,14 +444,20 @@ public TrainingsCreateTagParameters withDescription(String description) { return this; } + @Override + public TrainingsCreateTagParameters withType(String type) { + this.type = type; + return this; + } + @Override public Tag execute() { - return createTagWithServiceResponseAsync(projectId, name, description).toBlocking().single().body(); + return createTagWithServiceResponseAsync(projectId, name, description, type).toBlocking().single().body(); } @Override public Observable executeAsync() { - return createTagWithServiceResponseAsync(projectId, name, description).map(new Func1, Tag>() { + return createTagWithServiceResponseAsync(projectId, name, description, type).map(new Func1, Tag>() { @Override public Tag call(ServiceResponse response) { return response.body(); @@ -443,10 +470,10 @@ public Tag call(ServiceResponse response) { /** * Get the tags for a given project and iteration. * - * @param projectId The project id + * @param projectId The project id. * @param getTagsOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 List<Tag> object if successful. */ @@ -457,7 +484,7 @@ public List getTags(UUID projectId, GetTagsOptionalParameter getTagsOptiona /** * Get the tags for a given project and iteration. * - * @param projectId The project id + * @param projectId The project id. * @param getTagsOptionalParameter the object representing the optional parameters to be set before calling this API * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -470,7 +497,7 @@ public ServiceFuture> getTagsAsync(UUID projectId, GetTagsOptionalPara /** * Get the tags for a given project and iteration. * - * @param projectId The project id + * @param projectId The project id. * @param getTagsOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<Tag> object @@ -487,12 +514,15 @@ public List call(ServiceResponse> response) { /** * Get the tags for a given project and iteration. * - * @param projectId The project id + * @param projectId The project id. * @param getTagsOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<Tag> object */ public Observable>> getTagsWithServiceResponseAsync(UUID projectId, GetTagsOptionalParameter getTagsOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } @@ -507,19 +537,23 @@ public Observable>> getTagsWithServiceResponseAsync(UU /** * Get the tags for a given project and iteration. * - * @param projectId The project id - * @param iterationId The iteration id. Defaults to workspace + * @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.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - return service.getTags(projectId, iterationId, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getTags(projectId, iterationId, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -533,10 +567,10 @@ public Observable>> call(Response respon }); } - private ServiceResponse> getTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> getTagsDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CustomVisionErrorException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(CustomVisionErrorException.class) .build(response); } @@ -592,11 +626,11 @@ public List call(ServiceResponse> response) { /** * Update a tag. * - * @param projectId The project id - * @param tagId The id of the target tag - * @param updatedTag The updated tag model + * @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 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 Tag object if successful. */ @@ -607,9 +641,9 @@ public 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 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 @@ -621,9 +655,9 @@ public ServiceFuture updateTagAsync(UUID projectId, UUID tagId, Tag updated /** * Update a tag. * - * @param projectId The project id - * @param tagId The id of the target tag - * @param updatedTag The updated tag model + * @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 */ @@ -639,13 +673,16 @@ public Tag call(ServiceResponse response) { /** * Update a tag. * - * @param projectId The project id - * @param tagId The id of the target tag - * @param updatedTag The updated tag model + * @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.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } @@ -659,7 +696,8 @@ public Observable> updateTagWithServiceResponseAsync(UUID p throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } Validator.validate(updatedTag); - return service.updateTag(projectId, tagId, updatedTag, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.updateTag(projectId, tagId, updatedTag, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -673,20 +711,20 @@ public Observable> call(Response response) { }); } - private ServiceResponse updateTagDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse updateTagDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(CustomVisionErrorException.class) .build(response); } /** * Delete a tag from the project. * - * @param projectId The project id - * @param tagId Id of the tag to be deleted + * @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 CustomVisionErrorException 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) { @@ -696,8 +734,8 @@ public 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 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 @@ -709,8 +747,8 @@ public ServiceFuture deleteTagAsync(UUID projectId, UUID tagId, final Serv /** * Delete a tag from the project. * - * @param projectId The project id - * @param tagId Id of the tag to be deleted + * @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. */ @@ -726,12 +764,15 @@ public Void call(ServiceResponse response) { /** * Delete a tag from the project. * - * @param projectId The project id - * @param tagId Id of the tag to be deleted + * @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.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } @@ -741,7 +782,8 @@ public Observable> deleteTagWithServiceResponseAsync(UUID if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - return service.deleteTag(projectId, tagId, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.deleteTag(projectId, tagId, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -755,10 +797,10 @@ public Observable> call(Response response) { }); } - private ServiceResponse deleteTagDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse deleteTagDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(204, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(CustomVisionErrorException.class) .build(response); } @@ -766,11 +808,11 @@ private ServiceResponse deleteTagDelegate(Response response) /** * Get information about a specific tag. * - * @param projectId The project this tag belongs to - * @param tagId The tag id + * @param projectId The project this tag belongs to. + * @param tagId The tag id. * @param getTagOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 Tag object if successful. */ @@ -781,8 +823,8 @@ public Tag getTag(UUID projectId, UUID tagId, GetTagOptionalParameter getTagOpti /** * Get information about a specific tag. * - * @param projectId The project this tag belongs to - * @param tagId The tag id + * @param projectId The project this tag belongs to. + * @param tagId The tag id. * @param getTagOptionalParameter the object representing the optional parameters to be set before calling this API * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -795,8 +837,8 @@ public ServiceFuture getTagAsync(UUID projectId, UUID tagId, GetTagOptional /** * Get information about a specific tag. * - * @param projectId The project this tag belongs to - * @param tagId The tag id + * @param projectId The project this tag belongs to. + * @param tagId The tag id. * @param getTagOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the Tag object @@ -813,13 +855,16 @@ public Tag call(ServiceResponse response) { /** * Get information about a specific tag. * - * @param projectId The project this tag belongs to - * @param tagId The tag id + * @param projectId The project this tag belongs to. + * @param tagId The tag id. * @param getTagOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the Tag object */ public Observable> getTagWithServiceResponseAsync(UUID projectId, UUID tagId, GetTagOptionalParameter getTagOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } @@ -837,13 +882,16 @@ public Observable> getTagWithServiceResponseAsync(UUID proj /** * 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 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.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } @@ -853,7 +901,8 @@ public Observable> getTagWithServiceResponseAsync(UUID proj if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - return service.getTag(projectId, tagId, iterationId, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getTag(projectId, tagId, iterationId, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -867,10 +916,10 @@ public Observable> call(Response response) { }); } - private ServiceResponse getTagDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getTagDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(CustomVisionErrorException.class) .build(response); } @@ -934,12 +983,12 @@ public Tag call(ServiceResponse response) { /** * Export a trained iteration. * - * @param projectId The project id - * @param iterationId The iteration id - * @param platform The target platform (coreml or tensorflow). Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX' + * @param projectId The project id. + * @param iterationId The iteration id. + * @param platform The target platform. Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX', 'VAIDK' * @param exportIterationOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 Export object if successful. */ @@ -950,9 +999,9 @@ public 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 (coreml or tensorflow). Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX' + * @param projectId The project id. + * @param iterationId The iteration id. + * @param platform The target platform. Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX', 'VAIDK' * @param exportIterationOptionalParameter the object representing the optional parameters to be set before calling this API * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -965,9 +1014,9 @@ public ServiceFuture exportIterationAsync(UUID projectId, UUID iteration /** * Export a trained iteration. * - * @param projectId The project id - * @param iterationId The iteration id - * @param platform The target platform (coreml or tensorflow). Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX' + * @param projectId The project id. + * @param iterationId The iteration id. + * @param platform The target platform. Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX', 'VAIDK' * @param exportIterationOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the Export object @@ -984,14 +1033,17 @@ public Export call(ServiceResponse response) { /** * Export a trained iteration. * - * @param projectId The project id - * @param iterationId The iteration id - * @param platform The target platform (coreml or tensorflow). Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX' + * @param projectId The project id. + * @param iterationId The iteration id. + * @param platform The target platform. Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX', 'VAIDK' * @param exportIterationOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the Export object */ public Observable> exportIterationWithServiceResponseAsync(UUID projectId, UUID iterationId, String platform, ExportIterationOptionalParameter exportIterationOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } @@ -1012,14 +1064,17 @@ public Observable> exportIterationWithServiceResponseAsy /** * Export a trained iteration. * - * @param projectId The project id - * @param iterationId The iteration id - * @param platform The target platform (coreml or tensorflow). Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX' - * @param flavor The flavor of the target platform (Windows, Linux, ARM, or GPU). Possible values include: 'Linux', 'Windows' + * @param projectId The project id. + * @param iterationId The iteration id. + * @param platform The target platform. Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX', 'VAIDK' + * @param flavor The flavor of the target platform. Possible values include: 'Linux', 'Windows', 'ONNX10', 'ONNX12', 'ARM' * @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.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } @@ -1032,7 +1087,8 @@ public Observable> exportIterationWithServiceResponseAsy if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - return service.exportIteration(projectId, iterationId, platform, flavor, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.exportIteration(projectId, iterationId, platform, flavor, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -1046,10 +1102,10 @@ public Observable> call(Response response) }); } - private ServiceResponse exportIterationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse exportIterationDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(CustomVisionErrorException.class) .build(response); } @@ -1119,10 +1175,10 @@ public Export call(ServiceResponse response) { /** * Get the list of exports for a specific iteration. * - * @param projectId The project id - * @param iterationId The iteration id + * @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 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 List<Export> object if successful. */ @@ -1133,8 +1189,8 @@ public 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 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 @@ -1146,8 +1202,8 @@ public ServiceFuture> getExportsAsync(UUID projectId, UUID iteratio /** * Get the list of exports for a specific iteration. * - * @param projectId The project id - * @param iterationId The iteration id + * @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 */ @@ -1163,12 +1219,15 @@ public List call(ServiceResponse> response) { /** * Get the list of exports for a specific iteration. * - * @param projectId The project id - * @param iterationId The iteration id + * @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.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } @@ -1178,7 +1237,8 @@ public Observable>> getExportsWithServiceResponseAs if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - return service.getExports(projectId, iterationId, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getExports(projectId, iterationId, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -1192,83 +1252,68 @@ public Observable>> call(Response res }); } - private ServiceResponse> getExportsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> getExportsDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CustomVisionErrorException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(CustomVisionErrorException.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. + * Unpublish a specific iteration. * - * @param projectId The project id - * @param iterationId The iteration id. Defaults to workspace - * @param getImagePerformanceCountOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 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 int object if successful. */ - public int getImagePerformanceCount(UUID projectId, UUID iterationId, GetImagePerformanceCountOptionalParameter getImagePerformanceCountOptionalParameter) { - return getImagePerformanceCountWithServiceResponseAsync(projectId, iterationId, getImagePerformanceCountOptionalParameter).toBlocking().single().body(); + public void unpublishIteration(UUID projectId, UUID iterationId) { + unpublishIterationWithServiceResponseAsync(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. + * Unpublish a specific iteration. * - * @param projectId The project id - * @param iterationId The iteration id. Defaults to workspace - * @param getImagePerformanceCountOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 getImagePerformanceCountAsync(UUID projectId, UUID iterationId, GetImagePerformanceCountOptionalParameter getImagePerformanceCountOptionalParameter, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getImagePerformanceCountWithServiceResponseAsync(projectId, iterationId, getImagePerformanceCountOptionalParameter), serviceCallback); + public ServiceFuture unpublishIterationAsync(UUID projectId, UUID iterationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(unpublishIterationWithServiceResponseAsync(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. + * Unpublish a specific iteration. * - * @param projectId The project id - * @param iterationId The iteration id. Defaults to workspace - * @param getImagePerformanceCountOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param iterationId The iteration id. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the Integer object + * @return the {@link ServiceResponse} object if successful. */ - public Observable getImagePerformanceCountAsync(UUID projectId, UUID iterationId, GetImagePerformanceCountOptionalParameter getImagePerformanceCountOptionalParameter) { - return getImagePerformanceCountWithServiceResponseAsync(projectId, iterationId, getImagePerformanceCountOptionalParameter).map(new Func1, Integer>() { + public Observable unpublishIterationAsync(UUID projectId, UUID iterationId) { + return unpublishIterationWithServiceResponseAsync(projectId, iterationId).map(new Func1, Void>() { @Override - public Integer call(ServiceResponse response) { + public Void 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. + * Unpublish a specific iteration. * - * @param projectId The project id - * @param iterationId The iteration id. Defaults to workspace - * @param getImagePerformanceCountOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param iterationId The iteration id. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the Integer object + * @return the {@link ServiceResponse} object if successful. */ - public Observable> getImagePerformanceCountWithServiceResponseAsync(UUID projectId, UUID iterationId, GetImagePerformanceCountOptionalParameter getImagePerformanceCountOptionalParameter) { + public Observable> unpublishIterationWithServiceResponseAsync(UUID projectId, UUID iterationId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } @@ -1278,41 +1323,114 @@ public Observable> getImagePerformanceCountWithServiceR if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - final List tagIds = getImagePerformanceCountOptionalParameter != null ? getImagePerformanceCountOptionalParameter.tagIds() : null; + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.unpublishIteration(projectId, iterationId, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = unpublishIterationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } - return getImagePerformanceCountWithServiceResponseAsync(projectId, iterationId, tagIds); + private ServiceResponse unpublishIterationDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.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. + * Publish a specific iteration. * - * @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 projectId The project id. + * @param iterationId The iteration id. + * @param publishName The name to give the published iteration. + * @param predictionId The id of the prediction resource to publish to. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the Integer object + * @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 boolean object if successful. + */ + public boolean publishIteration(UUID projectId, UUID iterationId, String publishName, String predictionId) { + return publishIterationWithServiceResponseAsync(projectId, iterationId, publishName, predictionId).toBlocking().single().body(); + } + + /** + * Publish a specific iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @param publishName The name to give the published iteration. + * @param predictionId The id of the prediction resource to publish to. + * @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 publishIterationAsync(UUID projectId, UUID iterationId, String publishName, String predictionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(publishIterationWithServiceResponseAsync(projectId, iterationId, publishName, predictionId), serviceCallback); + } + + /** + * Publish a specific iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @param publishName The name to give the published iteration. + * @param predictionId The id of the prediction resource to publish to. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable publishIterationAsync(UUID projectId, UUID iterationId, String publishName, String predictionId) { + return publishIterationWithServiceResponseAsync(projectId, iterationId, publishName, predictionId).map(new Func1, Boolean>() { + @Override + public Boolean call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Publish a specific iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @param publishName The name to give the published iteration. + * @param predictionId The id of the prediction resource to publish to. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object */ - public Observable> getImagePerformanceCountWithServiceResponseAsync(UUID projectId, UUID iterationId, List tagIds) { + public Observable> publishIterationWithServiceResponseAsync(UUID projectId, UUID iterationId, String publishName, String predictionId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.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 (publishName == null) { + throw new IllegalArgumentException("Parameter publishName is required and cannot be null."); + } + if (predictionId == null) { + throw new IllegalArgumentException("Parameter predictionId is required and cannot be null."); + } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - Validator.validate(tagIds); - String tagIdsConverted = this.client.serializerAdapter().serializeList(tagIds, CollectionFormat.CSV); - return service.getImagePerformanceCount(projectId, iterationId, tagIdsConverted, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.publishIteration(projectId, iterationId, publishName, predictionId, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = getImagePerformanceCountDelegate(response); + ServiceResponse clientResponse = publishIterationDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1321,177 +1439,164 @@ public Observable> call(Response response }); } - private ServiceResponse getImagePerformanceCountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + private ServiceResponse publishIterationDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) .build(response); } - @Override - public TrainingsGetImagePerformanceCountParameters getImagePerformanceCount() { - return new TrainingsGetImagePerformanceCountParameters(this); + /** + * Update a specific iteration. + * + * @param projectId Project id. + * @param iterationId Iteration id. + * @param name Gets or sets the name of the iteration. + * @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 Iteration object if successful. + */ + public Iteration updateIteration(UUID projectId, UUID iterationId, String name) { + return updateIterationWithServiceResponseAsync(projectId, iterationId, name).toBlocking().single().body(); } /** - * Internal class implementing TrainingsGetImagePerformanceCountDefinition. + * Update a specific iteration. + * + * @param projectId Project id. + * @param iterationId Iteration id. + * @param name Gets or sets the name of the iteration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object */ - class TrainingsGetImagePerformanceCountParameters implements TrainingsGetImagePerformanceCountDefinition { - private TrainingsImpl parent; - private UUID projectId; - private UUID iterationId; - private List tagIds; - - /** - * Constructor. - * @param parent the parent object. - */ - TrainingsGetImagePerformanceCountParameters(TrainingsImpl parent) { - this.parent = parent; - } - - @Override - public TrainingsGetImagePerformanceCountParameters withProjectId(UUID projectId) { - this.projectId = projectId; - return this; - } + public ServiceFuture updateIterationAsync(UUID projectId, UUID iterationId, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateIterationWithServiceResponseAsync(projectId, iterationId, name), serviceCallback); + } - @Override - public TrainingsGetImagePerformanceCountParameters withIterationId(UUID iterationId) { - this.iterationId = iterationId; - return this; - } - - @Override - public TrainingsGetImagePerformanceCountParameters withTagIds(List tagIds) { - this.tagIds = tagIds; - return this; - } - - @Override - public int execute() { - return getImagePerformanceCountWithServiceResponseAsync(projectId, iterationId, tagIds).toBlocking().single().body(); + /** + * Update a specific iteration. + * + * @param projectId Project id. + * @param iterationId Iteration id. + * @param name Gets or sets the name of the iteration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Iteration object + */ + public Observable updateIterationAsync(UUID projectId, UUID iterationId, String name) { + return updateIterationWithServiceResponseAsync(projectId, iterationId, name).map(new Func1, Iteration>() { + @Override + public Iteration call(ServiceResponse response) { + return response.body(); + } + }); } - @Override - public Observable executeAsync() { - return getImagePerformanceCountWithServiceResponseAsync(projectId, iterationId, tagIds).map(new Func1, Integer>() { + /** + * Update a specific iteration. + * + * @param projectId Project id. + * @param iterationId Iteration id. + * @param name Gets or sets the name of the iteration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Iteration object + */ + public Observable> updateIterationWithServiceResponseAsync(UUID projectId, UUID iterationId, String name) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.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.client.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + Iteration updatedIteration = new Iteration(); + updatedIteration.withName(name); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.updateIteration(projectId, iterationId, this.client.apiKey(), this.client.acceptLanguage(), updatedIteration, parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Integer call(ServiceResponse response) { - return response.body(); + 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 CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.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. + * Delete a specific iteration of a project. * - * @param projectId The project id - * @param iterationId The iteration id. Defaults to workspace - * @param getImagePerformancesOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 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 List<ImagePerformance> object if successful. */ - public List getImagePerformances(UUID projectId, UUID iterationId, GetImagePerformancesOptionalParameter getImagePerformancesOptionalParameter) { - return getImagePerformancesWithServiceResponseAsync(projectId, iterationId, getImagePerformancesOptionalParameter).toBlocking().single().body(); + public void deleteIteration(UUID projectId, UUID iterationId) { + deleteIterationWithServiceResponseAsync(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. + * Delete a specific iteration of a project. * - * @param projectId The project id - * @param iterationId The iteration id. Defaults to workspace - * @param getImagePerformancesOptionalParameter the object representing the optional parameters to be set before calling this API + * @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> getImagePerformancesAsync(UUID projectId, UUID iterationId, GetImagePerformancesOptionalParameter getImagePerformancesOptionalParameter, final ServiceCallback> serviceCallback) { - return ServiceFuture.fromResponse(getImagePerformancesWithServiceResponseAsync(projectId, iterationId, getImagePerformancesOptionalParameter), serviceCallback); + public ServiceFuture deleteIterationAsync(UUID projectId, UUID iterationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteIterationWithServiceResponseAsync(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. + * Delete a specific iteration of a project. * - * @param projectId The project id - * @param iterationId The iteration id. Defaults to workspace - * @param getImagePerformancesOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param iterationId The iteration id. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<ImagePerformance> object + * @return the {@link ServiceResponse} object if successful. */ - public Observable> getImagePerformancesAsync(UUID projectId, UUID iterationId, GetImagePerformancesOptionalParameter getImagePerformancesOptionalParameter) { - return getImagePerformancesWithServiceResponseAsync(projectId, iterationId, getImagePerformancesOptionalParameter).map(new Func1>, List>() { + public Observable deleteIterationAsync(UUID projectId, UUID iterationId) { + return deleteIterationWithServiceResponseAsync(projectId, iterationId).map(new Func1, Void>() { @Override - public List call(ServiceResponse> response) { + public Void 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. + * Delete a specific iteration of a project. * - * @param projectId The project id - * @param iterationId The iteration id. Defaults to workspace - * @param getImagePerformancesOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param iterationId The iteration id. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<ImagePerformance> object + * @return the {@link ServiceResponse} object if successful. */ - public Observable>> getImagePerformancesWithServiceResponseAsync(UUID projectId, UUID iterationId, GetImagePerformancesOptionalParameter getImagePerformancesOptionalParameter) { - 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.client.apiKey() == null) { - throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); + public Observable> deleteIterationWithServiceResponseAsync(UUID projectId, UUID iterationId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } - final List tagIds = getImagePerformancesOptionalParameter != null ? getImagePerformancesOptionalParameter.tagIds() : null; - final String orderBy = getImagePerformancesOptionalParameter != null ? getImagePerformancesOptionalParameter.orderBy() : null; - final Integer take = getImagePerformancesOptionalParameter != null ? getImagePerformancesOptionalParameter.take() : null; - final Integer skip = getImagePerformancesOptionalParameter != null ? getImagePerformancesOptionalParameter.skip() : null; - - return getImagePerformancesWithServiceResponseAsync(projectId, iterationId, tagIds, orderBy, take, 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 - */ - public Observable>> getImagePerformancesWithServiceResponseAsync(UUID projectId, UUID iterationId, List tagIds, String orderBy, Integer take, Integer skip) { if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } @@ -1501,14 +1606,13 @@ public Observable>> getImagePerformancesW if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - Validator.validate(tagIds); - String tagIdsConverted = this.client.serializerAdapter().serializeList(tagIds, CollectionFormat.CSV); - return service.getImagePerformances(projectId, iterationId, tagIdsConverted, orderBy, take, skip, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.deleteIteration(projectId, iterationId, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable>> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse> clientResponse = getImagePerformancesDelegate(response); + ServiceResponse clientResponse = deleteIterationDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1517,148 +1621,69 @@ public Observable>> call(Response> getImagePerformancesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + private ServiceResponse deleteIterationDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) .build(response); } - @Override - public TrainingsGetImagePerformancesParameters getImagePerformances() { - return new TrainingsGetImagePerformancesParameters(this); - } - - /** - * Internal class implementing TrainingsGetImagePerformancesDefinition. - */ - class TrainingsGetImagePerformancesParameters implements TrainingsGetImagePerformancesDefinition { - private TrainingsImpl parent; - private UUID projectId; - private UUID iterationId; - private List tagIds; - private String orderBy; - private Integer take; - private Integer skip; - - /** - * Constructor. - * @param parent the parent object. - */ - TrainingsGetImagePerformancesParameters(TrainingsImpl parent) { - this.parent = parent; - } - - @Override - public TrainingsGetImagePerformancesParameters withProjectId(UUID projectId) { - this.projectId = projectId; - return this; - } - - @Override - public TrainingsGetImagePerformancesParameters withIterationId(UUID iterationId) { - this.iterationId = iterationId; - return this; - } - - @Override - public TrainingsGetImagePerformancesParameters withTagIds(List tagIds) { - this.tagIds = tagIds; - return this; - } - - @Override - public TrainingsGetImagePerformancesParameters withOrderBy(String orderBy) { - this.orderBy = orderBy; - return this; - } - - @Override - public TrainingsGetImagePerformancesParameters withTake(Integer take) { - this.take = take; - return this; - } - - @Override - public TrainingsGetImagePerformancesParameters withSkip(Integer skip) { - this.skip = skip; - return this; - } - - @Override - public List execute() { - return getImagePerformancesWithServiceResponseAsync(projectId, iterationId, tagIds, orderBy, take, skip).toBlocking().single().body(); - } - - @Override - public Observable> executeAsync() { - return getImagePerformancesWithServiceResponseAsync(projectId, iterationId, tagIds, orderBy, take, skip).map(new Func1>, List>() { - @Override - public List call(ServiceResponse> response) { - return response.body(); - } - }); - } - } - - /** - * Get detailed performance information about an iteration. + * 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 getIterationPerformanceOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 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 IterationPerformance object if successful. + * @return the Iteration object if successful. */ - public IterationPerformance getIterationPerformance(UUID projectId, UUID iterationId, GetIterationPerformanceOptionalParameter getIterationPerformanceOptionalParameter) { - return getIterationPerformanceWithServiceResponseAsync(projectId, iterationId, getIterationPerformanceOptionalParameter).toBlocking().single().body(); + public Iteration getIteration(UUID projectId, UUID iterationId) { + return getIterationWithServiceResponseAsync(projectId, iterationId).toBlocking().single().body(); } /** - * Get detailed performance information about an iteration. + * 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 getIterationPerformanceOptionalParameter the object representing the optional parameters to be set before calling this API + * @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, GetIterationPerformanceOptionalParameter getIterationPerformanceOptionalParameter, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getIterationPerformanceWithServiceResponseAsync(projectId, iterationId, getIterationPerformanceOptionalParameter), serviceCallback); + public ServiceFuture getIterationAsync(UUID projectId, UUID iterationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getIterationWithServiceResponseAsync(projectId, iterationId), serviceCallback); } /** - * Get detailed performance information about an iteration. + * 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 getIterationPerformanceOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 + * @return the observable to the Iteration object */ - public Observable getIterationPerformanceAsync(UUID projectId, UUID iterationId, GetIterationPerformanceOptionalParameter getIterationPerformanceOptionalParameter) { - return getIterationPerformanceWithServiceResponseAsync(projectId, iterationId, getIterationPerformanceOptionalParameter).map(new Func1, IterationPerformance>() { + public Observable getIterationAsync(UUID projectId, UUID iterationId) { + return getIterationWithServiceResponseAsync(projectId, iterationId).map(new Func1, Iteration>() { @Override - public IterationPerformance call(ServiceResponse response) { + public Iteration call(ServiceResponse response) { return response.body(); } }); } /** - * Get detailed performance information about an iteration. + * 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 getIterationPerformanceOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 + * @return the observable to the Iteration object */ - public Observable> getIterationPerformanceWithServiceResponseAsync(UUID projectId, UUID iterationId, GetIterationPerformanceOptionalParameter getIterationPerformanceOptionalParameter) { + public Observable> getIterationWithServiceResponseAsync(UUID projectId, UUID iterationId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } @@ -1668,38 +1693,207 @@ public Observable> getIterationPerformance if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - final Double threshold = getIterationPerformanceOptionalParameter != null ? getIterationPerformanceOptionalParameter.threshold() : null; - final Double overlapThreshold = getIterationPerformanceOptionalParameter != null ? getIterationPerformanceOptionalParameter.overlapThreshold() : null; + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getIteration(projectId, iterationId, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.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); + } + } + }); + } - return getIterationPerformanceWithServiceResponseAsync(projectId, iterationId, threshold, overlapThreshold); + private ServiceResponse getIterationDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) + .build(response); } /** - * Get detailed performance information about an iteration. + * Get iterations for the project. * - * @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 projectId The project id. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the IterationPerformance object + * @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 List<Iteration> object if successful. */ - public Observable> getIterationPerformanceWithServiceResponseAsync(UUID projectId, UUID iterationId, Double threshold, Double overlapThreshold) { + 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.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.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.client.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getIterations(projectId, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.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 CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CustomVisionErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CustomVisionErrorException.class) + .build(response); + } + + + /** + * Queues project for training. + * + * @param projectId The project id. + * @param trainProjectOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 Iteration object if successful. + */ + public Iteration trainProject(UUID projectId, TrainProjectOptionalParameter trainProjectOptionalParameter) { + return trainProjectWithServiceResponseAsync(projectId, trainProjectOptionalParameter).toBlocking().single().body(); + } + + /** + * Queues project for training. + * + * @param projectId The project id. + * @param trainProjectOptionalParameter the object representing the optional parameters to be set before calling this API + * @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, TrainProjectOptionalParameter trainProjectOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(trainProjectWithServiceResponseAsync(projectId, trainProjectOptionalParameter), serviceCallback); + } + + /** + * Queues project for training. + * + * @param projectId The project id. + * @param trainProjectOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Iteration object + */ + public Observable trainProjectAsync(UUID projectId, TrainProjectOptionalParameter trainProjectOptionalParameter) { + return trainProjectWithServiceResponseAsync(projectId, trainProjectOptionalParameter).map(new Func1, Iteration>() { + @Override + public Iteration call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Queues project for training. + * + * @param projectId The project id. + * @param trainProjectOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Iteration object + */ + public Observable> trainProjectWithServiceResponseAsync(UUID projectId, TrainProjectOptionalParameter trainProjectOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - return service.getIterationPerformance(projectId, iterationId, threshold, overlapThreshold, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + final String trainingType = trainProjectOptionalParameter != null ? trainProjectOptionalParameter.trainingType() : null; + final Integer reservedBudgetInHours = trainProjectOptionalParameter != null ? trainProjectOptionalParameter.reservedBudgetInHours() : null; + final Boolean forceTrain = trainProjectOptionalParameter != null ? trainProjectOptionalParameter.forceTrain() : null; + final String notificationEmailAddress = trainProjectOptionalParameter != null ? trainProjectOptionalParameter.notificationEmailAddress() : null; + + return trainProjectWithServiceResponseAsync(projectId, trainingType, reservedBudgetInHours, forceTrain, notificationEmailAddress); + } + + /** + * Queues project for training. + * + * @param projectId The project id. + * @param trainingType The type of training to use to train the project (default: Regular). Possible values include: 'Regular', 'Advanced' + * @param reservedBudgetInHours The number of hours reserved as budget for training (if applicable). + * @param forceTrain Whether to force train even if dataset and configuration does not change (default: false). + * @param notificationEmailAddress The email address to send notification to when training finishes (default: null). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Iteration object + */ + public Observable> trainProjectWithServiceResponseAsync(UUID projectId, String trainingType, Integer reservedBudgetInHours, Boolean forceTrain, String notificationEmailAddress) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (this.client.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.trainProject(projectId, trainingType, reservedBudgetInHours, forceTrain, notificationEmailAddress, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = getIterationPerformanceDelegate(response); + ServiceResponse clientResponse = trainProjectDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1708,70 +1902,77 @@ public Observable> call(Response getIterationPerformanceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + private ServiceResponse trainProjectDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) .build(response); } @Override - public TrainingsGetIterationPerformanceParameters getIterationPerformance() { - return new TrainingsGetIterationPerformanceParameters(this); + public TrainingsTrainProjectParameters trainProject() { + return new TrainingsTrainProjectParameters(this); } /** - * Internal class implementing TrainingsGetIterationPerformanceDefinition. + * Internal class implementing TrainingsTrainProjectDefinition. */ - class TrainingsGetIterationPerformanceParameters implements TrainingsGetIterationPerformanceDefinition { + class TrainingsTrainProjectParameters implements TrainingsTrainProjectDefinition { private TrainingsImpl parent; private UUID projectId; - private UUID iterationId; - private Double threshold; - private Double overlapThreshold; + private String trainingType; + private Integer reservedBudgetInHours; + private Boolean forceTrain; + private String notificationEmailAddress; /** * Constructor. * @param parent the parent object. */ - TrainingsGetIterationPerformanceParameters(TrainingsImpl parent) { + TrainingsTrainProjectParameters(TrainingsImpl parent) { this.parent = parent; } @Override - public TrainingsGetIterationPerformanceParameters withProjectId(UUID projectId) { + public TrainingsTrainProjectParameters withProjectId(UUID projectId) { this.projectId = projectId; return this; } @Override - public TrainingsGetIterationPerformanceParameters withIterationId(UUID iterationId) { - this.iterationId = iterationId; + public TrainingsTrainProjectParameters withTrainingType(String trainingType) { + this.trainingType = trainingType; return this; } @Override - public TrainingsGetIterationPerformanceParameters withThreshold(Double threshold) { - this.threshold = threshold; + public TrainingsTrainProjectParameters withReservedBudgetInHours(Integer reservedBudgetInHours) { + this.reservedBudgetInHours = reservedBudgetInHours; return this; } @Override - public TrainingsGetIterationPerformanceParameters withOverlapThreshold(Double overlapThreshold) { - this.overlapThreshold = overlapThreshold; + public TrainingsTrainProjectParameters withForceTrain(Boolean forceTrain) { + this.forceTrain = forceTrain; return this; } @Override - public IterationPerformance execute() { - return getIterationPerformanceWithServiceResponseAsync(projectId, iterationId, threshold, overlapThreshold).toBlocking().single().body(); + public TrainingsTrainProjectParameters withNotificationEmailAddress(String notificationEmailAddress) { + this.notificationEmailAddress = notificationEmailAddress; + return this; + } + + @Override + public Iteration execute() { + return trainProjectWithServiceResponseAsync(projectId, trainingType, reservedBudgetInHours, forceTrain, notificationEmailAddress).toBlocking().single().body(); } @Override - public Observable executeAsync() { - return getIterationPerformanceWithServiceResponseAsync(projectId, iterationId, threshold, overlapThreshold).map(new Func1, IterationPerformance>() { + public Observable executeAsync() { + return trainProjectWithServiceResponseAsync(projectId, trainingType, reservedBudgetInHours, forceTrain, notificationEmailAddress).map(new Func1, Iteration>() { @Override - public IterationPerformance call(ServiceResponse response) { + public Iteration call(ServiceResponse response) { return response.body(); } }); @@ -1779,81 +1980,78 @@ public IterationPerformance call(ServiceResponse response) } /** - * Update a specific iteration. + * Update a specific project. * - * @param projectId Project id - * @param iterationId Iteration id - * @param updatedIteration The updated iteration model + * @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 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 Iteration object if successful. + * @return the Project object if successful. */ - public Iteration updateIteration(UUID projectId, UUID iterationId, Iteration updatedIteration) { - return updateIterationWithServiceResponseAsync(projectId, iterationId, updatedIteration).toBlocking().single().body(); + public Project updateProject(UUID projectId, Project updatedProject) { + return updateProjectWithServiceResponseAsync(projectId, updatedProject).toBlocking().single().body(); } /** - * Update a specific iteration. + * Update a specific project. * - * @param projectId Project id - * @param iterationId Iteration id - * @param updatedIteration The updated iteration model + * @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 updateIterationAsync(UUID projectId, UUID iterationId, Iteration updatedIteration, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateIterationWithServiceResponseAsync(projectId, iterationId, updatedIteration), serviceCallback); + public ServiceFuture updateProjectAsync(UUID projectId, Project updatedProject, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateProjectWithServiceResponseAsync(projectId, updatedProject), serviceCallback); } /** - * Update a specific iteration. + * Update a specific project. * - * @param projectId Project id - * @param iterationId Iteration id - * @param updatedIteration The updated iteration model + * @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 Iteration object + * @return the observable to the Project object */ - public Observable updateIterationAsync(UUID projectId, UUID iterationId, Iteration updatedIteration) { - return updateIterationWithServiceResponseAsync(projectId, iterationId, updatedIteration).map(new Func1, Iteration>() { + public Observable updateProjectAsync(UUID projectId, Project updatedProject) { + return updateProjectWithServiceResponseAsync(projectId, updatedProject).map(new Func1, Project>() { @Override - public Iteration call(ServiceResponse response) { + public Project call(ServiceResponse response) { return response.body(); } }); } /** - * Update a specific iteration. + * Update a specific project. * - * @param projectId Project id - * @param iterationId Iteration id - * @param updatedIteration The updated iteration model + * @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 Iteration object + * @return the observable to the Project object */ - public Observable> updateIterationWithServiceResponseAsync(UUID projectId, UUID iterationId, Iteration updatedIteration) { + public Observable> updateProjectWithServiceResponseAsync(UUID projectId, Project updatedProject) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.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 (updatedProject == null) { + throw new IllegalArgumentException("Parameter updatedProject is required and cannot be null."); } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - Validator.validate(updatedIteration); - return service.updateIteration(projectId, iterationId, updatedIteration, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + Validator.validate(updatedProject); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.updateProject(projectId, updatedProject, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = updateIterationDelegate(response); + ServiceResponse clientResponse = updateProjectDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1862,49 +2060,46 @@ public Observable> call(Response respon }); } - private ServiceResponse updateIterationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + private ServiceResponse updateProjectDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) .build(response); } /** - * Delete a specific iteration of a project. + * Delete a specific project. * - * @param projectId The project id - * @param iterationId The iteration id + * @param projectId The project id. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws CustomVisionErrorException 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(); + public void deleteProject(UUID projectId) { + deleteProjectWithServiceResponseAsync(projectId).toBlocking().single().body(); } /** - * Delete a specific iteration of a project. + * Delete a specific project. * - * @param projectId The project id - * @param iterationId The iteration id + * @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 deleteIterationAsync(UUID projectId, UUID iterationId, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteIterationWithServiceResponseAsync(projectId, iterationId), serviceCallback); + public ServiceFuture deleteProjectAsync(UUID projectId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteProjectWithServiceResponseAsync(projectId), serviceCallback); } /** - * Delete a specific iteration of a project. + * Delete a specific project. * - * @param projectId The project id - * @param iterationId The iteration id + * @param projectId The project 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>() { + public Observable deleteProjectAsync(UUID projectId) { + return deleteProjectWithServiceResponseAsync(projectId).map(new Func1, Void>() { @Override public Void call(ServiceResponse response) { return response.body(); @@ -1913,29 +2108,29 @@ public Void call(ServiceResponse response) { } /** - * Delete a specific iteration of a project. + * Delete a specific project. * - * @param projectId The project id - * @param iterationId The iteration id + * @param projectId The project id. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ - public Observable> deleteIterationWithServiceResponseAsync(UUID projectId, UUID iterationId) { + public Observable> deleteProjectWithServiceResponseAsync(UUID projectId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.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.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - return service.deleteIteration(projectId, iterationId, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.deleteProject(projectId, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = deleteIterationDelegate(response); + ServiceResponse clientResponse = deleteProjectDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1944,81 +2139,78 @@ public Observable> call(Response response) { }); } - private ServiceResponse deleteIterationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse deleteProjectDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(204, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(CustomVisionErrorException.class) .build(response); } /** - * Get a specific iteration. + * Get a specific project. * - * @param projectId The id of the project the iteration belongs to - * @param iterationId The id of the iteration to get + * @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 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 Iteration object if successful. + * @return the Project object if successful. */ - public Iteration getIteration(UUID projectId, UUID iterationId) { - return getIterationWithServiceResponseAsync(projectId, iterationId).toBlocking().single().body(); + public Project getProject(UUID projectId) { + return getProjectWithServiceResponseAsync(projectId).toBlocking().single().body(); } /** - * Get a specific iteration. + * Get a specific project. * - * @param projectId The id of the project the iteration belongs to - * @param iterationId The id of the iteration to get + * @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 getIterationAsync(UUID projectId, UUID iterationId, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getIterationWithServiceResponseAsync(projectId, iterationId), serviceCallback); + public ServiceFuture getProjectAsync(UUID projectId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getProjectWithServiceResponseAsync(projectId), serviceCallback); } /** - * Get a specific iteration. + * Get a specific project. * - * @param projectId The id of the project the iteration belongs to - * @param iterationId The id of the iteration to get + * @param projectId The id of the project to get. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the Iteration object + * @return the observable to the Project object */ - public Observable getIterationAsync(UUID projectId, UUID iterationId) { - return getIterationWithServiceResponseAsync(projectId, iterationId).map(new Func1, Iteration>() { + public Observable getProjectAsync(UUID projectId) { + return getProjectWithServiceResponseAsync(projectId).map(new Func1, Project>() { @Override - public Iteration call(ServiceResponse response) { + public Project call(ServiceResponse response) { return response.body(); } }); } /** - * Get a specific iteration. + * Get a specific project. * - * @param projectId The id of the project the iteration belongs to - * @param iterationId The id of the iteration to get + * @param projectId The id of the project to get. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the Iteration object + * @return the observable to the Project object */ - public Observable> getIterationWithServiceResponseAsync(UUID projectId, UUID iterationId) { + public Observable> getProjectWithServiceResponseAsync(UUID projectId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.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.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - return service.getIteration(projectId, iterationId, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getProject(projectId, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = getIterationDelegate(response); + ServiceResponse clientResponse = getProjectDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -2027,74 +2219,114 @@ public Observable> call(Response respon }); } - private ServiceResponse getIterationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + private ServiceResponse getProjectDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) .build(response); } + /** - * Get iterations for the project. + * Create a project. * - * @param projectId The project id + * @param name Name of the project. + * @param createProjectOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 List<Iteration> object if successful. + * @return the Project object if successful. */ - public List getIterations(UUID projectId) { - return getIterationsWithServiceResponseAsync(projectId).toBlocking().single().body(); + public Project createProject(String name, CreateProjectOptionalParameter createProjectOptionalParameter) { + return createProjectWithServiceResponseAsync(name, createProjectOptionalParameter).toBlocking().single().body(); } /** - * Get iterations for the project. + * Create a project. * - * @param projectId The project id + * @param name Name of the project. + * @param createProjectOptionalParameter the object representing the optional parameters to be set before calling this API * @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); + public ServiceFuture createProjectAsync(String name, CreateProjectOptionalParameter createProjectOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createProjectWithServiceResponseAsync(name, createProjectOptionalParameter), serviceCallback); } /** - * Get iterations for the project. + * Create a project. * - * @param projectId The project id + * @param name Name of the project. + * @param createProjectOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<Iteration> object + * @return the observable to the Project object */ - public Observable> getIterationsAsync(UUID projectId) { - return getIterationsWithServiceResponseAsync(projectId).map(new Func1>, List>() { + public Observable createProjectAsync(String name, CreateProjectOptionalParameter createProjectOptionalParameter) { + return createProjectWithServiceResponseAsync(name, createProjectOptionalParameter).map(new Func1, Project>() { @Override - public List call(ServiceResponse> response) { + public Project call(ServiceResponse response) { return response.body(); } }); } /** - * Get iterations for the project. + * Create a project. * - * @param projectId The project id + * @param name Name of the project. + * @param createProjectOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<Iteration> object + * @return the observable to the Project object */ - public Observable>> getIterationsWithServiceResponseAsync(UUID projectId) { - if (projectId == null) { - throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + public Observable> createProjectWithServiceResponseAsync(String name, CreateProjectOptionalParameter createProjectOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - return service.getIterations(projectId, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + final String description = createProjectOptionalParameter != null ? createProjectOptionalParameter.description() : null; + final UUID domainId = createProjectOptionalParameter != null ? createProjectOptionalParameter.domainId() : null; + final String classificationType = createProjectOptionalParameter != null ? createProjectOptionalParameter.classificationType() : null; + final List targetExportPlatforms = createProjectOptionalParameter != null ? createProjectOptionalParameter.targetExportPlatforms() : null; + + return createProjectWithServiceResponseAsync(name, description, domainId, classificationType, targetExportPlatforms); + } + + /** + * 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 targetExportPlatforms List of platforms the trained model is intending exporting to. + * @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, List targetExportPlatforms) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); + } + Validator.validate(targetExportPlatforms); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + String targetExportPlatformsConverted = this.client.serializerAdapter().serializeList(targetExportPlatforms, CollectionFormat.CSV); + return service.createProject(name, description, domainId, classificationType, targetExportPlatformsConverted, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable>> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse> clientResponse = getIterationsDelegate(response); + ServiceResponse clientResponse = createProjectDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -2103,82 +2335,141 @@ public Observable>> call(Response }); } - private ServiceResponse> getIterationsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + private ServiceResponse createProjectDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) .build(response); } + @Override + public TrainingsCreateProjectParameters createProject() { + return new TrainingsCreateProjectParameters(this); + } + /** - * Update a specific project. + * Internal class implementing TrainingsCreateProjectDefinition. + */ + class TrainingsCreateProjectParameters implements TrainingsCreateProjectDefinition { + private TrainingsImpl parent; + private String name; + private String description; + private UUID domainId; + private String classificationType; + private List targetExportPlatforms; + + /** + * Constructor. + * @param parent the parent object. + */ + TrainingsCreateProjectParameters(TrainingsImpl parent) { + this.parent = parent; + } + + @Override + public TrainingsCreateProjectParameters withName(String name) { + this.name = name; + return this; + } + + @Override + public TrainingsCreateProjectParameters withDescription(String description) { + this.description = description; + return this; + } + + @Override + public TrainingsCreateProjectParameters withDomainId(UUID domainId) { + this.domainId = domainId; + return this; + } + + @Override + public TrainingsCreateProjectParameters withClassificationType(String classificationType) { + this.classificationType = classificationType; + return this; + } + + @Override + public TrainingsCreateProjectParameters withTargetExportPlatforms(List targetExportPlatforms) { + this.targetExportPlatforms = targetExportPlatforms; + return this; + } + + @Override + public Project execute() { + return createProjectWithServiceResponseAsync(name, description, domainId, classificationType, targetExportPlatforms).toBlocking().single().body(); + } + + @Override + public Observable executeAsync() { + return createProjectWithServiceResponseAsync(name, description, domainId, classificationType, targetExportPlatforms).map(new Func1, Project>() { + @Override + public Project call(ServiceResponse response) { + return response.body(); + } + }); + } + } + + /** + * Get your projects. * - * @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 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 Project object if successful. + * @return the List<Project> object if successful. */ - public Project updateProject(UUID projectId, Project updatedProject) { - return updateProjectWithServiceResponseAsync(projectId, updatedProject).toBlocking().single().body(); + public List getProjects() { + return getProjectsWithServiceResponseAsync().toBlocking().single().body(); } /** - * Update a specific project. + * Get your projects. * - * @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); + public ServiceFuture> getProjectsAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getProjectsWithServiceResponseAsync(), serviceCallback); } /** - * Update a specific project. + * Get your projects. * - * @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 + * @return the observable to the List<Project> object */ - public Observable updateProjectAsync(UUID projectId, Project updatedProject) { - return updateProjectWithServiceResponseAsync(projectId, updatedProject).map(new Func1, Project>() { + public Observable> getProjectsAsync() { + return getProjectsWithServiceResponseAsync().map(new Func1>, List>() { @Override - public Project call(ServiceResponse response) { + public List call(ServiceResponse> response) { return response.body(); } }); } /** - * Update a specific project. + * Get your projects. * - * @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 + * @return the observable to the List<Project> object */ - public Observable> updateProjectWithServiceResponseAsync(UUID projectId, Project updatedProject) { - 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."); + public Observable>> getProjectsWithServiceResponseAsync() { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - Validator.validate(updatedProject); - return service.updateProject(projectId, updatedProject, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getProjects(this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse clientResponse = updateProjectDelegate(response); + ServiceResponse> clientResponse = getProjectsDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -2187,149 +2478,134 @@ public Observable> call(Response response }); } - private ServiceResponse updateProjectDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + private ServiceResponse> getProjectsDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CustomVisionErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CustomVisionErrorException.class) .build(response); } + /** - * Delete a specific project. + * 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 projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param getImagePerformanceCountOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 int object if successful. */ - public void deleteProject(UUID projectId) { - deleteProjectWithServiceResponseAsync(projectId).toBlocking().single().body(); + public int getImagePerformanceCount(UUID projectId, UUID iterationId, GetImagePerformanceCountOptionalParameter getImagePerformanceCountOptionalParameter) { + return getImagePerformanceCountWithServiceResponseAsync(projectId, iterationId, getImagePerformanceCountOptionalParameter).toBlocking().single().body(); } /** - * Delete a specific project. + * 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 projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param getImagePerformanceCountOptionalParameter the object representing the optional parameters to be set before calling this API * @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); + public ServiceFuture getImagePerformanceCountAsync(UUID projectId, UUID iterationId, GetImagePerformanceCountOptionalParameter getImagePerformanceCountOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getImagePerformanceCountWithServiceResponseAsync(projectId, iterationId, getImagePerformanceCountOptionalParameter), serviceCallback); } /** - * Delete a specific project. + * 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 projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param getImagePerformanceCountOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the Integer object */ - public Observable deleteProjectAsync(UUID projectId) { - return deleteProjectWithServiceResponseAsync(projectId).map(new Func1, Void>() { + public Observable getImagePerformanceCountAsync(UUID projectId, UUID iterationId, GetImagePerformanceCountOptionalParameter getImagePerformanceCountOptionalParameter) { + return getImagePerformanceCountWithServiceResponseAsync(projectId, iterationId, getImagePerformanceCountOptionalParameter).map(new Func1, Integer>() { @Override - public Void call(ServiceResponse response) { + public Integer call(ServiceResponse response) { return response.body(); } }); } /** - * Delete a specific project. + * 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 projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param getImagePerformanceCountOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the Integer object */ - public Observable> deleteProjectWithServiceResponseAsync(UUID projectId) { + public Observable> getImagePerformanceCountWithServiceResponseAsync(UUID projectId, UUID iterationId, GetImagePerformanceCountOptionalParameter getImagePerformanceCountOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.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.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - return service.deleteProject(projectId, this.client.apiKey(), this.client.acceptLanguage(), this.client.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.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(204, 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); - } + final List tagIds = getImagePerformanceCountOptionalParameter != null ? getImagePerformanceCountOptionalParameter.tagIds() : null; - /** - * 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(); - } - }); + return getImagePerformanceCountWithServiceResponseAsync(projectId, iterationId, tagIds); } /** - * Get a specific project. + * 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 id of the project to get + * @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 Project object + * @return the observable to the Integer object */ - public Observable> getProjectWithServiceResponseAsync(UUID projectId) { + public Observable> getImagePerformanceCountWithServiceResponseAsync(UUID projectId, UUID iterationId, List tagIds) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.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.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - return service.getProject(projectId, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + Validator.validate(tagIds); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + String tagIdsConverted = this.client.serializerAdapter().serializeList(tagIds, CollectionFormat.CSV); + return service.getImagePerformanceCount(projectId, iterationId, tagIdsConverted, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = getProjectDelegate(response); + ServiceResponse clientResponse = getImagePerformanceCountDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -2338,103 +2614,201 @@ public Observable> call(Response response }); } - private ServiceResponse getProjectDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + private ServiceResponse getImagePerformanceCountDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) .build(response); } + @Override + public TrainingsGetImagePerformanceCountParameters getImagePerformanceCount() { + return new TrainingsGetImagePerformanceCountParameters(this); + } /** - * Create a project. + * Internal class implementing TrainingsGetImagePerformanceCountDefinition. + */ + class TrainingsGetImagePerformanceCountParameters implements TrainingsGetImagePerformanceCountDefinition { + private TrainingsImpl parent; + private UUID projectId; + private UUID iterationId; + private List tagIds; + + /** + * Constructor. + * @param parent the parent object. + */ + TrainingsGetImagePerformanceCountParameters(TrainingsImpl parent) { + this.parent = parent; + } + + @Override + public TrainingsGetImagePerformanceCountParameters withProjectId(UUID projectId) { + this.projectId = projectId; + return this; + } + + @Override + public TrainingsGetImagePerformanceCountParameters withIterationId(UUID iterationId) { + this.iterationId = iterationId; + return this; + } + + @Override + public TrainingsGetImagePerformanceCountParameters withTagIds(List tagIds) { + this.tagIds = tagIds; + return this; + } + + @Override + public int execute() { + return getImagePerformanceCountWithServiceResponseAsync(projectId, iterationId, tagIds).toBlocking().single().body(); + } + + @Override + public Observable executeAsync() { + return getImagePerformanceCountWithServiceResponseAsync(projectId, iterationId, tagIds).map(new Func1, Integer>() { + @Override + public Integer 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 name Name of the project - * @param createProjectOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param getImagePerformancesOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 Project object if successful. + * @return the List<ImagePerformance> object if successful. */ - public Project createProject(String name, CreateProjectOptionalParameter createProjectOptionalParameter) { - return createProjectWithServiceResponseAsync(name, createProjectOptionalParameter).toBlocking().single().body(); + public List getImagePerformances(UUID projectId, UUID iterationId, GetImagePerformancesOptionalParameter getImagePerformancesOptionalParameter) { + return getImagePerformancesWithServiceResponseAsync(projectId, iterationId, getImagePerformancesOptionalParameter).toBlocking().single().body(); } /** - * Create a project. + * 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 name Name of the project - * @param createProjectOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param getImagePerformancesOptionalParameter the object representing the optional parameters to be set before calling this API * @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, CreateProjectOptionalParameter createProjectOptionalParameter, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createProjectWithServiceResponseAsync(name, createProjectOptionalParameter), serviceCallback); + public ServiceFuture> getImagePerformancesAsync(UUID projectId, UUID iterationId, GetImagePerformancesOptionalParameter getImagePerformancesOptionalParameter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getImagePerformancesWithServiceResponseAsync(projectId, iterationId, getImagePerformancesOptionalParameter), serviceCallback); } /** - * Create a project. + * 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 name Name of the project - * @param createProjectOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param getImagePerformancesOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the Project object + * @return the observable to the List<ImagePerformance> object */ - public Observable createProjectAsync(String name, CreateProjectOptionalParameter createProjectOptionalParameter) { - return createProjectWithServiceResponseAsync(name, createProjectOptionalParameter).map(new Func1, Project>() { + public Observable> getImagePerformancesAsync(UUID projectId, UUID iterationId, GetImagePerformancesOptionalParameter getImagePerformancesOptionalParameter) { + return getImagePerformancesWithServiceResponseAsync(projectId, iterationId, getImagePerformancesOptionalParameter).map(new Func1>, List>() { @Override - public Project call(ServiceResponse response) { + public List call(ServiceResponse> response) { return response.body(); } }); } /** - * Create a project. + * 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 name Name of the project - * @param createProjectOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param iterationId The iteration id. Defaults to workspace. + * @param getImagePerformancesOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the Project object + * @return the observable to the List<ImagePerformance> object */ - public Observable> createProjectWithServiceResponseAsync(String name, CreateProjectOptionalParameter createProjectOptionalParameter) { - if (name == null) { - throw new IllegalArgumentException("Parameter name is required and cannot be null."); + public Observable>> getImagePerformancesWithServiceResponseAsync(UUID projectId, UUID iterationId, GetImagePerformancesOptionalParameter getImagePerformancesOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.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.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - final String description = createProjectOptionalParameter != null ? createProjectOptionalParameter.description() : null; - final UUID domainId = createProjectOptionalParameter != null ? createProjectOptionalParameter.domainId() : null; - final String classificationType = createProjectOptionalParameter != null ? createProjectOptionalParameter.classificationType() : null; + final List tagIds = getImagePerformancesOptionalParameter != null ? getImagePerformancesOptionalParameter.tagIds() : null; + final String orderBy = getImagePerformancesOptionalParameter != null ? getImagePerformancesOptionalParameter.orderBy() : null; + final Integer take = getImagePerformancesOptionalParameter != null ? getImagePerformancesOptionalParameter.take() : null; + final Integer skip = getImagePerformancesOptionalParameter != null ? getImagePerformancesOptionalParameter.skip() : null; - return createProjectWithServiceResponseAsync(name, description, domainId, classificationType); + return getImagePerformancesWithServiceResponseAsync(projectId, iterationId, tagIds, orderBy, take, skip); } /** - * Create a project. + * 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 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 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 Project object + * @return the observable to the List<ImagePerformance> object */ - public Observable> createProjectWithServiceResponseAsync(String name, String description, UUID domainId, String classificationType) { - if (name == null) { - throw new IllegalArgumentException("Parameter name is required and cannot be null."); + public Observable>> getImagePerformancesWithServiceResponseAsync(UUID projectId, UUID iterationId, List tagIds, String orderBy, Integer take, Integer skip) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.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.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - return service.createProject(name, description, domainId, classificationType, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + Validator.validate(tagIds); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + String tagIdsConverted = this.client.serializerAdapter().serializeList(tagIds, CollectionFormat.CSV); + return service.getImagePerformances(projectId, iterationId, tagIdsConverted, orderBy, take, skip, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse clientResponse = createProjectDelegate(response); + ServiceResponse> clientResponse = getImagePerformancesDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -2443,130 +2817,196 @@ public Observable> call(Response response }); } - private ServiceResponse createProjectDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + private ServiceResponse> getImagePerformancesDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CustomVisionErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CustomVisionErrorException.class) .build(response); } @Override - public TrainingsCreateProjectParameters createProject() { - return new TrainingsCreateProjectParameters(this); + public TrainingsGetImagePerformancesParameters getImagePerformances() { + return new TrainingsGetImagePerformancesParameters(this); } /** - * Internal class implementing TrainingsCreateProjectDefinition. + * Internal class implementing TrainingsGetImagePerformancesDefinition. */ - class TrainingsCreateProjectParameters implements TrainingsCreateProjectDefinition { + class TrainingsGetImagePerformancesParameters implements TrainingsGetImagePerformancesDefinition { private TrainingsImpl parent; - private String name; - private String description; - private UUID domainId; - private String classificationType; + private UUID projectId; + private UUID iterationId; + private List tagIds; + private String orderBy; + private Integer take; + private Integer skip; /** * Constructor. * @param parent the parent object. */ - TrainingsCreateProjectParameters(TrainingsImpl parent) { + TrainingsGetImagePerformancesParameters(TrainingsImpl parent) { this.parent = parent; } @Override - public TrainingsCreateProjectParameters withName(String name) { - this.name = name; + public TrainingsGetImagePerformancesParameters withProjectId(UUID projectId) { + this.projectId = projectId; return this; } @Override - public TrainingsCreateProjectParameters withDescription(String description) { - this.description = description; + public TrainingsGetImagePerformancesParameters withIterationId(UUID iterationId) { + this.iterationId = iterationId; return this; } @Override - public TrainingsCreateProjectParameters withDomainId(UUID domainId) { - this.domainId = domainId; + public TrainingsGetImagePerformancesParameters withTagIds(List tagIds) { + this.tagIds = tagIds; return this; } @Override - public TrainingsCreateProjectParameters withClassificationType(String classificationType) { - this.classificationType = classificationType; + public TrainingsGetImagePerformancesParameters withOrderBy(String orderBy) { + this.orderBy = orderBy; return this; } @Override - public Project execute() { - return createProjectWithServiceResponseAsync(name, description, domainId, classificationType).toBlocking().single().body(); + public TrainingsGetImagePerformancesParameters withTake(Integer take) { + this.take = take; + return this; + } + + @Override + public TrainingsGetImagePerformancesParameters withSkip(Integer skip) { + this.skip = skip; + return this; + } + + @Override + public List execute() { + return getImagePerformancesWithServiceResponseAsync(projectId, iterationId, tagIds, orderBy, take, skip).toBlocking().single().body(); } @Override - public Observable executeAsync() { - return createProjectWithServiceResponseAsync(name, description, domainId, classificationType).map(new Func1, Project>() { + public Observable> executeAsync() { + return getImagePerformancesWithServiceResponseAsync(projectId, iterationId, tagIds, orderBy, take, skip).map(new Func1>, List>() { @Override - public Project call(ServiceResponse response) { + public List call(ServiceResponse> response) { return response.body(); } }); } } + /** - * Get your projects. + * 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 getIterationPerformanceOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 List<Project> object if successful. + * @return the IterationPerformance object if successful. */ - public List getProjects() { - return getProjectsWithServiceResponseAsync().toBlocking().single().body(); + public IterationPerformance getIterationPerformance(UUID projectId, UUID iterationId, GetIterationPerformanceOptionalParameter getIterationPerformanceOptionalParameter) { + return getIterationPerformanceWithServiceResponseAsync(projectId, iterationId, getIterationPerformanceOptionalParameter).toBlocking().single().body(); } /** - * Get your projects. + * 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 getIterationPerformanceOptionalParameter the object representing the optional parameters to be set before calling this API * @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); + public ServiceFuture getIterationPerformanceAsync(UUID projectId, UUID iterationId, GetIterationPerformanceOptionalParameter getIterationPerformanceOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getIterationPerformanceWithServiceResponseAsync(projectId, iterationId, getIterationPerformanceOptionalParameter), serviceCallback); } /** - * Get your projects. + * 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 getIterationPerformanceOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<Project> object + * @return the observable to the IterationPerformance object */ - public Observable> getProjectsAsync() { - return getProjectsWithServiceResponseAsync().map(new Func1>, List>() { + public Observable getIterationPerformanceAsync(UUID projectId, UUID iterationId, GetIterationPerformanceOptionalParameter getIterationPerformanceOptionalParameter) { + return getIterationPerformanceWithServiceResponseAsync(projectId, iterationId, getIterationPerformanceOptionalParameter).map(new Func1, IterationPerformance>() { @Override - public List call(ServiceResponse> response) { + public IterationPerformance call(ServiceResponse response) { return response.body(); } }); } /** - * Get your projects. + * 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 getIterationPerformanceOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<Project> object + * @return the observable to the IterationPerformance object */ - public Observable>> getProjectsWithServiceResponseAsync() { + public Observable> getIterationPerformanceWithServiceResponseAsync(UUID projectId, UUID iterationId, GetIterationPerformanceOptionalParameter getIterationPerformanceOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.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.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - return service.getProjects(this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + final Double threshold = getIterationPerformanceOptionalParameter != null ? getIterationPerformanceOptionalParameter.threshold() : null; + final Double overlapThreshold = getIterationPerformanceOptionalParameter != null ? getIterationPerformanceOptionalParameter.overlapThreshold() : null; + + return getIterationPerformanceWithServiceResponseAsync(projectId, iterationId, threshold, 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 + */ + public Observable> getIterationPerformanceWithServiceResponseAsync(UUID projectId, UUID iterationId, Double threshold, Double overlapThreshold) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.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.client.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getIterationPerformance(projectId, iterationId, threshold, overlapThreshold, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable>> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse> clientResponse = getProjectsDelegate(response); + ServiceResponse clientResponse = getIterationPerformanceDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -2575,74 +3015,149 @@ public Observable>> call(Response re }); } - private ServiceResponse> getProjectsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + private ServiceResponse getIterationPerformanceDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) .build(response); } + @Override + public TrainingsGetIterationPerformanceParameters getIterationPerformance() { + return new TrainingsGetIterationPerformanceParameters(this); + } + /** - * Queues project for training. + * Internal class implementing TrainingsGetIterationPerformanceDefinition. + */ + class TrainingsGetIterationPerformanceParameters implements TrainingsGetIterationPerformanceDefinition { + private TrainingsImpl parent; + private UUID projectId; + private UUID iterationId; + private Double threshold; + private Double overlapThreshold; + + /** + * Constructor. + * @param parent the parent object. + */ + TrainingsGetIterationPerformanceParameters(TrainingsImpl parent) { + this.parent = parent; + } + + @Override + public TrainingsGetIterationPerformanceParameters withProjectId(UUID projectId) { + this.projectId = projectId; + return this; + } + + @Override + public TrainingsGetIterationPerformanceParameters withIterationId(UUID iterationId) { + this.iterationId = iterationId; + return this; + } + + @Override + public TrainingsGetIterationPerformanceParameters withThreshold(Double threshold) { + this.threshold = threshold; + return this; + } + + @Override + public TrainingsGetIterationPerformanceParameters withOverlapThreshold(Double overlapThreshold) { + this.overlapThreshold = overlapThreshold; + return this; + } + + @Override + public IterationPerformance execute() { + return getIterationPerformanceWithServiceResponseAsync(projectId, iterationId, threshold, overlapThreshold).toBlocking().single().body(); + } + + @Override + public Observable executeAsync() { + return getIterationPerformanceWithServiceResponseAsync(projectId, iterationId, threshold, overlapThreshold).map(new Func1, IterationPerformance>() { + @Override + public IterationPerformance call(ServiceResponse response) { + return response.body(); + } + }); + } + } + + /** + * Get images that were sent to your prediction endpoint. * - * @param projectId The project id + * @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 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 Iteration object if successful. + * @return the PredictionQueryResult object if successful. */ - public Iteration trainProject(UUID projectId) { - return trainProjectWithServiceResponseAsync(projectId).toBlocking().single().body(); + public PredictionQueryResult queryPredictions(UUID projectId, PredictionQueryToken query) { + return queryPredictionsWithServiceResponseAsync(projectId, query).toBlocking().single().body(); } /** - * Queues project for training. + * Get images that were sent to your prediction endpoint. * - * @param projectId The project id + * @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 trainProjectAsync(UUID projectId, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(trainProjectWithServiceResponseAsync(projectId), serviceCallback); + public ServiceFuture queryPredictionsAsync(UUID projectId, PredictionQueryToken query, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(queryPredictionsWithServiceResponseAsync(projectId, query), serviceCallback); } /** - * Queues project for training. + * Get images that were sent to your prediction endpoint. * - * @param projectId The project id + * @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 Iteration object + * @return the observable to the PredictionQueryResult object */ - public Observable trainProjectAsync(UUID projectId) { - return trainProjectWithServiceResponseAsync(projectId).map(new Func1, Iteration>() { + public Observable queryPredictionsAsync(UUID projectId, PredictionQueryToken query) { + return queryPredictionsWithServiceResponseAsync(projectId, query).map(new Func1, PredictionQueryResult>() { @Override - public Iteration call(ServiceResponse response) { + public PredictionQueryResult call(ServiceResponse response) { return response.body(); } }); } /** - * Queues project for training. + * Get images that were sent to your prediction endpoint. * - * @param projectId The project id + * @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 Iteration object + * @return the observable to the PredictionQueryResult object */ - public Observable> trainProjectWithServiceResponseAsync(UUID projectId) { + public Observable> queryPredictionsWithServiceResponseAsync(UUID projectId, PredictionQueryToken query) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.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.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - return service.trainProject(projectId, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + Validator.validate(query); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.queryPredictions(projectId, query, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = trainProjectDelegate(response); + ServiceResponse clientResponse = queryPredictionsDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -2651,10 +3166,10 @@ public Observable> call(Response respon }); } - private ServiceResponse trainProjectDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + private ServiceResponse queryPredictionsDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) .build(response); } @@ -2662,11 +3177,11 @@ private ServiceResponse trainProjectDelegate(Response r /** * Quick test an image. * - * @param projectId The project id - * @param imageData the InputStream value + * @param projectId The project id. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 6MB. * @param quickTestImageOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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. */ @@ -2677,8 +3192,8 @@ public ImagePrediction quickTestImage(UUID projectId, byte[] imageData, QuickTes /** * Quick test an image. * - * @param projectId The project id - * @param imageData the InputStream value + * @param projectId The project id. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 6MB. * @param quickTestImageOptionalParameter the object representing the optional parameters to be set before calling this API * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -2691,8 +3206,8 @@ public ServiceFuture quickTestImageAsync(UUID projectId, byte[] /** * Quick test an image. * - * @param projectId The project id - * @param imageData the InputStream value + * @param projectId The project id. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 6MB. * @param quickTestImageOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ImagePrediction object @@ -2709,13 +3224,16 @@ public ImagePrediction call(ServiceResponse response) { /** * Quick test an image. * - * @param projectId The project id - * @param imageData the InputStream value + * @param projectId The project id. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 6MB. * @param quickTestImageOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ImagePrediction object */ public Observable> quickTestImageWithServiceResponseAsync(UUID projectId, byte[] imageData, QuickTestImageOptionalParameter quickTestImageOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } @@ -2733,14 +3251,17 @@ public Observable> quickTestImageWithServiceRes /** * Quick test an image. * - * @param projectId The project id - * @param imageData the InputStream value + * @param projectId The project id. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 6MB. * @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.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } @@ -2750,8 +3271,9 @@ public Observable> quickTestImageWithServiceRes if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); RequestBody imageDataConverted = RequestBody.create(MediaType.parse("multipart/form-data"), imageData); - return service.quickTestImage(projectId, iterationId, imageDataConverted, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) + return service.quickTestImage(projectId, iterationId, imageDataConverted, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -2765,10 +3287,10 @@ public Observable> call(Response }); } - private ServiceResponse quickTestImageDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse quickTestImageDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(CustomVisionErrorException.class) .build(response); } @@ -2832,40 +3354,43 @@ public ImagePrediction call(ServiceResponse response) { /** * Quick test an image url. * - * @param projectId The project to evaluate against + * @param projectId The project to evaluate against. + * @param url Url of the image. * @param quickTestImageUrlOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 quickTestImageUrl(UUID projectId, QuickTestImageUrlOptionalParameter quickTestImageUrlOptionalParameter) { - return quickTestImageUrlWithServiceResponseAsync(projectId, quickTestImageUrlOptionalParameter).toBlocking().single().body(); + public ImagePrediction quickTestImageUrl(UUID projectId, String url, QuickTestImageUrlOptionalParameter quickTestImageUrlOptionalParameter) { + return quickTestImageUrlWithServiceResponseAsync(projectId, url, quickTestImageUrlOptionalParameter).toBlocking().single().body(); } /** * Quick test an image url. * - * @param projectId The project to evaluate against + * @param projectId The project to evaluate against. + * @param url Url of the image. * @param quickTestImageUrlOptionalParameter the object representing the optional parameters to be set before calling this API * @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, QuickTestImageUrlOptionalParameter quickTestImageUrlOptionalParameter, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(quickTestImageUrlWithServiceResponseAsync(projectId, quickTestImageUrlOptionalParameter), serviceCallback); + public ServiceFuture quickTestImageUrlAsync(UUID projectId, String url, QuickTestImageUrlOptionalParameter quickTestImageUrlOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(quickTestImageUrlWithServiceResponseAsync(projectId, url, quickTestImageUrlOptionalParameter), serviceCallback); } /** * Quick test an image url. * - * @param projectId The project to evaluate against + * @param projectId The project to evaluate against. + * @param url Url of the image. * @param quickTestImageUrlOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ImagePrediction object */ - public Observable quickTestImageUrlAsync(UUID projectId, QuickTestImageUrlOptionalParameter quickTestImageUrlOptionalParameter) { - return quickTestImageUrlWithServiceResponseAsync(projectId, quickTestImageUrlOptionalParameter).map(new Func1, ImagePrediction>() { + public Observable quickTestImageUrlAsync(UUID projectId, String url, QuickTestImageUrlOptionalParameter quickTestImageUrlOptionalParameter) { + return quickTestImageUrlWithServiceResponseAsync(projectId, url, quickTestImageUrlOptionalParameter).map(new Func1, ImagePrediction>() { @Override public ImagePrediction call(ServiceResponse response) { return response.body(); @@ -2876,44 +3401,57 @@ public ImagePrediction call(ServiceResponse response) { /** * Quick test an image url. * - * @param projectId The project to evaluate against + * @param projectId The project to evaluate against. + * @param url Url of the image. * @param quickTestImageUrlOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ImagePrediction object */ - public Observable> quickTestImageUrlWithServiceResponseAsync(UUID projectId, QuickTestImageUrlOptionalParameter quickTestImageUrlOptionalParameter) { + public Observable> quickTestImageUrlWithServiceResponseAsync(UUID projectId, String url, QuickTestImageUrlOptionalParameter quickTestImageUrlOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } + if (url == null) { + throw new IllegalArgumentException("Parameter url is required and cannot be null."); + } final UUID iterationId = quickTestImageUrlOptionalParameter != null ? quickTestImageUrlOptionalParameter.iterationId() : null; - final String url = quickTestImageUrlOptionalParameter != null ? quickTestImageUrlOptionalParameter.url() : null; - return quickTestImageUrlWithServiceResponseAsync(projectId, iterationId, url); + return quickTestImageUrlWithServiceResponseAsync(projectId, url, iterationId); } /** * Quick test an image url. * - * @param projectId The project to evaluate against + * @param projectId The project to evaluate against. + * @param url Url of the image. * @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) { + public Observable> quickTestImageUrlWithServiceResponseAsync(UUID projectId, String url, UUID iterationId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } + if (url == null) { + throw new IllegalArgumentException("Parameter url is required and cannot be null."); + } ImageUrl imageUrl = new ImageUrl(); imageUrl.withUrl(url); - return service.quickTestImageUrl(projectId, iterationId, this.client.apiKey(), this.client.acceptLanguage(), imageUrl, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.quickTestImageUrl(projectId, iterationId, this.client.apiKey(), this.client.acceptLanguage(), imageUrl, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -2927,10 +3465,10 @@ public Observable> call(Response }); } - private ServiceResponse quickTestImageUrlDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse quickTestImageUrlDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(CustomVisionErrorException.class) .build(response); } @@ -2945,8 +3483,8 @@ public TrainingsQuickTestImageUrlParameters quickTestImageUrl() { class TrainingsQuickTestImageUrlParameters implements TrainingsQuickTestImageUrlDefinition { private TrainingsImpl parent; private UUID projectId; - private UUID iterationId; private String url; + private UUID iterationId; /** * Constructor. @@ -2963,25 +3501,25 @@ public TrainingsQuickTestImageUrlParameters withProjectId(UUID projectId) { } @Override - public TrainingsQuickTestImageUrlParameters withIterationId(UUID iterationId) { - this.iterationId = iterationId; + public TrainingsQuickTestImageUrlParameters withUrl(String url) { + this.url = url; return this; } @Override - public TrainingsQuickTestImageUrlParameters withUrl(String url) { - this.url = url; + public TrainingsQuickTestImageUrlParameters withIterationId(UUID iterationId) { + this.iterationId = iterationId; return this; } @Override public ImagePrediction execute() { - return quickTestImageUrlWithServiceResponseAsync(projectId, iterationId, url).toBlocking().single().body(); + return quickTestImageUrlWithServiceResponseAsync(projectId, url, iterationId).toBlocking().single().body(); } @Override public Observable executeAsync() { - return quickTestImageUrlWithServiceResponseAsync(projectId, iterationId, url).map(new Func1, ImagePrediction>() { + return quickTestImageUrlWithServiceResponseAsync(projectId, url, iterationId).map(new Func1, ImagePrediction>() { @Override public ImagePrediction call(ServiceResponse response) { return response.body(); @@ -2991,74 +3529,78 @@ public ImagePrediction call(ServiceResponse response) { } /** - * Get images that were sent to your prediction endpoint. + * Delete a set of predicted images and their associated prediction results. * - * @param projectId The project id - * @param query Parameters used to query the predictions. Limited to combining 2 tags + * @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 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 PredictionQueryResult object if successful. */ - public PredictionQueryResult queryPredictions(UUID projectId, PredictionQueryToken query) { - return queryPredictionsWithServiceResponseAsync(projectId, query).toBlocking().single().body(); + public void deletePrediction(UUID projectId, List ids) { + deletePredictionWithServiceResponseAsync(projectId, ids).toBlocking().single().body(); } /** - * Get images that were sent to your prediction endpoint. + * Delete a set of predicted images and their associated prediction results. * - * @param projectId The project id - * @param query Parameters used to query the predictions. Limited to combining 2 tags + * @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 queryPredictionsAsync(UUID projectId, PredictionQueryToken query, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(queryPredictionsWithServiceResponseAsync(projectId, query), serviceCallback); + public ServiceFuture deletePredictionAsync(UUID projectId, List ids, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deletePredictionWithServiceResponseAsync(projectId, ids), serviceCallback); } /** - * Get images that were sent to your prediction endpoint. + * Delete a set of predicted images and their associated prediction results. * - * @param projectId The project id - * @param query Parameters used to query the predictions. Limited to combining 2 tags + * @param projectId The project id. + * @param ids The prediction ids. Limited to 64. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PredictionQueryResult object + * @return the {@link ServiceResponse} object if successful. */ - public Observable queryPredictionsAsync(UUID projectId, PredictionQueryToken query) { - return queryPredictionsWithServiceResponseAsync(projectId, query).map(new Func1, PredictionQueryResult>() { + public Observable deletePredictionAsync(UUID projectId, List ids) { + return deletePredictionWithServiceResponseAsync(projectId, ids).map(new Func1, Void>() { @Override - public PredictionQueryResult call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); } /** - * Get images that were sent to your prediction endpoint. + * Delete a set of predicted images and their associated prediction results. * - * @param projectId The project id - * @param query Parameters used to query the predictions. Limited to combining 2 tags + * @param projectId The project id. + * @param ids The prediction ids. Limited to 64. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PredictionQueryResult object + * @return the {@link ServiceResponse} object if successful. */ - public Observable> queryPredictionsWithServiceResponseAsync(UUID projectId, PredictionQueryToken query) { + public Observable> deletePredictionWithServiceResponseAsync(UUID projectId, List ids) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.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 (ids == null) { + throw new IllegalArgumentException("Parameter ids is required and cannot be null."); } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - Validator.validate(query); - return service.queryPredictions(projectId, query, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + Validator.validate(ids); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + String idsConverted = this.client.serializerAdapter().serializeList(ids, CollectionFormat.CSV); + return service.deletePrediction(projectId, idsConverted, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = queryPredictionsDelegate(response); + ServiceResponse clientResponse = deletePredictionDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -3067,82 +3609,89 @@ public Observable> call(Response queryPredictionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + private ServiceResponse deletePredictionDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) .build(response); } /** - * Delete a set of predicted images and their associated prediction results. + * 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 ids The prediction ids. Limited to 64 + * @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 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 ImageRegionProposal object if successful. */ - public void deletePrediction(UUID projectId, List ids) { - deletePredictionWithServiceResponseAsync(projectId, ids).toBlocking().single().body(); + public ImageRegionProposal getImageRegionProposals(UUID projectId, UUID imageId) { + return getImageRegionProposalsWithServiceResponseAsync(projectId, imageId).toBlocking().single().body(); } /** - * Delete a set of predicted images and their associated prediction results. + * 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 ids The prediction ids. Limited to 64 + * @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 deletePredictionAsync(UUID projectId, List ids, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deletePredictionWithServiceResponseAsync(projectId, ids), serviceCallback); + public ServiceFuture getImageRegionProposalsAsync(UUID projectId, UUID imageId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getImageRegionProposalsWithServiceResponseAsync(projectId, imageId), serviceCallback); } /** - * Delete a set of predicted images and their associated prediction results. + * 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 ids The prediction ids. Limited to 64 + * @param projectId The project id. + * @param imageId The image id. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the ImageRegionProposal object */ - public Observable deletePredictionAsync(UUID projectId, List ids) { - return deletePredictionWithServiceResponseAsync(projectId, ids).map(new Func1, Void>() { + public Observable getImageRegionProposalsAsync(UUID projectId, UUID imageId) { + return getImageRegionProposalsWithServiceResponseAsync(projectId, imageId).map(new Func1, ImageRegionProposal>() { @Override - public Void call(ServiceResponse response) { + public ImageRegionProposal call(ServiceResponse response) { return response.body(); } }); } /** - * Delete a set of predicted images and their associated prediction results. + * 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 ids The prediction ids. Limited to 64 + * @param projectId The project id. + * @param imageId The image id. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the ImageRegionProposal object */ - public Observable> deletePredictionWithServiceResponseAsync(UUID projectId, List ids) { + public Observable> getImageRegionProposalsWithServiceResponseAsync(UUID projectId, UUID imageId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.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 (imageId == null) { + throw new IllegalArgumentException("Parameter imageId is required and cannot be null."); } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - Validator.validate(ids); - String idsConverted = this.client.serializerAdapter().serializeList(ids, CollectionFormat.CSV); - return service.deletePrediction(projectId, idsConverted, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getImageRegionProposals(projectId, imageId, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = deletePredictionDelegate(response); + ServiceResponse clientResponse = getImageRegionProposalsDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -3151,85 +3700,90 @@ public Observable> call(Response response) { }); } - private ServiceResponse deletePredictionDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(204, new TypeToken() { }.getType()) - .registerError(CloudException.class) + private ServiceResponse getImageRegionProposalsDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.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. + * 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 imageId The image id + * @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 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 ImageRegionProposal object if successful. + * @return the ImageCreateSummary object if successful. */ - public ImageRegionProposal getImageRegionProposals(UUID projectId, UUID imageId) { - return getImageRegionProposalsWithServiceResponseAsync(projectId, imageId).toBlocking().single().body(); + public ImageCreateSummary createImagesFromPredictions(UUID projectId, ImageIdCreateBatch batch) { + return createImagesFromPredictionsWithServiceResponseAsync(projectId, batch).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. + * 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 imageId The image id + * @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 getImageRegionProposalsAsync(UUID projectId, UUID imageId, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getImageRegionProposalsWithServiceResponseAsync(projectId, imageId), serviceCallback); + public ServiceFuture createImagesFromPredictionsAsync(UUID projectId, ImageIdCreateBatch batch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createImagesFromPredictionsWithServiceResponseAsync(projectId, batch), 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. + * 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 imageId The image id + * @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 ImageRegionProposal object + * @return the observable to the ImageCreateSummary object */ - public Observable getImageRegionProposalsAsync(UUID projectId, UUID imageId) { - return getImageRegionProposalsWithServiceResponseAsync(projectId, imageId).map(new Func1, ImageRegionProposal>() { + public Observable createImagesFromPredictionsAsync(UUID projectId, ImageIdCreateBatch batch) { + return createImagesFromPredictionsWithServiceResponseAsync(projectId, batch).map(new Func1, ImageCreateSummary>() { @Override - public ImageRegionProposal call(ServiceResponse response) { + public ImageCreateSummary 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. + * 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 imageId The image id + * @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 ImageRegionProposal object + * @return the observable to the ImageCreateSummary object */ - public Observable> getImageRegionProposalsWithServiceResponseAsync(UUID projectId, UUID imageId) { + public Observable> createImagesFromPredictionsWithServiceResponseAsync(UUID projectId, ImageIdCreateBatch batch) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.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 (batch == null) { + throw new IllegalArgumentException("Parameter batch is required and cannot be null."); } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - return service.getImageRegionProposals(projectId, imageId, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + Validator.validate(batch); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.createImagesFromPredictions(projectId, batch, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = getImageRegionProposalsDelegate(response); + ServiceResponse clientResponse = createImagesFromPredictionsDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -3238,82 +3792,90 @@ public Observable> call(Response getImageRegionProposalsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + private ServiceResponse createImagesFromPredictionsDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) .build(response); } /** - * Delete a set of image regions. + * 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 regionIds Regions to delete. Limited to 64 + * @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 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 ImageCreateSummary object if successful. */ - public void deleteImageRegions(UUID projectId, List regionIds) { - deleteImageRegionsWithServiceResponseAsync(projectId, regionIds).toBlocking().single().body(); + public ImageCreateSummary createImagesFromUrls(UUID projectId, ImageUrlCreateBatch batch) { + return createImagesFromUrlsWithServiceResponseAsync(projectId, batch).toBlocking().single().body(); } /** - * Delete a set of image regions. + * 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 regionIds Regions to delete. Limited to 64 + * @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 deleteImageRegionsAsync(UUID projectId, List regionIds, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteImageRegionsWithServiceResponseAsync(projectId, regionIds), serviceCallback); + public ServiceFuture createImagesFromUrlsAsync(UUID projectId, ImageUrlCreateBatch batch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createImagesFromUrlsWithServiceResponseAsync(projectId, batch), serviceCallback); } /** - * Delete a set of image regions. + * 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 regionIds Regions to delete. Limited to 64 + * @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 {@link ServiceResponse} object if successful. + * @return the observable to the ImageCreateSummary object */ - public Observable deleteImageRegionsAsync(UUID projectId, List regionIds) { - return deleteImageRegionsWithServiceResponseAsync(projectId, regionIds).map(new Func1, Void>() { + public Observable createImagesFromUrlsAsync(UUID projectId, ImageUrlCreateBatch batch) { + return createImagesFromUrlsWithServiceResponseAsync(projectId, batch).map(new Func1, ImageCreateSummary>() { @Override - public Void call(ServiceResponse response) { + public ImageCreateSummary call(ServiceResponse response) { return response.body(); } }); } /** - * Delete a set of image regions. + * 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 regionIds Regions to delete. Limited to 64 + * @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 {@link ServiceResponse} object if successful. + * @return the observable to the ImageCreateSummary object */ - public Observable> deleteImageRegionsWithServiceResponseAsync(UUID projectId, List regionIds) { + public Observable> createImagesFromUrlsWithServiceResponseAsync(UUID projectId, ImageUrlCreateBatch batch) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.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 (batch == null) { + throw new IllegalArgumentException("Parameter batch is required and cannot be null."); } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - Validator.validate(regionIds); - String regionIdsConverted = this.client.serializerAdapter().serializeList(regionIds, CollectionFormat.CSV); - return service.deleteImageRegions(projectId, regionIdsConverted, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + Validator.validate(batch); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.createImagesFromUrls(projectId, batch, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = deleteImageRegionsDelegate(response); + ServiceResponse clientResponse = createImagesFromUrlsDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -3322,112 +3884,90 @@ public Observable> call(Response response) { }); } - private ServiceResponse deleteImageRegionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(204, new TypeToken() { }.getType()) - .registerError(CloudException.class) + private ServiceResponse createImagesFromUrlsDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.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. + * 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 createImageRegionsOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 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 ImageRegionCreateSummary object if successful. + * @return the ImageCreateSummary object if successful. */ - public ImageRegionCreateSummary createImageRegions(UUID projectId, CreateImageRegionsOptionalParameter createImageRegionsOptionalParameter) { - return createImageRegionsWithServiceResponseAsync(projectId, createImageRegionsOptionalParameter).toBlocking().single().body(); + public ImageCreateSummary createImagesFromFiles(UUID projectId, ImageFileCreateBatch batch) { + return createImagesFromFilesWithServiceResponseAsync(projectId, batch).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. + * 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 createImageRegionsOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 createImageRegionsAsync(UUID projectId, CreateImageRegionsOptionalParameter createImageRegionsOptionalParameter, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createImageRegionsWithServiceResponseAsync(projectId, createImageRegionsOptionalParameter), serviceCallback); + public ServiceFuture createImagesFromFilesAsync(UUID projectId, ImageFileCreateBatch batch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createImagesFromFilesWithServiceResponseAsync(projectId, batch), 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. + * 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 createImageRegionsOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 ImageRegionCreateSummary object + * @return the observable to the ImageCreateSummary object */ - public Observable createImageRegionsAsync(UUID projectId, CreateImageRegionsOptionalParameter createImageRegionsOptionalParameter) { - return createImageRegionsWithServiceResponseAsync(projectId, createImageRegionsOptionalParameter).map(new Func1, ImageRegionCreateSummary>() { + public Observable createImagesFromFilesAsync(UUID projectId, ImageFileCreateBatch batch) { + return createImagesFromFilesWithServiceResponseAsync(projectId, batch).map(new Func1, ImageCreateSummary>() { @Override - public ImageRegionCreateSummary call(ServiceResponse response) { + public ImageCreateSummary 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. + * 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 createImageRegionsOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 ImageRegionCreateSummary object + * @return the observable to the ImageCreateSummary object */ - public Observable> createImageRegionsWithServiceResponseAsync(UUID projectId, CreateImageRegionsOptionalParameter createImageRegionsOptionalParameter) { - if (projectId == null) { - throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); - } - if (this.client.apiKey() == null) { - throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); + public Observable> createImagesFromFilesWithServiceResponseAsync(UUID projectId, ImageFileCreateBatch batch) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } - final List regions = createImageRegionsOptionalParameter != null ? createImageRegionsOptionalParameter.regions() : null; - - return createImageRegionsWithServiceResponseAsync(projectId, 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 - */ - public Observable> createImageRegionsWithServiceResponseAsync(UUID projectId, List regions) { 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.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - Validator.validate(regions); - ImageRegionCreateBatch batch = new ImageRegionCreateBatch(); - batch.withRegions(regions); - return service.createImageRegions(projectId, this.client.apiKey(), this.client.acceptLanguage(), batch, this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + Validator.validate(batch); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.createImagesFromFiles(projectId, batch, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = createImageRegionsDelegate(response); + ServiceResponse clientResponse = createImagesFromFilesDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -3436,101 +3976,49 @@ public Observable> call(Response createImageRegionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + private ServiceResponse createImagesFromFilesDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) .build(response); } - @Override - public TrainingsCreateImageRegionsParameters createImageRegions() { - return new TrainingsCreateImageRegionsParameters(this); + /** + * 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 CustomVisionErrorException 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(); } /** - * Internal class implementing TrainingsCreateImageRegionsDefinition. + * 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 */ - class TrainingsCreateImageRegionsParameters implements TrainingsCreateImageRegionsDefinition { - private TrainingsImpl parent; - private UUID projectId; - private List regions; - - /** - * Constructor. - * @param parent the parent object. - */ - TrainingsCreateImageRegionsParameters(TrainingsImpl parent) { - this.parent = parent; - } - - @Override - public TrainingsCreateImageRegionsParameters withProjectId(UUID projectId) { - this.projectId = projectId; - return this; - } - - @Override - public TrainingsCreateImageRegionsParameters withRegions(List regions) { - this.regions = regions; - return this; - } - - @Override - public ImageRegionCreateSummary execute() { - return createImageRegionsWithServiceResponseAsync(projectId, regions).toBlocking().single().body(); - } - - @Override - public Observable executeAsync() { - return createImageRegionsWithServiceResponseAsync(projectId, regions).map(new Func1, ImageRegionCreateSummary>() { - @Override - public ImageRegionCreateSummary 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. Limted 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. Limted 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); - } + public ServiceFuture deleteImagesAsync(UUID projectId, List imageIds, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteImagesWithServiceResponseAsync(projectId, imageIds), serviceCallback); + } /** - * Remove a set of tags from a set of images. + * Delete images from the set of training images. * - * @param projectId The project id - * @param imageIds Image ids. Limited to 64 images - * @param tagIds Tags to be deleted from the specified images. Limted to 20 tags + * @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 deleteImageTagsAsync(UUID projectId, List imageIds, List tagIds) { - return deleteImageTagsWithServiceResponseAsync(projectId, imageIds, tagIds).map(new Func1, Void>() { + public Observable deleteImagesAsync(UUID projectId, List imageIds) { + return deleteImagesWithServiceResponseAsync(projectId, imageIds).map(new Func1, Void>() { @Override public Void call(ServiceResponse response) { return response.body(); @@ -3539,37 +4027,35 @@ public Void call(ServiceResponse response) { } /** - * Remove a set of tags from a set of images. + * Delete images from the set of training images. * - * @param projectId The project id - * @param imageIds Image ids. Limited to 64 images - * @param tagIds Tags to be deleted from the specified images. Limted to 20 tags + * @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> deleteImageTagsWithServiceResponseAsync(UUID projectId, List imageIds, List tagIds) { + public Observable> deleteImagesWithServiceResponseAsync(UUID projectId, List imageIds) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.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.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } Validator.validate(imageIds); - Validator.validate(tagIds); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); String imageIdsConverted = this.client.serializerAdapter().serializeList(imageIds, CollectionFormat.CSV); - String tagIdsConverted = this.client.serializerAdapter().serializeList(tagIds, CollectionFormat.CSV); - return service.deleteImageTags(projectId, imageIdsConverted, tagIdsConverted, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) + return service.deleteImages(projectId, imageIdsConverted, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = deleteImageTagsDelegate(response); + ServiceResponse clientResponse = deleteImagesDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -3578,102 +4064,130 @@ public Observable> call(Response response) { }); } - private ServiceResponse deleteImageTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse deleteImagesDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(204, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(CustomVisionErrorException.class) .build(response); } /** - * Associate a set of images with a set of tags. + * 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 createImageTagsOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 6MB. + * @param createImagesFromDataOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 ImageTagCreateSummary object if successful. + * @return the ImageCreateSummary object if successful. */ - public ImageTagCreateSummary createImageTags(UUID projectId, CreateImageTagsOptionalParameter createImageTagsOptionalParameter) { - return createImageTagsWithServiceResponseAsync(projectId, createImageTagsOptionalParameter).toBlocking().single().body(); + public ImageCreateSummary createImagesFromData(UUID projectId, byte[] imageData, CreateImagesFromDataOptionalParameter createImagesFromDataOptionalParameter) { + return createImagesFromDataWithServiceResponseAsync(projectId, imageData, createImagesFromDataOptionalParameter).toBlocking().single().body(); } /** - * Associate a set of images with a set of tags. + * 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 createImageTagsOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 6MB. + * @param createImagesFromDataOptionalParameter the object representing the optional parameters to be set before calling this API * @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, CreateImageTagsOptionalParameter createImageTagsOptionalParameter, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createImageTagsWithServiceResponseAsync(projectId, createImageTagsOptionalParameter), serviceCallback); + public ServiceFuture createImagesFromDataAsync(UUID projectId, byte[] imageData, CreateImagesFromDataOptionalParameter createImagesFromDataOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createImagesFromDataWithServiceResponseAsync(projectId, imageData, createImagesFromDataOptionalParameter), serviceCallback); } /** - * Associate a set of images with a set of tags. + * 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 createImageTagsOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 6MB. + * @param createImagesFromDataOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ImageTagCreateSummary object + * @return the observable to the ImageCreateSummary object */ - public Observable createImageTagsAsync(UUID projectId, CreateImageTagsOptionalParameter createImageTagsOptionalParameter) { - return createImageTagsWithServiceResponseAsync(projectId, createImageTagsOptionalParameter).map(new Func1, ImageTagCreateSummary>() { + public Observable createImagesFromDataAsync(UUID projectId, byte[] imageData, CreateImagesFromDataOptionalParameter createImagesFromDataOptionalParameter) { + return createImagesFromDataWithServiceResponseAsync(projectId, imageData, createImagesFromDataOptionalParameter).map(new Func1, ImageCreateSummary>() { @Override - public ImageTagCreateSummary call(ServiceResponse response) { + public ImageCreateSummary call(ServiceResponse response) { return response.body(); } }); } /** - * Associate a set of images with a set of tags. + * 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 createImageTagsOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 6MB. + * @param createImagesFromDataOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ImageTagCreateSummary object + * @return the observable to the ImageCreateSummary object */ - public Observable> createImageTagsWithServiceResponseAsync(UUID projectId, CreateImageTagsOptionalParameter createImageTagsOptionalParameter) { + public Observable> createImagesFromDataWithServiceResponseAsync(UUID projectId, byte[] imageData, CreateImagesFromDataOptionalParameter createImagesFromDataOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.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.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - final List tags = createImageTagsOptionalParameter != null ? createImageTagsOptionalParameter.tags() : null; + final List tagIds = createImagesFromDataOptionalParameter != null ? createImagesFromDataOptionalParameter.tagIds() : null; - return createImageTagsWithServiceResponseAsync(projectId, tags); + return createImagesFromDataWithServiceResponseAsync(projectId, imageData, tagIds); } /** - * Associate a set of images with a set of tags. + * 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 tags the List<ImageTagCreateEntry> value + * @param projectId The project id. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 6MB. + * @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 ImageTagCreateSummary object + * @return the observable to the ImageCreateSummary object */ - public Observable> createImageTagsWithServiceResponseAsync(UUID projectId, List tags) { + public Observable> createImagesFromDataWithServiceResponseAsync(UUID projectId, byte[] imageData, List tagIds) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.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.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - Validator.validate(tags); - ImageTagCreateBatch batch = new ImageTagCreateBatch(); - batch.withTags(tags); - return service.createImageTags(projectId, this.client.apiKey(), this.client.acceptLanguage(), batch, this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + Validator.validate(tagIds); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + String tagIdsConverted = this.client.serializerAdapter().serializeList(tagIds, CollectionFormat.CSV); + RequestBody imageDataConverted = RequestBody.create(MediaType.parse("multipart/form-data"), imageData); + return service.createImagesFromData(projectId, tagIdsConverted, imageDataConverted, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = createImageTagsDelegate(response); + ServiceResponse clientResponse = createImagesFromDataDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -3682,135 +4196,176 @@ public Observable> call(Response createImageTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + private ServiceResponse createImagesFromDataDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) .build(response); } @Override - public TrainingsCreateImageTagsParameters createImageTags() { - return new TrainingsCreateImageTagsParameters(this); + public TrainingsCreateImagesFromDataParameters createImagesFromData() { + return new TrainingsCreateImagesFromDataParameters(this); } /** - * Internal class implementing TrainingsCreateImageTagsDefinition. + * Internal class implementing TrainingsCreateImagesFromDataDefinition. */ - class TrainingsCreateImageTagsParameters implements TrainingsCreateImageTagsDefinition { + class TrainingsCreateImagesFromDataParameters implements TrainingsCreateImagesFromDataDefinition { private TrainingsImpl parent; private UUID projectId; - private List tags; + private byte[] imageData; + private List tagIds; /** * Constructor. * @param parent the parent object. */ - TrainingsCreateImageTagsParameters(TrainingsImpl parent) { + TrainingsCreateImagesFromDataParameters(TrainingsImpl parent) { this.parent = parent; } @Override - public TrainingsCreateImageTagsParameters withProjectId(UUID projectId) { + public TrainingsCreateImagesFromDataParameters withProjectId(UUID projectId) { this.projectId = projectId; return this; } @Override - public TrainingsCreateImageTagsParameters withTags(List tags) { - this.tags = tags; + public TrainingsCreateImagesFromDataParameters withImageData(byte[] imageData) { + this.imageData = imageData; return this; } @Override - public ImageTagCreateSummary execute() { - return createImageTagsWithServiceResponseAsync(projectId, tags).toBlocking().single().body(); + public TrainingsCreateImagesFromDataParameters withTagIds(List tagIds) { + this.tagIds = tagIds; + return this; + } + + @Override + public ImageCreateSummary execute() { + return createImagesFromDataWithServiceResponseAsync(projectId, imageData, tagIds).toBlocking().single().body(); } @Override - public Observable executeAsync() { - return createImageTagsWithServiceResponseAsync(projectId, tags).map(new Func1, ImageTagCreateSummary>() { + public Observable executeAsync() { + return createImagesFromDataWithServiceResponseAsync(projectId, imageData, tagIds).map(new Func1, ImageCreateSummary>() { @Override - public ImageTagCreateSummary call(ServiceResponse response) { + 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. + * 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 batch Image and tag ids. Limted to 64 images and 20 tags per batch + * @param projectId The project id. + * @param getImagesByIdsOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 ImageCreateSummary object if successful. + * @return the List<Image> object if successful. */ - public ImageCreateSummary createImagesFromPredictions(UUID projectId, ImageIdCreateBatch batch) { - return createImagesFromPredictionsWithServiceResponseAsync(projectId, batch).toBlocking().single().body(); + public List getImagesByIds(UUID projectId, GetImagesByIdsOptionalParameter getImagesByIdsOptionalParameter) { + return getImagesByIdsWithServiceResponseAsync(projectId, getImagesByIdsOptionalParameter).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. + * 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 batch Image and tag ids. Limted to 64 images and 20 tags per batch + * @param projectId The project id. + * @param getImagesByIdsOptionalParameter the object representing the optional parameters to be set before calling this API * @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); + public ServiceFuture> getImagesByIdsAsync(UUID projectId, GetImagesByIdsOptionalParameter getImagesByIdsOptionalParameter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getImagesByIdsWithServiceResponseAsync(projectId, getImagesByIdsOptionalParameter), 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. + * 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 batch Image and tag ids. Limted to 64 images and 20 tags per batch + * @param projectId The project id. + * @param getImagesByIdsOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ImageCreateSummary object + * @return the observable to the List<Image> object */ - public Observable createImagesFromPredictionsAsync(UUID projectId, ImageIdCreateBatch batch) { - return createImagesFromPredictionsWithServiceResponseAsync(projectId, batch).map(new Func1, ImageCreateSummary>() { + public Observable> getImagesByIdsAsync(UUID projectId, GetImagesByIdsOptionalParameter getImagesByIdsOptionalParameter) { + return getImagesByIdsWithServiceResponseAsync(projectId, getImagesByIdsOptionalParameter).map(new Func1>, List>() { @Override - public ImageCreateSummary call(ServiceResponse response) { + public List 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. + * 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 batch Image and tag ids. Limted to 64 images and 20 tags per batch + * @param projectId The project id. + * @param getImagesByIdsOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ImageCreateSummary object + * @return the observable to the List<Image> object */ - public Observable> createImagesFromPredictionsWithServiceResponseAsync(UUID projectId, ImageIdCreateBatch batch) { + public Observable>> getImagesByIdsWithServiceResponseAsync(UUID projectId, GetImagesByIdsOptionalParameter getImagesByIdsOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.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.client.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); + } + final List imageIds = getImagesByIdsOptionalParameter != null ? getImagesByIdsOptionalParameter.imageIds() : null; + final UUID iterationId = getImagesByIdsOptionalParameter != null ? getImagesByIdsOptionalParameter.iterationId() : null; + + return getImagesByIdsWithServiceResponseAsync(projectId, imageIds, 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 + */ + public Observable>> getImagesByIdsWithServiceResponseAsync(UUID projectId, List imageIds, UUID iterationId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - Validator.validate(batch); - return service.createImagesFromPredictions(projectId, batch, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + Validator.validate(imageIds); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + String imageIdsConverted = this.client.serializerAdapter().serializeList(imageIds, CollectionFormat.CSV); + return service.getImagesByIds(projectId, imageIdsConverted, iterationId, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse clientResponse = createImagesFromPredictionsDelegate(response); + ServiceResponse> clientResponse = getImagesByIdsDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -3819,174 +4374,178 @@ public Observable> call(Response createImagesFromPredictionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + private ServiceResponse> getImagesByIdsDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CustomVisionErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CustomVisionErrorException.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(); + @Override + public TrainingsGetImagesByIdsParameters getImagesByIds() { + return new TrainingsGetImagesByIdsParameters(this); } /** - * 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 + * Internal class implementing TrainingsGetImagesByIdsDefinition. */ - public ServiceFuture createImagesFromUrlsAsync(UUID projectId, ImageUrlCreateBatch batch, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createImagesFromUrlsWithServiceResponseAsync(projectId, batch), serviceCallback); - } + class TrainingsGetImagesByIdsParameters implements TrainingsGetImagesByIdsDefinition { + private TrainingsImpl parent; + private UUID projectId; + private List imageIds; + private UUID iterationId; - /** - * 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(); - } - }); - } + /** + * Constructor. + * @param parent the parent object. + */ + TrainingsGetImagesByIdsParameters(TrainingsImpl parent) { + this.parent = parent; + } - /** - * 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 (projectId == null) { - throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + @Override + public TrainingsGetImagesByIdsParameters withProjectId(UUID projectId) { + this.projectId = projectId; + return this; } - if (batch == null) { - throw new IllegalArgumentException("Parameter batch is required and cannot be null."); + + @Override + public TrainingsGetImagesByIdsParameters withImageIds(List imageIds) { + this.imageIds = imageIds; + return this; } - if (this.client.apiKey() == null) { - throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); + + @Override + public TrainingsGetImagesByIdsParameters withIterationId(UUID iterationId) { + this.iterationId = iterationId; + return this; } - Validator.validate(batch); - return service.createImagesFromUrls(projectId, batch, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + + @Override + public List execute() { + return getImagesByIdsWithServiceResponseAsync(projectId, imageIds, iterationId).toBlocking().single().body(); + } + + @Override + public Observable> executeAsync() { + return getImagesByIdsWithServiceResponseAsync(projectId, imageIds, iterationId).map(new Func1>, List>() { @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = createImagesFromUrlsDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } + public List call(ServiceResponse> response) { + return response.body(); } }); + } } - private ServiceResponse createImagesFromUrlsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, 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. + * 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 batch The batch of image files to add. Limited to 64 images and 20 tags per batch + * @param projectId The project id. + * @param getUntaggedImagesOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 ImageCreateSummary object if successful. + * @return the List<Image> object if successful. */ - public ImageCreateSummary createImagesFromFiles(UUID projectId, ImageFileCreateBatch batch) { - return createImagesFromFilesWithServiceResponseAsync(projectId, batch).toBlocking().single().body(); + public List getUntaggedImages(UUID projectId, GetUntaggedImagesOptionalParameter getUntaggedImagesOptionalParameter) { + return getUntaggedImagesWithServiceResponseAsync(projectId, getUntaggedImagesOptionalParameter).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. + * 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 batch The batch of image files to add. Limited to 64 images and 20 tags per batch + * @param projectId The project id. + * @param getUntaggedImagesOptionalParameter the object representing the optional parameters to be set before calling this API * @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); + public ServiceFuture> getUntaggedImagesAsync(UUID projectId, GetUntaggedImagesOptionalParameter getUntaggedImagesOptionalParameter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getUntaggedImagesWithServiceResponseAsync(projectId, getUntaggedImagesOptionalParameter), 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. + * 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 batch The batch of image files to add. Limited to 64 images and 20 tags per batch + * @param projectId The project id. + * @param getUntaggedImagesOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ImageCreateSummary object + * @return the observable to the List<Image> object */ - public Observable createImagesFromFilesAsync(UUID projectId, ImageFileCreateBatch batch) { - return createImagesFromFilesWithServiceResponseAsync(projectId, batch).map(new Func1, ImageCreateSummary>() { + public Observable> getUntaggedImagesAsync(UUID projectId, GetUntaggedImagesOptionalParameter getUntaggedImagesOptionalParameter) { + return getUntaggedImagesWithServiceResponseAsync(projectId, getUntaggedImagesOptionalParameter).map(new Func1>, List>() { @Override - public ImageCreateSummary call(ServiceResponse response) { + public List 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. + * 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 batch The batch of image files to add. Limited to 64 images and 20 tags per batch + * @param projectId The project id. + * @param getUntaggedImagesOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ImageCreateSummary object + * @return the observable to the List<Image> object */ - public Observable> createImagesFromFilesWithServiceResponseAsync(UUID projectId, ImageFileCreateBatch batch) { + public Observable>> getUntaggedImagesWithServiceResponseAsync(UUID projectId, GetUntaggedImagesOptionalParameter getUntaggedImagesOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.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.client.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); + } + final UUID iterationId = getUntaggedImagesOptionalParameter != null ? getUntaggedImagesOptionalParameter.iterationId() : null; + final String orderBy = getUntaggedImagesOptionalParameter != null ? getUntaggedImagesOptionalParameter.orderBy() : null; + final Integer take = getUntaggedImagesOptionalParameter != null ? getUntaggedImagesOptionalParameter.take() : null; + final Integer skip = getUntaggedImagesOptionalParameter != null ? getUntaggedImagesOptionalParameter.skip() : null; + + return getUntaggedImagesWithServiceResponseAsync(projectId, iterationId, orderBy, take, 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 + */ + public Observable>> getUntaggedImagesWithServiceResponseAsync(UUID projectId, UUID iterationId, String orderBy, Integer take, Integer skip) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - Validator.validate(batch); - return service.createImagesFromFiles(projectId, batch, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getUntaggedImages(projectId, iterationId, orderBy, take, skip, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse clientResponse = createImagesFromFilesDelegate(response); + ServiceResponse> clientResponse = getUntaggedImagesDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -3995,207 +4554,206 @@ public Observable> call(Response createImagesFromFilesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + private ServiceResponse> getUntaggedImagesDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CustomVisionErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CustomVisionErrorException.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. Limted 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(); + @Override + public TrainingsGetUntaggedImagesParameters getUntaggedImages() { + return new TrainingsGetUntaggedImagesParameters(this); } /** - * Delete images from the set of training images. - * - * @param projectId The project id - * @param imageIds Ids of the images to be deleted. Limted 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 + * Internal class implementing TrainingsGetUntaggedImagesDefinition. */ - public ServiceFuture deleteImagesAsync(UUID projectId, List imageIds, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteImagesWithServiceResponseAsync(projectId, imageIds), serviceCallback); - } + class TrainingsGetUntaggedImagesParameters implements TrainingsGetUntaggedImagesDefinition { + private TrainingsImpl parent; + private UUID projectId; + private UUID iterationId; + private String orderBy; + private Integer take; + private Integer skip; - /** - * Delete images from the set of training images. - * - * @param projectId The project id - * @param imageIds Ids of the images to be deleted. Limted 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(); - } - }); - } + /** + * Constructor. + * @param parent the parent object. + */ + TrainingsGetUntaggedImagesParameters(TrainingsImpl parent) { + this.parent = parent; + } - /** - * Delete images from the set of training images. - * - * @param projectId The project id - * @param imageIds Ids of the images to be deleted. Limted 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 (projectId == null) { - throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + @Override + public TrainingsGetUntaggedImagesParameters withProjectId(UUID projectId) { + this.projectId = projectId; + return this; } - if (imageIds == null) { - throw new IllegalArgumentException("Parameter imageIds is required and cannot be null."); + + @Override + public TrainingsGetUntaggedImagesParameters withIterationId(UUID iterationId) { + this.iterationId = iterationId; + return this; } - if (this.client.apiKey() == null) { - throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); + + @Override + public TrainingsGetUntaggedImagesParameters withOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; } - Validator.validate(imageIds); - String imageIdsConverted = this.client.serializerAdapter().serializeList(imageIds, CollectionFormat.CSV); - return service.deleteImages(projectId, imageIdsConverted, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + + @Override + public TrainingsGetUntaggedImagesParameters withTake(Integer take) { + this.take = take; + return this; + } + + @Override + public TrainingsGetUntaggedImagesParameters withSkip(Integer skip) { + this.skip = skip; + return this; + } + + @Override + public List execute() { + return getUntaggedImagesWithServiceResponseAsync(projectId, iterationId, orderBy, take, skip).toBlocking().single().body(); + } + + @Override + public Observable> executeAsync() { + return getUntaggedImagesWithServiceResponseAsync(projectId, iterationId, orderBy, take, skip).map(new Func1>, List>() { @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = deleteImagesDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } + public List call(ServiceResponse> response) { + return response.body(); } }); - } - - private ServiceResponse deleteImagesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(204, 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. + * 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 imageData the InputStream value - * @param createImagesFromDataOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param getTaggedImagesOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 ImageCreateSummary object if successful. + * @return the List<Image> object if successful. */ - public ImageCreateSummary createImagesFromData(UUID projectId, byte[] imageData, CreateImagesFromDataOptionalParameter createImagesFromDataOptionalParameter) { - return createImagesFromDataWithServiceResponseAsync(projectId, imageData, createImagesFromDataOptionalParameter).toBlocking().single().body(); + public List getTaggedImages(UUID projectId, GetTaggedImagesOptionalParameter getTaggedImagesOptionalParameter) { + return getTaggedImagesWithServiceResponseAsync(projectId, getTaggedImagesOptionalParameter).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. + * 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 imageData the InputStream value - * @param createImagesFromDataOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param getTaggedImagesOptionalParameter the object representing the optional parameters to be set before calling this API * @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, CreateImagesFromDataOptionalParameter createImagesFromDataOptionalParameter, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createImagesFromDataWithServiceResponseAsync(projectId, imageData, createImagesFromDataOptionalParameter), serviceCallback); + public ServiceFuture> getTaggedImagesAsync(UUID projectId, GetTaggedImagesOptionalParameter getTaggedImagesOptionalParameter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getTaggedImagesWithServiceResponseAsync(projectId, getTaggedImagesOptionalParameter), 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. + * 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 imageData the InputStream value - * @param createImagesFromDataOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param getTaggedImagesOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ImageCreateSummary object + * @return the observable to the List<Image> object */ - public Observable createImagesFromDataAsync(UUID projectId, byte[] imageData, CreateImagesFromDataOptionalParameter createImagesFromDataOptionalParameter) { - return createImagesFromDataWithServiceResponseAsync(projectId, imageData, createImagesFromDataOptionalParameter).map(new Func1, ImageCreateSummary>() { + public Observable> getTaggedImagesAsync(UUID projectId, GetTaggedImagesOptionalParameter getTaggedImagesOptionalParameter) { + return getTaggedImagesWithServiceResponseAsync(projectId, getTaggedImagesOptionalParameter).map(new Func1>, List>() { @Override - public ImageCreateSummary call(ServiceResponse response) { + public List 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. + * 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 imageData the InputStream value - * @param createImagesFromDataOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param getTaggedImagesOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ImageCreateSummary object + * @return the observable to the List<Image> object */ - public Observable> createImagesFromDataWithServiceResponseAsync(UUID projectId, byte[] imageData, CreateImagesFromDataOptionalParameter createImagesFromDataOptionalParameter) { + public Observable>> getTaggedImagesWithServiceResponseAsync(UUID projectId, GetTaggedImagesOptionalParameter getTaggedImagesOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.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.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - final List tagIds = createImagesFromDataOptionalParameter != null ? createImagesFromDataOptionalParameter.tagIds() : null; + final UUID iterationId = getTaggedImagesOptionalParameter != null ? getTaggedImagesOptionalParameter.iterationId() : null; + final List tagIds = getTaggedImagesOptionalParameter != null ? getTaggedImagesOptionalParameter.tagIds() : null; + final String orderBy = getTaggedImagesOptionalParameter != null ? getTaggedImagesOptionalParameter.orderBy() : null; + final Integer take = getTaggedImagesOptionalParameter != null ? getTaggedImagesOptionalParameter.take() : null; + final Integer skip = getTaggedImagesOptionalParameter != null ? getTaggedImagesOptionalParameter.skip() : null; - return createImagesFromDataWithServiceResponseAsync(projectId, imageData, tagIds); + return getTaggedImagesWithServiceResponseAsync(projectId, iterationId, tagIds, orderBy, take, skip); } /** - * 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. + * 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 imageData the InputStream value - * @param tagIds The tags ids with which to tag each image. Limited to 20 + * @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 ImageCreateSummary object + * @return the observable to the List<Image> object */ - public Observable> createImagesFromDataWithServiceResponseAsync(UUID projectId, byte[] imageData, List tagIds) { + public Observable>> getTaggedImagesWithServiceResponseAsync(UUID projectId, UUID iterationId, List tagIds, String orderBy, Integer take, Integer skip) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.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.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } Validator.validate(tagIds); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); String tagIdsConverted = this.client.serializerAdapter().serializeList(tagIds, CollectionFormat.CSV); - RequestBody imageDataConverted = RequestBody.create(MediaType.parse("multipart/form-data"), imageData); - return service.createImagesFromData(projectId, tagIdsConverted, imageDataConverted, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.getTaggedImages(projectId, iterationId, tagIdsConverted, orderBy, take, skip, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse clientResponse = createImagesFromDataDelegate(response); + ServiceResponse> clientResponse = getTaggedImagesDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -4204,169 +4762,284 @@ public Observable> call(Response createImagesFromDataDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + private ServiceResponse> getTaggedImagesDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CustomVisionErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CustomVisionErrorException.class) .build(response); } @Override - public TrainingsCreateImagesFromDataParameters createImagesFromData() { - return new TrainingsCreateImagesFromDataParameters(this); + public TrainingsGetTaggedImagesParameters getTaggedImages() { + return new TrainingsGetTaggedImagesParameters(this); } /** - * Internal class implementing TrainingsCreateImagesFromDataDefinition. + * Internal class implementing TrainingsGetTaggedImagesDefinition. */ - class TrainingsCreateImagesFromDataParameters implements TrainingsCreateImagesFromDataDefinition { + class TrainingsGetTaggedImagesParameters implements TrainingsGetTaggedImagesDefinition { private TrainingsImpl parent; private UUID projectId; - private byte[] imageData; - private List tagIds; + private UUID iterationId; + private List tagIds; + private String orderBy; + private Integer take; + private Integer skip; /** * Constructor. * @param parent the parent object. */ - TrainingsCreateImagesFromDataParameters(TrainingsImpl parent) { + TrainingsGetTaggedImagesParameters(TrainingsImpl parent) { this.parent = parent; } @Override - public TrainingsCreateImagesFromDataParameters withProjectId(UUID projectId) { + public TrainingsGetTaggedImagesParameters withProjectId(UUID projectId) { this.projectId = projectId; return this; } @Override - public TrainingsCreateImagesFromDataParameters withImageData(byte[] imageData) { - this.imageData = imageData; + public TrainingsGetTaggedImagesParameters withIterationId(UUID iterationId) { + this.iterationId = iterationId; return this; } @Override - public TrainingsCreateImagesFromDataParameters withTagIds(List tagIds) { + public TrainingsGetTaggedImagesParameters withTagIds(List tagIds) { this.tagIds = tagIds; return this; } @Override - public ImageCreateSummary execute() { - return createImagesFromDataWithServiceResponseAsync(projectId, imageData, tagIds).toBlocking().single().body(); + public TrainingsGetTaggedImagesParameters withOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + @Override + public TrainingsGetTaggedImagesParameters withTake(Integer take) { + this.take = take; + return this; + } + + @Override + public TrainingsGetTaggedImagesParameters withSkip(Integer skip) { + this.skip = skip; + return this; + } + + @Override + public List execute() { + return getTaggedImagesWithServiceResponseAsync(projectId, iterationId, tagIds, orderBy, take, skip).toBlocking().single().body(); } @Override - public Observable executeAsync() { - return createImagesFromDataWithServiceResponseAsync(projectId, imageData, tagIds).map(new Func1, ImageCreateSummary>() { + public Observable> executeAsync() { + return getTaggedImagesWithServiceResponseAsync(projectId, iterationId, tagIds, orderBy, take, skip).map(new Func1>, List>() { @Override - public ImageCreateSummary call(ServiceResponse response) { + public List 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 + * @throws CustomVisionErrorException 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(); + } /** - * 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. + * Delete a set of image regions. * - * @param projectId The project id - * @param getImagesByIdsOptionalParameter the object representing the optional parameters to be set before calling this API + * @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.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.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.client.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); + } + Validator.validate(regionIds); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + String regionIdsConverted = this.client.serializerAdapter().serializeList(regionIds, CollectionFormat.CSV); + return service.deleteImageRegions(projectId, regionIdsConverted, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.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 CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.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. + * @param createImageRegionsOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 List<Image> object if successful. + * @return the ImageRegionCreateSummary object if successful. */ - public List getImagesByIds(UUID projectId, GetImagesByIdsOptionalParameter getImagesByIdsOptionalParameter) { - return getImagesByIdsWithServiceResponseAsync(projectId, getImagesByIdsOptionalParameter).toBlocking().single().body(); + public ImageRegionCreateSummary createImageRegions(UUID projectId, CreateImageRegionsOptionalParameter createImageRegionsOptionalParameter) { + return createImageRegionsWithServiceResponseAsync(projectId, createImageRegionsOptionalParameter).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. + * 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 getImagesByIdsOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param createImageRegionsOptionalParameter the object representing the optional parameters to be set before calling this API * @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, GetImagesByIdsOptionalParameter getImagesByIdsOptionalParameter, final ServiceCallback> serviceCallback) { - return ServiceFuture.fromResponse(getImagesByIdsWithServiceResponseAsync(projectId, getImagesByIdsOptionalParameter), serviceCallback); + public ServiceFuture createImageRegionsAsync(UUID projectId, CreateImageRegionsOptionalParameter createImageRegionsOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createImageRegionsWithServiceResponseAsync(projectId, createImageRegionsOptionalParameter), 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. + * 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 getImagesByIdsOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param createImageRegionsOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<Image> object + * @return the observable to the ImageRegionCreateSummary object */ - public Observable> getImagesByIdsAsync(UUID projectId, GetImagesByIdsOptionalParameter getImagesByIdsOptionalParameter) { - return getImagesByIdsWithServiceResponseAsync(projectId, getImagesByIdsOptionalParameter).map(new Func1>, List>() { + public Observable createImageRegionsAsync(UUID projectId, CreateImageRegionsOptionalParameter createImageRegionsOptionalParameter) { + return createImageRegionsWithServiceResponseAsync(projectId, createImageRegionsOptionalParameter).map(new Func1, ImageRegionCreateSummary>() { @Override - public List call(ServiceResponse> response) { + public ImageRegionCreateSummary 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. + * 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 getImagesByIdsOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param createImageRegionsOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<Image> object + * @return the observable to the ImageRegionCreateSummary object */ - public Observable>> getImagesByIdsWithServiceResponseAsync(UUID projectId, GetImagesByIdsOptionalParameter getImagesByIdsOptionalParameter) { + public Observable> createImageRegionsWithServiceResponseAsync(UUID projectId, CreateImageRegionsOptionalParameter createImageRegionsOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - final List imageIds = getImagesByIdsOptionalParameter != null ? getImagesByIdsOptionalParameter.imageIds() : null; - final UUID iterationId = getImagesByIdsOptionalParameter != null ? getImagesByIdsOptionalParameter.iterationId() : null; + final List regions = createImageRegionsOptionalParameter != null ? createImageRegionsOptionalParameter.regions() : null; - return getImagesByIdsWithServiceResponseAsync(projectId, imageIds, iterationId); + return createImageRegionsWithServiceResponseAsync(projectId, regions); } /** - * 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. + * 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 imageIds The list of image ids to retrieve. Limited to 256 - * @param iterationId The iteration id. Defaults to workspace + * @param projectId The project id. + * @param regions the List<ImageRegionCreateEntry> value * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<Image> object + * @return the observable to the ImageRegionCreateSummary object */ - public Observable>> getImagesByIdsWithServiceResponseAsync(UUID projectId, List imageIds, UUID iterationId) { + public Observable> createImageRegionsWithServiceResponseAsync(UUID projectId, List regions) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - Validator.validate(imageIds); - String imageIdsConverted = this.client.serializerAdapter().serializeList(imageIds, CollectionFormat.CSV); - return service.getImagesByIds(projectId, imageIdsConverted, iterationId, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + Validator.validate(regions); + ImageRegionCreateBatch batch = new ImageRegionCreateBatch(); + batch.withRegions(regions); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.createImageRegions(projectId, this.client.apiKey(), this.client.acceptLanguage(), batch, parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable>> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse> clientResponse = getImagesByIdsDelegate(response); + ServiceResponse clientResponse = createImageRegionsDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -4375,165 +5048,144 @@ public Observable>> call(Response resp }); } - private ServiceResponse> getImagesByIdsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + private ServiceResponse createImageRegionsDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) .build(response); } @Override - public TrainingsGetImagesByIdsParameters getImagesByIds() { - return new TrainingsGetImagesByIdsParameters(this); + public TrainingsCreateImageRegionsParameters createImageRegions() { + return new TrainingsCreateImageRegionsParameters(this); } /** - * Internal class implementing TrainingsGetImagesByIdsDefinition. + * Internal class implementing TrainingsCreateImageRegionsDefinition. */ - class TrainingsGetImagesByIdsParameters implements TrainingsGetImagesByIdsDefinition { + class TrainingsCreateImageRegionsParameters implements TrainingsCreateImageRegionsDefinition { private TrainingsImpl parent; private UUID projectId; - private List imageIds; - private UUID iterationId; + private List regions; /** * Constructor. * @param parent the parent object. */ - TrainingsGetImagesByIdsParameters(TrainingsImpl parent) { + TrainingsCreateImageRegionsParameters(TrainingsImpl parent) { this.parent = parent; } @Override - public TrainingsGetImagesByIdsParameters withProjectId(UUID projectId) { + public TrainingsCreateImageRegionsParameters withProjectId(UUID projectId) { this.projectId = projectId; return this; } @Override - public TrainingsGetImagesByIdsParameters withImageIds(List imageIds) { - this.imageIds = imageIds; - return this; - } - - @Override - public TrainingsGetImagesByIdsParameters withIterationId(UUID iterationId) { - this.iterationId = iterationId; + public TrainingsCreateImageRegionsParameters withRegions(List regions) { + this.regions = regions; return this; } @Override - public List execute() { - return getImagesByIdsWithServiceResponseAsync(projectId, imageIds, iterationId).toBlocking().single().body(); + public ImageRegionCreateSummary execute() { + return createImageRegionsWithServiceResponseAsync(projectId, regions).toBlocking().single().body(); } @Override - public Observable> executeAsync() { - return getImagesByIdsWithServiceResponseAsync(projectId, imageIds, iterationId).map(new Func1>, List>() { + public Observable executeAsync() { + return createImageRegionsWithServiceResponseAsync(projectId, regions).map(new Func1, ImageRegionCreateSummary>() { @Override - public List call(ServiceResponse> response) { + public ImageRegionCreateSummary 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. + * Remove a set of tags from a set of images. * - * @param projectId The project id - * @param getUntaggedImageCountOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 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 int object if successful. */ - public int getUntaggedImageCount(UUID projectId, GetUntaggedImageCountOptionalParameter getUntaggedImageCountOptionalParameter) { - return getUntaggedImageCountWithServiceResponseAsync(projectId, getUntaggedImageCountOptionalParameter).toBlocking().single().body(); + public void deleteImageTags(UUID projectId, List imageIds, List tagIds) { + deleteImageTagsWithServiceResponseAsync(projectId, imageIds, tagIds).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. + * Remove a set of tags from a set of images. * - * @param projectId The project id - * @param getUntaggedImageCountOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 getUntaggedImageCountAsync(UUID projectId, GetUntaggedImageCountOptionalParameter getUntaggedImageCountOptionalParameter, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getUntaggedImageCountWithServiceResponseAsync(projectId, getUntaggedImageCountOptionalParameter), serviceCallback); + public ServiceFuture deleteImageTagsAsync(UUID projectId, List imageIds, List tagIds, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteImageTagsWithServiceResponseAsync(projectId, imageIds, tagIds), 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. + * Remove a set of tags from a set of images. * - * @param projectId The project id - * @param getUntaggedImageCountOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 observable to the Integer object + * @return the {@link ServiceResponse} object if successful. */ - public Observable getUntaggedImageCountAsync(UUID projectId, GetUntaggedImageCountOptionalParameter getUntaggedImageCountOptionalParameter) { - return getUntaggedImageCountWithServiceResponseAsync(projectId, getUntaggedImageCountOptionalParameter).map(new Func1, Integer>() { + public Observable deleteImageTagsAsync(UUID projectId, List imageIds, List tagIds) { + return deleteImageTagsWithServiceResponseAsync(projectId, imageIds, tagIds).map(new Func1, Void>() { @Override - public Integer call(ServiceResponse response) { + public Void 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. + * Remove a set of tags from a set of images. * - * @param projectId The project id - * @param getUntaggedImageCountOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 observable to the Integer object + * @return the {@link ServiceResponse} object if successful. */ - public Observable> getUntaggedImageCountWithServiceResponseAsync(UUID projectId, GetUntaggedImageCountOptionalParameter getUntaggedImageCountOptionalParameter) { + public Observable> deleteImageTagsWithServiceResponseAsync(UUID projectId, List imageIds, List tagIds) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } - if (this.client.apiKey() == null) { - throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); + if (imageIds == null) { + throw new IllegalArgumentException("Parameter imageIds is required and cannot be null."); } - final UUID iterationId = getUntaggedImageCountOptionalParameter != null ? getUntaggedImageCountOptionalParameter.iterationId() : null; - - return getUntaggedImageCountWithServiceResponseAsync(projectId, 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 Integer object - */ - public Observable> getUntaggedImageCountWithServiceResponseAsync(UUID projectId, UUID iterationId) { - if (projectId == null) { - throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + if (tagIds == null) { + throw new IllegalArgumentException("Parameter tagIds is required and cannot be null."); } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - return service.getUntaggedImageCount(projectId, iterationId, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + Validator.validate(imageIds); + Validator.validate(tagIds); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + String imageIdsConverted = this.client.serializerAdapter().serializeList(imageIds, CollectionFormat.CSV); + String tagIdsConverted = this.client.serializerAdapter().serializeList(tagIds, CollectionFormat.CSV); + return service.deleteImageTags(projectId, imageIdsConverted, tagIdsConverted, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = getUntaggedImageCountDelegate(response); + ServiceResponse clientResponse = deleteImageTagsDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -4542,162 +5194,109 @@ public Observable> call(Response response }); } - private ServiceResponse getUntaggedImageCountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + private ServiceResponse deleteImageTagsDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) .build(response); } - @Override - public TrainingsGetUntaggedImageCountParameters getUntaggedImageCount() { - return new TrainingsGetUntaggedImageCountParameters(this); - } - - /** - * Internal class implementing TrainingsGetUntaggedImageCountDefinition. - */ - class TrainingsGetUntaggedImageCountParameters implements TrainingsGetUntaggedImageCountDefinition { - private TrainingsImpl parent; - private UUID projectId; - private UUID iterationId; - - /** - * Constructor. - * @param parent the parent object. - */ - TrainingsGetUntaggedImageCountParameters(TrainingsImpl parent) { - this.parent = parent; - } - - @Override - public TrainingsGetUntaggedImageCountParameters withProjectId(UUID projectId) { - this.projectId = projectId; - return this; - } - - @Override - public TrainingsGetUntaggedImageCountParameters withIterationId(UUID iterationId) { - this.iterationId = iterationId; - return this; - } - - @Override - public int execute() { - return getUntaggedImageCountWithServiceResponseAsync(projectId, iterationId).toBlocking().single().body(); - } - - @Override - public Observable executeAsync() { - return getUntaggedImageCountWithServiceResponseAsync(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}. - * 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. + * Associate a set of images with a set of tags. * - * @param projectId The project id - * @param getTaggedImageCountOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param createImageTagsOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 int object if successful. + * @return the ImageTagCreateSummary object if successful. */ - public int getTaggedImageCount(UUID projectId, GetTaggedImageCountOptionalParameter getTaggedImageCountOptionalParameter) { - return getTaggedImageCountWithServiceResponseAsync(projectId, getTaggedImageCountOptionalParameter).toBlocking().single().body(); + public ImageTagCreateSummary createImageTags(UUID projectId, CreateImageTagsOptionalParameter createImageTagsOptionalParameter) { + return createImageTagsWithServiceResponseAsync(projectId, createImageTagsOptionalParameter).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. + * Associate a set of images with a set of tags. * - * @param projectId The project id - * @param getTaggedImageCountOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param createImageTagsOptionalParameter the object representing the optional parameters to be set before calling this API * @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, GetTaggedImageCountOptionalParameter getTaggedImageCountOptionalParameter, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getTaggedImageCountWithServiceResponseAsync(projectId, getTaggedImageCountOptionalParameter), serviceCallback); + public ServiceFuture createImageTagsAsync(UUID projectId, CreateImageTagsOptionalParameter createImageTagsOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createImageTagsWithServiceResponseAsync(projectId, createImageTagsOptionalParameter), 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. + * Associate a set of images with a set of tags. * - * @param projectId The project id - * @param getTaggedImageCountOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param createImageTagsOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the Integer object + * @return the observable to the ImageTagCreateSummary object */ - public Observable getTaggedImageCountAsync(UUID projectId, GetTaggedImageCountOptionalParameter getTaggedImageCountOptionalParameter) { - return getTaggedImageCountWithServiceResponseAsync(projectId, getTaggedImageCountOptionalParameter).map(new Func1, Integer>() { + public Observable createImageTagsAsync(UUID projectId, CreateImageTagsOptionalParameter createImageTagsOptionalParameter) { + return createImageTagsWithServiceResponseAsync(projectId, createImageTagsOptionalParameter).map(new Func1, ImageTagCreateSummary>() { @Override - public Integer call(ServiceResponse response) { + public ImageTagCreateSummary 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. + * Associate a set of images with a set of tags. * - * @param projectId The project id - * @param getTaggedImageCountOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param createImageTagsOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the Integer object + * @return the observable to the ImageTagCreateSummary object */ - public Observable> getTaggedImageCountWithServiceResponseAsync(UUID projectId, GetTaggedImageCountOptionalParameter getTaggedImageCountOptionalParameter) { + public Observable> createImageTagsWithServiceResponseAsync(UUID projectId, CreateImageTagsOptionalParameter createImageTagsOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - final UUID iterationId = getTaggedImageCountOptionalParameter != null ? getTaggedImageCountOptionalParameter.iterationId() : null; - final List tagIds = getTaggedImageCountOptionalParameter != null ? getTaggedImageCountOptionalParameter.tagIds() : null; + final List tags = createImageTagsOptionalParameter != null ? createImageTagsOptionalParameter.tags() : null; - return getTaggedImageCountWithServiceResponseAsync(projectId, iterationId, tagIds); + return createImageTagsWithServiceResponseAsync(projectId, tags); } /** - * 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. + * Associate a set of images with a set of tags. * - * @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 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 Integer object + * @return the observable to the ImageTagCreateSummary object */ - public Observable> getTaggedImageCountWithServiceResponseAsync(UUID projectId, UUID iterationId, List tagIds) { + public Observable> createImageTagsWithServiceResponseAsync(UUID projectId, List tags) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - Validator.validate(tagIds); - String tagIdsConverted = this.client.serializerAdapter().serializeList(tagIds, CollectionFormat.CSV); - return service.getTaggedImageCount(projectId, iterationId, tagIdsConverted, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + Validator.validate(tags); + ImageTagCreateBatch batch = new ImageTagCreateBatch(); + batch.withTags(tags); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.createImageTags(projectId, this.client.apiKey(), this.client.acceptLanguage(), batch, parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = getTaggedImageCountDelegate(response); + ServiceResponse clientResponse = createImageTagsDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -4706,63 +5305,56 @@ public Observable> call(Response response }); } - private ServiceResponse getTaggedImageCountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + private ServiceResponse createImageTagsDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) .build(response); } @Override - public TrainingsGetTaggedImageCountParameters getTaggedImageCount() { - return new TrainingsGetTaggedImageCountParameters(this); + public TrainingsCreateImageTagsParameters createImageTags() { + return new TrainingsCreateImageTagsParameters(this); } /** - * Internal class implementing TrainingsGetTaggedImageCountDefinition. + * Internal class implementing TrainingsCreateImageTagsDefinition. */ - class TrainingsGetTaggedImageCountParameters implements TrainingsGetTaggedImageCountDefinition { + class TrainingsCreateImageTagsParameters implements TrainingsCreateImageTagsDefinition { private TrainingsImpl parent; private UUID projectId; - private UUID iterationId; - private List tagIds; + private List tags; /** * Constructor. * @param parent the parent object. */ - TrainingsGetTaggedImageCountParameters(TrainingsImpl parent) { + TrainingsCreateImageTagsParameters(TrainingsImpl parent) { this.parent = parent; } @Override - public TrainingsGetTaggedImageCountParameters withProjectId(UUID projectId) { + public TrainingsCreateImageTagsParameters withProjectId(UUID projectId) { this.projectId = projectId; return this; } @Override - public TrainingsGetTaggedImageCountParameters withIterationId(UUID iterationId) { - this.iterationId = iterationId; - return this; - } - - @Override - public TrainingsGetTaggedImageCountParameters withTagIds(List tagIds) { - this.tagIds = tagIds; + public TrainingsCreateImageTagsParameters withTags(List tags) { + this.tags = tags; return this; } @Override - public int execute() { - return getTaggedImageCountWithServiceResponseAsync(projectId, iterationId, tagIds).toBlocking().single().body(); + public ImageTagCreateSummary execute() { + return createImageTagsWithServiceResponseAsync(projectId, tags).toBlocking().single().body(); } @Override - public Observable executeAsync() { - return getTaggedImageCountWithServiceResponseAsync(projectId, iterationId, tagIds).map(new Func1, Integer>() { + public Observable executeAsync() { + return createImageTagsWithServiceResponseAsync(projectId, tags).map(new Func1, ImageTagCreateSummary>() { @Override - public Integer call(ServiceResponse response) { + public ImageTagCreateSummary call(ServiceResponse response) { return response.body(); } }); @@ -4771,106 +5363,107 @@ public Integer call(ServiceResponse 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. + * 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 getUntaggedImagesOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param getUntaggedImageCountOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 List<Image> object if successful. + * @return the int object if successful. */ - public List getUntaggedImages(UUID projectId, GetUntaggedImagesOptionalParameter getUntaggedImagesOptionalParameter) { - return getUntaggedImagesWithServiceResponseAsync(projectId, getUntaggedImagesOptionalParameter).toBlocking().single().body(); + public int getUntaggedImageCount(UUID projectId, GetUntaggedImageCountOptionalParameter getUntaggedImageCountOptionalParameter) { + return getUntaggedImageCountWithServiceResponseAsync(projectId, getUntaggedImageCountOptionalParameter).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. + * 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 getUntaggedImagesOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param getUntaggedImageCountOptionalParameter the object representing the optional parameters to be set before calling this API * @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, GetUntaggedImagesOptionalParameter getUntaggedImagesOptionalParameter, final ServiceCallback> serviceCallback) { - return ServiceFuture.fromResponse(getUntaggedImagesWithServiceResponseAsync(projectId, getUntaggedImagesOptionalParameter), serviceCallback); + public ServiceFuture getUntaggedImageCountAsync(UUID projectId, GetUntaggedImageCountOptionalParameter getUntaggedImageCountOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getUntaggedImageCountWithServiceResponseAsync(projectId, getUntaggedImageCountOptionalParameter), 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. + * 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 getUntaggedImagesOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param getUntaggedImageCountOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<Image> object + * @return the observable to the Integer object */ - public Observable> getUntaggedImagesAsync(UUID projectId, GetUntaggedImagesOptionalParameter getUntaggedImagesOptionalParameter) { - return getUntaggedImagesWithServiceResponseAsync(projectId, getUntaggedImagesOptionalParameter).map(new Func1>, List>() { + public Observable getUntaggedImageCountAsync(UUID projectId, GetUntaggedImageCountOptionalParameter getUntaggedImageCountOptionalParameter) { + return getUntaggedImageCountWithServiceResponseAsync(projectId, getUntaggedImageCountOptionalParameter).map(new Func1, Integer>() { @Override - public List call(ServiceResponse> response) { + public Integer 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. + * 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 getUntaggedImagesOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param getUntaggedImageCountOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<Image> object + * @return the observable to the Integer object */ - public Observable>> getUntaggedImagesWithServiceResponseAsync(UUID projectId, GetUntaggedImagesOptionalParameter getUntaggedImagesOptionalParameter) { + public Observable> getUntaggedImageCountWithServiceResponseAsync(UUID projectId, GetUntaggedImageCountOptionalParameter getUntaggedImageCountOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - final UUID iterationId = getUntaggedImagesOptionalParameter != null ? getUntaggedImagesOptionalParameter.iterationId() : null; - final String orderBy = getUntaggedImagesOptionalParameter != null ? getUntaggedImagesOptionalParameter.orderBy() : null; - final Integer take = getUntaggedImagesOptionalParameter != null ? getUntaggedImagesOptionalParameter.take() : null; - final Integer skip = getUntaggedImagesOptionalParameter != null ? getUntaggedImagesOptionalParameter.skip() : null; + final UUID iterationId = getUntaggedImageCountOptionalParameter != null ? getUntaggedImageCountOptionalParameter.iterationId() : null; - return getUntaggedImagesWithServiceResponseAsync(projectId, iterationId, orderBy, take, skip); + return getUntaggedImageCountWithServiceResponseAsync(projectId, iterationId); } /** - * 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. + * 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 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 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<Image> object + * @return the observable to the Integer object */ - public Observable>> getUntaggedImagesWithServiceResponseAsync(UUID projectId, UUID iterationId, String orderBy, Integer take, Integer skip) { + public Observable> getUntaggedImageCountWithServiceResponseAsync(UUID projectId, UUID iterationId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - return service.getUntaggedImages(projectId, iterationId, orderBy, take, skip, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getUntaggedImageCount(projectId, iterationId, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable>> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse> clientResponse = getUntaggedImagesDelegate(response); + ServiceResponse clientResponse = getUntaggedImageCountDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -4879,77 +5472,56 @@ public Observable>> call(Response resp }); } - private ServiceResponse> getUntaggedImagesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + private ServiceResponse getUntaggedImageCountDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) .build(response); } @Override - public TrainingsGetUntaggedImagesParameters getUntaggedImages() { - return new TrainingsGetUntaggedImagesParameters(this); + public TrainingsGetUntaggedImageCountParameters getUntaggedImageCount() { + return new TrainingsGetUntaggedImageCountParameters(this); } /** - * Internal class implementing TrainingsGetUntaggedImagesDefinition. + * Internal class implementing TrainingsGetUntaggedImageCountDefinition. */ - class TrainingsGetUntaggedImagesParameters implements TrainingsGetUntaggedImagesDefinition { + class TrainingsGetUntaggedImageCountParameters implements TrainingsGetUntaggedImageCountDefinition { private TrainingsImpl parent; private UUID projectId; private UUID iterationId; - private String orderBy; - private Integer take; - private Integer skip; /** * Constructor. * @param parent the parent object. */ - TrainingsGetUntaggedImagesParameters(TrainingsImpl parent) { + TrainingsGetUntaggedImageCountParameters(TrainingsImpl parent) { this.parent = parent; } @Override - public TrainingsGetUntaggedImagesParameters withProjectId(UUID projectId) { + public TrainingsGetUntaggedImageCountParameters withProjectId(UUID projectId) { this.projectId = projectId; return this; } @Override - public TrainingsGetUntaggedImagesParameters withIterationId(UUID iterationId) { + public TrainingsGetUntaggedImageCountParameters withIterationId(UUID iterationId) { this.iterationId = iterationId; return this; } @Override - public TrainingsGetUntaggedImagesParameters withOrderBy(String orderBy) { - this.orderBy = orderBy; - return this; - } - - @Override - public TrainingsGetUntaggedImagesParameters withTake(Integer take) { - this.take = take; - return this; - } - - @Override - public TrainingsGetUntaggedImagesParameters withSkip(Integer skip) { - this.skip = skip; - return this; - } - - @Override - public List execute() { - return getUntaggedImagesWithServiceResponseAsync(projectId, iterationId, orderBy, take, skip).toBlocking().single().body(); + public int execute() { + return getUntaggedImageCountWithServiceResponseAsync(projectId, iterationId).toBlocking().single().body(); } @Override - public Observable> executeAsync() { - return getUntaggedImagesWithServiceResponseAsync(projectId, iterationId, orderBy, take, skip).map(new Func1>, List>() { + public Observable executeAsync() { + return getUntaggedImageCountWithServiceResponseAsync(projectId, iterationId).map(new Func1, Integer>() { @Override - public List call(ServiceResponse> response) { + public Integer call(ServiceResponse response) { return response.body(); } }); @@ -4958,106 +5530,96 @@ public List call(ServiceResponse> 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 + * 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 getTaggedImagesOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param getTaggedImageCountOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 List<Image> object if successful. + * @return the int object if successful. */ - public List getTaggedImages(UUID projectId, GetTaggedImagesOptionalParameter getTaggedImagesOptionalParameter) { - return getTaggedImagesWithServiceResponseAsync(projectId, getTaggedImagesOptionalParameter).toBlocking().single().body(); + public int getTaggedImageCount(UUID projectId, GetTaggedImageCountOptionalParameter getTaggedImageCountOptionalParameter) { + return getTaggedImageCountWithServiceResponseAsync(projectId, getTaggedImageCountOptionalParameter).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 + * 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 getTaggedImagesOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param getTaggedImageCountOptionalParameter the object representing the optional parameters to be set before calling this API * @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, GetTaggedImagesOptionalParameter getTaggedImagesOptionalParameter, final ServiceCallback> serviceCallback) { - return ServiceFuture.fromResponse(getTaggedImagesWithServiceResponseAsync(projectId, getTaggedImagesOptionalParameter), serviceCallback); + public ServiceFuture getTaggedImageCountAsync(UUID projectId, GetTaggedImageCountOptionalParameter getTaggedImageCountOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getTaggedImageCountWithServiceResponseAsync(projectId, getTaggedImageCountOptionalParameter), 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 + * 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 getTaggedImagesOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param getTaggedImageCountOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<Image> object + * @return the observable to the Integer object */ - public Observable> getTaggedImagesAsync(UUID projectId, GetTaggedImagesOptionalParameter getTaggedImagesOptionalParameter) { - return getTaggedImagesWithServiceResponseAsync(projectId, getTaggedImagesOptionalParameter).map(new Func1>, List>() { + public Observable getTaggedImageCountAsync(UUID projectId, GetTaggedImageCountOptionalParameter getTaggedImageCountOptionalParameter) { + return getTaggedImageCountWithServiceResponseAsync(projectId, getTaggedImageCountOptionalParameter).map(new Func1, Integer>() { @Override - public List call(ServiceResponse> response) { + public Integer 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 + * 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 getTaggedImagesOptionalParameter the object representing the optional parameters to be set before calling this API + * @param projectId The project id. + * @param getTaggedImageCountOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<Image> object + * @return the observable to the Integer object */ - public Observable>> getTaggedImagesWithServiceResponseAsync(UUID projectId, GetTaggedImagesOptionalParameter getTaggedImagesOptionalParameter) { + public Observable> getTaggedImageCountWithServiceResponseAsync(UUID projectId, GetTaggedImageCountOptionalParameter getTaggedImageCountOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - final UUID iterationId = getTaggedImagesOptionalParameter != null ? getTaggedImagesOptionalParameter.iterationId() : null; - final List tagIds = getTaggedImagesOptionalParameter != null ? getTaggedImagesOptionalParameter.tagIds() : null; - final String orderBy = getTaggedImagesOptionalParameter != null ? getTaggedImagesOptionalParameter.orderBy() : null; - final Integer take = getTaggedImagesOptionalParameter != null ? getTaggedImagesOptionalParameter.take() : null; - final Integer skip = getTaggedImagesOptionalParameter != null ? getTaggedImagesOptionalParameter.skip() : null; + final UUID iterationId = getTaggedImageCountOptionalParameter != null ? getTaggedImageCountOptionalParameter.iterationId() : null; + final List tagIds = getTaggedImageCountOptionalParameter != null ? getTaggedImageCountOptionalParameter.tagIds() : null; - return getTaggedImagesWithServiceResponseAsync(projectId, iterationId, tagIds, orderBy, take, skip); + return getTaggedImageCountWithServiceResponseAsync(projectId, iterationId, tagIds); } /** - * 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 + * 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. 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 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 List<Image> object + * @return the observable to the Integer object */ - public Observable>> getTaggedImagesWithServiceResponseAsync(UUID projectId, UUID iterationId, List tagIds, String orderBy, Integer take, Integer skip) { + public Observable> getTaggedImageCountWithServiceResponseAsync(UUID projectId, UUID iterationId, List tagIds) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } @@ -5065,13 +5627,14 @@ public Observable>> getTaggedImagesWithServiceRespon throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } Validator.validate(tagIds); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); String tagIdsConverted = this.client.serializerAdapter().serializeList(tagIds, CollectionFormat.CSV); - return service.getTaggedImages(projectId, iterationId, tagIdsConverted, orderBy, take, skip, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + return service.getTaggedImageCount(projectId, iterationId, tagIdsConverted, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable>> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse> clientResponse = getTaggedImagesDelegate(response); + ServiceResponse clientResponse = getTaggedImageCountDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -5080,84 +5643,63 @@ public Observable>> call(Response resp }); } - private ServiceResponse> getTaggedImagesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + private ServiceResponse getTaggedImageCountDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CustomVisionErrorException.class) .build(response); } @Override - public TrainingsGetTaggedImagesParameters getTaggedImages() { - return new TrainingsGetTaggedImagesParameters(this); + public TrainingsGetTaggedImageCountParameters getTaggedImageCount() { + return new TrainingsGetTaggedImageCountParameters(this); } /** - * Internal class implementing TrainingsGetTaggedImagesDefinition. + * Internal class implementing TrainingsGetTaggedImageCountDefinition. */ - class TrainingsGetTaggedImagesParameters implements TrainingsGetTaggedImagesDefinition { + class TrainingsGetTaggedImageCountParameters implements TrainingsGetTaggedImageCountDefinition { private TrainingsImpl parent; private UUID projectId; private UUID iterationId; - private List tagIds; - private String orderBy; - private Integer take; - private Integer skip; + private List tagIds; /** * Constructor. * @param parent the parent object. */ - TrainingsGetTaggedImagesParameters(TrainingsImpl parent) { + TrainingsGetTaggedImageCountParameters(TrainingsImpl parent) { this.parent = parent; } @Override - public TrainingsGetTaggedImagesParameters withProjectId(UUID projectId) { + public TrainingsGetTaggedImageCountParameters withProjectId(UUID projectId) { this.projectId = projectId; return this; } @Override - public TrainingsGetTaggedImagesParameters withIterationId(UUID iterationId) { + public TrainingsGetTaggedImageCountParameters withIterationId(UUID iterationId) { this.iterationId = iterationId; return this; } @Override - public TrainingsGetTaggedImagesParameters withTagIds(List tagIds) { + public TrainingsGetTaggedImageCountParameters withTagIds(List tagIds) { this.tagIds = tagIds; return this; } @Override - public TrainingsGetTaggedImagesParameters withOrderBy(String orderBy) { - this.orderBy = orderBy; - return this; - } - - @Override - public TrainingsGetTaggedImagesParameters withTake(Integer take) { - this.take = take; - return this; - } - - @Override - public TrainingsGetTaggedImagesParameters withSkip(Integer skip) { - this.skip = skip; - return this; - } - - @Override - public List execute() { - return getTaggedImagesWithServiceResponseAsync(projectId, iterationId, tagIds, orderBy, take, skip).toBlocking().single().body(); + public int execute() { + return getTaggedImageCountWithServiceResponseAsync(projectId, iterationId, tagIds).toBlocking().single().body(); } @Override - public Observable> executeAsync() { - return getTaggedImagesWithServiceResponseAsync(projectId, iterationId, tagIds, orderBy, take, skip).map(new Func1>, List>() { + public Observable executeAsync() { + return getTaggedImageCountWithServiceResponseAsync(projectId, iterationId, tagIds).map(new Func1, Integer>() { @Override - public List call(ServiceResponse> response) { + public Integer call(ServiceResponse response) { return response.body(); } }); @@ -5167,9 +5709,9 @@ public List call(ServiceResponse> response) { /** * Get information about a specific domain. * - * @param domainId The id of the domain to get information about + * @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 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 Domain object if successful. */ @@ -5180,7 +5722,7 @@ public Domain getDomain(UUID domainId) { /** * Get information about a specific domain. * - * @param domainId The id of the domain to get information about + * @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 @@ -5192,7 +5734,7 @@ public ServiceFuture getDomainAsync(UUID domainId, final ServiceCallback /** * Get information about a specific domain. * - * @param domainId The id of the domain to get information about + * @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 */ @@ -5208,18 +5750,22 @@ public Domain call(ServiceResponse response) { /** * Get information about a specific domain. * - * @param domainId The id of the domain to get information about + * @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.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (domainId == null) { throw new IllegalArgumentException("Parameter domainId is required and cannot be null."); } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - return service.getDomain(domainId, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getDomain(domainId, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -5233,10 +5779,10 @@ public Observable> call(Response response) }); } - private ServiceResponse getDomainDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getDomainDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(CustomVisionErrorException.class) .build(response); } @@ -5244,7 +5790,7 @@ private ServiceResponse getDomainDelegate(Response respons * 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 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 List<Domain> object if successful. */ @@ -5285,10 +5831,14 @@ public List call(ServiceResponse> response) { * @return the observable to the List<Domain> object */ public Observable>> getDomainsWithServiceResponseAsync() { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } - return service.getDomains(this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.getDomains(this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -5302,10 +5852,10 @@ public Observable>> call(Response res }); } - private ServiceResponse> getDomainsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> getDomainsDelegate(Response response) throws CustomVisionErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CustomVisionErrorException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(CustomVisionErrorException.class) .build(response); } diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/package-info.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/package-info.java index 660ca0524a9a..6f29966a919a 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/package-info.java +++ b/sdk/cognitiveservices/ms-azure-cs-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/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/BoundingBox.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/BoundingBox.java index 6576f1ce2f8b..e21d6499aa72 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/BoundingBox.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/BoundingBox.java @@ -11,31 +11,31 @@ 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") + @JsonProperty(value = "left", required = true) private double left; /** - * The top property. + * Coordinate of the top boundary. */ - @JsonProperty(value = "top") + @JsonProperty(value = "top", required = true) private double top; /** - * The width property. + * Width. */ - @JsonProperty(value = "width") + @JsonProperty(value = "width", required = true) private double width; /** - * The height property. + * Height. */ - @JsonProperty(value = "height") + @JsonProperty(value = "height", required = true) private double height; /** diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateImageTagsOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateImageTagsOptionalParameter.java index 0d799023b94c..3967d2bf2027 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateImageTagsOptionalParameter.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateImageTagsOptionalParameter.java @@ -15,7 +15,7 @@ */ public class CreateImageTagsOptionalParameter { /** - * The tags property. + * Image Tag entries to include in this batch. */ private List tags; diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateImagesFromDataOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateImagesFromDataOptionalParameter.java index 330ca1ae6afb..93437dbc5b81 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateImagesFromDataOptionalParameter.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateImagesFromDataOptionalParameter.java @@ -9,6 +9,7 @@ package com.microsoft.azure.cognitiveservices.vision.customvision.training.models; import java.util.List; +import java.util.UUID; /** * The CreateImagesFromDataOptionalParameter model. @@ -17,7 +18,7 @@ public class CreateImagesFromDataOptionalParameter { /** * The tags ids with which to tag each image. Limited to 20. */ - private List tagIds; + private List tagIds; /** * Gets or sets the preferred language for the response. @@ -29,7 +30,7 @@ public class CreateImagesFromDataOptionalParameter { * * @return the tagIds value */ - public List tagIds() { + public List tagIds() { return this.tagIds; } @@ -39,7 +40,7 @@ public List tagIds() { * @param tagIds the tagIds value to set * @return the CreateImagesFromDataOptionalParameter object itself. */ - public CreateImagesFromDataOptionalParameter withTagIds(List tagIds) { + public CreateImagesFromDataOptionalParameter withTagIds(List tagIds) { this.tagIds = tagIds; return this; } diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateProjectOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateProjectOptionalParameter.java index 50a620f1ddaa..32477a7764e4 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateProjectOptionalParameter.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateProjectOptionalParameter.java @@ -9,6 +9,7 @@ package com.microsoft.azure.cognitiveservices.vision.customvision.training.models; import java.util.UUID; +import java.util.List; /** * The CreateProjectOptionalParameter model. @@ -30,6 +31,11 @@ public class CreateProjectOptionalParameter { */ private String classificationType; + /** + * List of platforms the trained model is intending exporting to. + */ + private List targetExportPlatforms; + /** * Gets or sets the preferred language for the response. */ @@ -95,6 +101,26 @@ public CreateProjectOptionalParameter withClassificationType(String classificati return this; } + /** + * Get the targetExportPlatforms value. + * + * @return the targetExportPlatforms value + */ + public List targetExportPlatforms() { + return this.targetExportPlatforms; + } + + /** + * Set the targetExportPlatforms value. + * + * @param targetExportPlatforms the targetExportPlatforms value to set + * @return the CreateProjectOptionalParameter object itself. + */ + public CreateProjectOptionalParameter withTargetExportPlatforms(List targetExportPlatforms) { + this.targetExportPlatforms = targetExportPlatforms; + return this; + } + /** * Get the thisclientacceptLanguage value. * diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateTagOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateTagOptionalParameter.java index c1af590bef1f..6cf8f585a4bc 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateTagOptionalParameter.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateTagOptionalParameter.java @@ -18,6 +18,12 @@ public class CreateTagOptionalParameter { */ private String description; + /** + * Optional type for the tag. Possible values include: 'Regular', + * 'Negative'. + */ + private String type; + /** * Gets or sets the preferred language for the response. */ @@ -43,6 +49,26 @@ public CreateTagOptionalParameter withDescription(String description) { return this; } + /** + * Get the type value. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type value. + * + * @param type the type value to set + * @return the CreateTagOptionalParameter object itself. + */ + public CreateTagOptionalParameter withType(String type) { + this.type = type; + return this; + } + /** * Get the thisclientacceptLanguage value. * diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CustomVisionError.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CustomVisionError.java new file mode 100644 index 000000000000..961d749c090c --- /dev/null +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CustomVisionError.java @@ -0,0 +1,135 @@ +/** + * 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 com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The CustomVisionError model. + */ +public class CustomVisionError { + /** + * The error code. Possible values include: 'NoError', 'BadRequest', + * 'BadRequestExceededBatchSize', 'BadRequestNotSupported', + * 'BadRequestInvalidIds', 'BadRequestProjectName', + * 'BadRequestProjectNameNotUnique', 'BadRequestProjectDescription', + * 'BadRequestProjectUnknownDomain', + * 'BadRequestProjectUnknownClassification', + * 'BadRequestProjectUnsupportedDomainTypeChange', + * 'BadRequestProjectUnsupportedExportPlatform', 'BadRequestIterationName', + * 'BadRequestIterationNameNotUnique', 'BadRequestIterationDescription', + * 'BadRequestIterationIsNotTrained', + * 'BadRequestWorkspaceCannotBeModified', + * 'BadRequestWorkspaceNotDeletable', 'BadRequestTagName', + * 'BadRequestTagNameNotUnique', 'BadRequestTagDescription', + * 'BadRequestTagType', 'BadRequestMultipleNegativeTag', + * 'BadRequestImageTags', 'BadRequestImageRegions', + * 'BadRequestNegativeAndRegularTagOnSameImage', + * 'BadRequestRequiredParamIsNull', 'BadRequestIterationIsPublished', + * 'BadRequestInvalidPublishName', 'BadRequestInvalidPublishTarget', + * 'BadRequestUnpublishFailed', 'BadRequestIterationNotPublished', + * 'BadRequestSubscriptionApi', 'BadRequestExceedProjectLimit', + * 'BadRequestExceedIterationPerProjectLimit', + * 'BadRequestExceedTagPerProjectLimit', + * 'BadRequestExceedTagPerImageLimit', 'BadRequestExceededQuota', + * 'BadRequestCannotMigrateProjectWithName', 'BadRequestNotLimitedTrial', + * 'BadRequestImageBatch', 'BadRequestImageStream', 'BadRequestImageUrl', + * 'BadRequestImageFormat', 'BadRequestImageSizeBytes', + * 'BadRequestImageExceededCount', 'BadRequestTrainingNotNeeded', + * 'BadRequestTrainingNotNeededButTrainingPipelineUpdated', + * 'BadRequestTrainingValidationFailed', + * 'BadRequestClassificationTrainingValidationFailed', + * 'BadRequestMultiClassClassificationTrainingValidationFailed', + * 'BadRequestMultiLabelClassificationTrainingValidationFailed', + * 'BadRequestDetectionTrainingValidationFailed', + * 'BadRequestTrainingAlreadyInProgress', + * 'BadRequestDetectionTrainingNotAllowNegativeTag', + * 'BadRequestInvalidEmailAddress', + * 'BadRequestDomainNotSupportedForAdvancedTraining', + * 'BadRequestExportPlatformNotSupportedForAdvancedTraining', + * 'BadRequestReservedBudgetInHoursNotEnoughForAdvancedTraining', + * 'BadRequestExportValidationFailed', 'BadRequestExportAlreadyInProgress', + * 'BadRequestPredictionIdsMissing', + * 'BadRequestPredictionIdsExceededCount', + * 'BadRequestPredictionTagsExceededCount', + * 'BadRequestPredictionResultsExceededCount', + * 'BadRequestPredictionInvalidApplicationName', + * 'BadRequestPredictionInvalidQueryParameters', 'BadRequestInvalid', + * 'UnsupportedMediaType', 'Forbidden', 'ForbiddenUser', + * 'ForbiddenUserResource', 'ForbiddenUserSignupDisabled', + * 'ForbiddenUserSignupAllowanceExceeded', 'ForbiddenUserDoesNotExist', + * 'ForbiddenUserDisabled', 'ForbiddenUserInsufficientCapability', + * 'ForbiddenDRModeEnabled', '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 CustomVisionErrorCodes code; + + /** + * A message explaining the error reported by the service. + */ + @JsonProperty(value = "message", required = true) + private String message; + + /** + * Get the code value. + * + * @return the code value + */ + public CustomVisionErrorCodes code() { + return this.code; + } + + /** + * Set the code value. + * + * @param code the code value to set + * @return the CustomVisionError object itself. + */ + public CustomVisionError withCode(CustomVisionErrorCodes 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/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CustomVisionErrorCodes.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CustomVisionErrorCodes.java new file mode 100644 index 000000000000..d0ede44dddb1 --- /dev/null +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CustomVisionErrorCodes.java @@ -0,0 +1,374 @@ +/** + * 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 CustomVisionErrorCodes. + */ +public final class CustomVisionErrorCodes extends ExpandableStringEnum { + /** Static value NoError for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes NO_ERROR = fromString("NoError"); + + /** Static value BadRequest for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST = fromString("BadRequest"); + + /** Static value BadRequestExceededBatchSize for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_EXCEEDED_BATCH_SIZE = fromString("BadRequestExceededBatchSize"); + + /** Static value BadRequestNotSupported for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_NOT_SUPPORTED = fromString("BadRequestNotSupported"); + + /** Static value BadRequestInvalidIds for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_INVALID_IDS = fromString("BadRequestInvalidIds"); + + /** Static value BadRequestProjectName for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_PROJECT_NAME = fromString("BadRequestProjectName"); + + /** Static value BadRequestProjectNameNotUnique for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_PROJECT_NAME_NOT_UNIQUE = fromString("BadRequestProjectNameNotUnique"); + + /** Static value BadRequestProjectDescription for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_PROJECT_DESCRIPTION = fromString("BadRequestProjectDescription"); + + /** Static value BadRequestProjectUnknownDomain for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_PROJECT_UNKNOWN_DOMAIN = fromString("BadRequestProjectUnknownDomain"); + + /** Static value BadRequestProjectUnknownClassification for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_PROJECT_UNKNOWN_CLASSIFICATION = fromString("BadRequestProjectUnknownClassification"); + + /** Static value BadRequestProjectUnsupportedDomainTypeChange for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_PROJECT_UNSUPPORTED_DOMAIN_TYPE_CHANGE = fromString("BadRequestProjectUnsupportedDomainTypeChange"); + + /** Static value BadRequestProjectUnsupportedExportPlatform for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_PROJECT_UNSUPPORTED_EXPORT_PLATFORM = fromString("BadRequestProjectUnsupportedExportPlatform"); + + /** Static value BadRequestIterationName for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_ITERATION_NAME = fromString("BadRequestIterationName"); + + /** Static value BadRequestIterationNameNotUnique for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_ITERATION_NAME_NOT_UNIQUE = fromString("BadRequestIterationNameNotUnique"); + + /** Static value BadRequestIterationDescription for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_ITERATION_DESCRIPTION = fromString("BadRequestIterationDescription"); + + /** Static value BadRequestIterationIsNotTrained for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_ITERATION_IS_NOT_TRAINED = fromString("BadRequestIterationIsNotTrained"); + + /** Static value BadRequestWorkspaceCannotBeModified for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_WORKSPACE_CANNOT_BE_MODIFIED = fromString("BadRequestWorkspaceCannotBeModified"); + + /** Static value BadRequestWorkspaceNotDeletable for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_WORKSPACE_NOT_DELETABLE = fromString("BadRequestWorkspaceNotDeletable"); + + /** Static value BadRequestTagName for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_TAG_NAME = fromString("BadRequestTagName"); + + /** Static value BadRequestTagNameNotUnique for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_TAG_NAME_NOT_UNIQUE = fromString("BadRequestTagNameNotUnique"); + + /** Static value BadRequestTagDescription for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_TAG_DESCRIPTION = fromString("BadRequestTagDescription"); + + /** Static value BadRequestTagType for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_TAG_TYPE = fromString("BadRequestTagType"); + + /** Static value BadRequestMultipleNegativeTag for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_MULTIPLE_NEGATIVE_TAG = fromString("BadRequestMultipleNegativeTag"); + + /** Static value BadRequestImageTags for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_IMAGE_TAGS = fromString("BadRequestImageTags"); + + /** Static value BadRequestImageRegions for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_IMAGE_REGIONS = fromString("BadRequestImageRegions"); + + /** Static value BadRequestNegativeAndRegularTagOnSameImage for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_NEGATIVE_AND_REGULAR_TAG_ON_SAME_IMAGE = fromString("BadRequestNegativeAndRegularTagOnSameImage"); + + /** Static value BadRequestRequiredParamIsNull for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_REQUIRED_PARAM_IS_NULL = fromString("BadRequestRequiredParamIsNull"); + + /** Static value BadRequestIterationIsPublished for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_ITERATION_IS_PUBLISHED = fromString("BadRequestIterationIsPublished"); + + /** Static value BadRequestInvalidPublishName for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_INVALID_PUBLISH_NAME = fromString("BadRequestInvalidPublishName"); + + /** Static value BadRequestInvalidPublishTarget for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_INVALID_PUBLISH_TARGET = fromString("BadRequestInvalidPublishTarget"); + + /** Static value BadRequestUnpublishFailed for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_UNPUBLISH_FAILED = fromString("BadRequestUnpublishFailed"); + + /** Static value BadRequestIterationNotPublished for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_ITERATION_NOT_PUBLISHED = fromString("BadRequestIterationNotPublished"); + + /** Static value BadRequestSubscriptionApi for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_SUBSCRIPTION_API = fromString("BadRequestSubscriptionApi"); + + /** Static value BadRequestExceedProjectLimit for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_EXCEED_PROJECT_LIMIT = fromString("BadRequestExceedProjectLimit"); + + /** Static value BadRequestExceedIterationPerProjectLimit for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_EXCEED_ITERATION_PER_PROJECT_LIMIT = fromString("BadRequestExceedIterationPerProjectLimit"); + + /** Static value BadRequestExceedTagPerProjectLimit for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_EXCEED_TAG_PER_PROJECT_LIMIT = fromString("BadRequestExceedTagPerProjectLimit"); + + /** Static value BadRequestExceedTagPerImageLimit for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_EXCEED_TAG_PER_IMAGE_LIMIT = fromString("BadRequestExceedTagPerImageLimit"); + + /** Static value BadRequestExceededQuota for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_EXCEEDED_QUOTA = fromString("BadRequestExceededQuota"); + + /** Static value BadRequestCannotMigrateProjectWithName for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_CANNOT_MIGRATE_PROJECT_WITH_NAME = fromString("BadRequestCannotMigrateProjectWithName"); + + /** Static value BadRequestNotLimitedTrial for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_NOT_LIMITED_TRIAL = fromString("BadRequestNotLimitedTrial"); + + /** Static value BadRequestImageBatch for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_IMAGE_BATCH = fromString("BadRequestImageBatch"); + + /** Static value BadRequestImageStream for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_IMAGE_STREAM = fromString("BadRequestImageStream"); + + /** Static value BadRequestImageUrl for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_IMAGE_URL = fromString("BadRequestImageUrl"); + + /** Static value BadRequestImageFormat for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_IMAGE_FORMAT = fromString("BadRequestImageFormat"); + + /** Static value BadRequestImageSizeBytes for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_IMAGE_SIZE_BYTES = fromString("BadRequestImageSizeBytes"); + + /** Static value BadRequestImageExceededCount for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_IMAGE_EXCEEDED_COUNT = fromString("BadRequestImageExceededCount"); + + /** Static value BadRequestTrainingNotNeeded for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_TRAINING_NOT_NEEDED = fromString("BadRequestTrainingNotNeeded"); + + /** Static value BadRequestTrainingNotNeededButTrainingPipelineUpdated for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_TRAINING_NOT_NEEDED_BUT_TRAINING_PIPELINE_UPDATED = fromString("BadRequestTrainingNotNeededButTrainingPipelineUpdated"); + + /** Static value BadRequestTrainingValidationFailed for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_TRAINING_VALIDATION_FAILED = fromString("BadRequestTrainingValidationFailed"); + + /** Static value BadRequestClassificationTrainingValidationFailed for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_CLASSIFICATION_TRAINING_VALIDATION_FAILED = fromString("BadRequestClassificationTrainingValidationFailed"); + + /** Static value BadRequestMultiClassClassificationTrainingValidationFailed for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_MULTI_CLASS_CLASSIFICATION_TRAINING_VALIDATION_FAILED = fromString("BadRequestMultiClassClassificationTrainingValidationFailed"); + + /** Static value BadRequestMultiLabelClassificationTrainingValidationFailed for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_MULTI_LABEL_CLASSIFICATION_TRAINING_VALIDATION_FAILED = fromString("BadRequestMultiLabelClassificationTrainingValidationFailed"); + + /** Static value BadRequestDetectionTrainingValidationFailed for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_DETECTION_TRAINING_VALIDATION_FAILED = fromString("BadRequestDetectionTrainingValidationFailed"); + + /** Static value BadRequestTrainingAlreadyInProgress for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_TRAINING_ALREADY_IN_PROGRESS = fromString("BadRequestTrainingAlreadyInProgress"); + + /** Static value BadRequestDetectionTrainingNotAllowNegativeTag for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_DETECTION_TRAINING_NOT_ALLOW_NEGATIVE_TAG = fromString("BadRequestDetectionTrainingNotAllowNegativeTag"); + + /** Static value BadRequestInvalidEmailAddress for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_INVALID_EMAIL_ADDRESS = fromString("BadRequestInvalidEmailAddress"); + + /** Static value BadRequestDomainNotSupportedForAdvancedTraining for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_DOMAIN_NOT_SUPPORTED_FOR_ADVANCED_TRAINING = fromString("BadRequestDomainNotSupportedForAdvancedTraining"); + + /** Static value BadRequestExportPlatformNotSupportedForAdvancedTraining for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_EXPORT_PLATFORM_NOT_SUPPORTED_FOR_ADVANCED_TRAINING = fromString("BadRequestExportPlatformNotSupportedForAdvancedTraining"); + + /** Static value BadRequestReservedBudgetInHoursNotEnoughForAdvancedTraining for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_RESERVED_BUDGET_IN_HOURS_NOT_ENOUGH_FOR_ADVANCED_TRAINING = fromString("BadRequestReservedBudgetInHoursNotEnoughForAdvancedTraining"); + + /** Static value BadRequestExportValidationFailed for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_EXPORT_VALIDATION_FAILED = fromString("BadRequestExportValidationFailed"); + + /** Static value BadRequestExportAlreadyInProgress for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_EXPORT_ALREADY_IN_PROGRESS = fromString("BadRequestExportAlreadyInProgress"); + + /** Static value BadRequestPredictionIdsMissing for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_PREDICTION_IDS_MISSING = fromString("BadRequestPredictionIdsMissing"); + + /** Static value BadRequestPredictionIdsExceededCount for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_PREDICTION_IDS_EXCEEDED_COUNT = fromString("BadRequestPredictionIdsExceededCount"); + + /** Static value BadRequestPredictionTagsExceededCount for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_PREDICTION_TAGS_EXCEEDED_COUNT = fromString("BadRequestPredictionTagsExceededCount"); + + /** Static value BadRequestPredictionResultsExceededCount for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_PREDICTION_RESULTS_EXCEEDED_COUNT = fromString("BadRequestPredictionResultsExceededCount"); + + /** Static value BadRequestPredictionInvalidApplicationName for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_PREDICTION_INVALID_APPLICATION_NAME = fromString("BadRequestPredictionInvalidApplicationName"); + + /** Static value BadRequestPredictionInvalidQueryParameters for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_PREDICTION_INVALID_QUERY_PARAMETERS = fromString("BadRequestPredictionInvalidQueryParameters"); + + /** Static value BadRequestInvalid for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes BAD_REQUEST_INVALID = fromString("BadRequestInvalid"); + + /** Static value UnsupportedMediaType for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes UNSUPPORTED_MEDIA_TYPE = fromString("UnsupportedMediaType"); + + /** Static value Forbidden for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes FORBIDDEN = fromString("Forbidden"); + + /** Static value ForbiddenUser for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes FORBIDDEN_USER = fromString("ForbiddenUser"); + + /** Static value ForbiddenUserResource for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes FORBIDDEN_USER_RESOURCE = fromString("ForbiddenUserResource"); + + /** Static value ForbiddenUserSignupDisabled for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes FORBIDDEN_USER_SIGNUP_DISABLED = fromString("ForbiddenUserSignupDisabled"); + + /** Static value ForbiddenUserSignupAllowanceExceeded for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes FORBIDDEN_USER_SIGNUP_ALLOWANCE_EXCEEDED = fromString("ForbiddenUserSignupAllowanceExceeded"); + + /** Static value ForbiddenUserDoesNotExist for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes FORBIDDEN_USER_DOES_NOT_EXIST = fromString("ForbiddenUserDoesNotExist"); + + /** Static value ForbiddenUserDisabled for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes FORBIDDEN_USER_DISABLED = fromString("ForbiddenUserDisabled"); + + /** Static value ForbiddenUserInsufficientCapability for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes FORBIDDEN_USER_INSUFFICIENT_CAPABILITY = fromString("ForbiddenUserInsufficientCapability"); + + /** Static value ForbiddenDRModeEnabled for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes FORBIDDEN_DRMODE_ENABLED = fromString("ForbiddenDRModeEnabled"); + + /** Static value ForbiddenInvalid for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes FORBIDDEN_INVALID = fromString("ForbiddenInvalid"); + + /** Static value NotFound for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes NOT_FOUND = fromString("NotFound"); + + /** Static value NotFoundProject for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes NOT_FOUND_PROJECT = fromString("NotFoundProject"); + + /** Static value NotFoundProjectDefaultIteration for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes NOT_FOUND_PROJECT_DEFAULT_ITERATION = fromString("NotFoundProjectDefaultIteration"); + + /** Static value NotFoundIteration for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes NOT_FOUND_ITERATION = fromString("NotFoundIteration"); + + /** Static value NotFoundIterationPerformance for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes NOT_FOUND_ITERATION_PERFORMANCE = fromString("NotFoundIterationPerformance"); + + /** Static value NotFoundTag for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes NOT_FOUND_TAG = fromString("NotFoundTag"); + + /** Static value NotFoundImage for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes NOT_FOUND_IMAGE = fromString("NotFoundImage"); + + /** Static value NotFoundDomain for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes NOT_FOUND_DOMAIN = fromString("NotFoundDomain"); + + /** Static value NotFoundApimSubscription for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes NOT_FOUND_APIM_SUBSCRIPTION = fromString("NotFoundApimSubscription"); + + /** Static value NotFoundInvalid for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes NOT_FOUND_INVALID = fromString("NotFoundInvalid"); + + /** Static value Conflict for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes CONFLICT = fromString("Conflict"); + + /** Static value ConflictInvalid for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes CONFLICT_INVALID = fromString("ConflictInvalid"); + + /** Static value ErrorUnknown for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_UNKNOWN = fromString("ErrorUnknown"); + + /** Static value ErrorProjectInvalidWorkspace for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_PROJECT_INVALID_WORKSPACE = fromString("ErrorProjectInvalidWorkspace"); + + /** Static value ErrorProjectInvalidPipelineConfiguration for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_PROJECT_INVALID_PIPELINE_CONFIGURATION = fromString("ErrorProjectInvalidPipelineConfiguration"); + + /** Static value ErrorProjectInvalidDomain for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_PROJECT_INVALID_DOMAIN = fromString("ErrorProjectInvalidDomain"); + + /** Static value ErrorProjectTrainingRequestFailed for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_PROJECT_TRAINING_REQUEST_FAILED = fromString("ErrorProjectTrainingRequestFailed"); + + /** Static value ErrorProjectExportRequestFailed for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_PROJECT_EXPORT_REQUEST_FAILED = fromString("ErrorProjectExportRequestFailed"); + + /** Static value ErrorFeaturizationServiceUnavailable for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_FEATURIZATION_SERVICE_UNAVAILABLE = fromString("ErrorFeaturizationServiceUnavailable"); + + /** Static value ErrorFeaturizationQueueTimeout for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_FEATURIZATION_QUEUE_TIMEOUT = fromString("ErrorFeaturizationQueueTimeout"); + + /** Static value ErrorFeaturizationInvalidFeaturizer for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_FEATURIZATION_INVALID_FEATURIZER = fromString("ErrorFeaturizationInvalidFeaturizer"); + + /** Static value ErrorFeaturizationAugmentationUnavailable for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_FEATURIZATION_AUGMENTATION_UNAVAILABLE = fromString("ErrorFeaturizationAugmentationUnavailable"); + + /** Static value ErrorFeaturizationUnrecognizedJob for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_FEATURIZATION_UNRECOGNIZED_JOB = fromString("ErrorFeaturizationUnrecognizedJob"); + + /** Static value ErrorFeaturizationAugmentationError for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_FEATURIZATION_AUGMENTATION_ERROR = fromString("ErrorFeaturizationAugmentationError"); + + /** Static value ErrorExporterInvalidPlatform for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_EXPORTER_INVALID_PLATFORM = fromString("ErrorExporterInvalidPlatform"); + + /** Static value ErrorExporterInvalidFeaturizer for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_EXPORTER_INVALID_FEATURIZER = fromString("ErrorExporterInvalidFeaturizer"); + + /** Static value ErrorExporterInvalidClassifier for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_EXPORTER_INVALID_CLASSIFIER = fromString("ErrorExporterInvalidClassifier"); + + /** Static value ErrorPredictionServiceUnavailable for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_PREDICTION_SERVICE_UNAVAILABLE = fromString("ErrorPredictionServiceUnavailable"); + + /** Static value ErrorPredictionModelNotFound for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_PREDICTION_MODEL_NOT_FOUND = fromString("ErrorPredictionModelNotFound"); + + /** Static value ErrorPredictionModelNotCached for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_PREDICTION_MODEL_NOT_CACHED = fromString("ErrorPredictionModelNotCached"); + + /** Static value ErrorPrediction for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_PREDICTION = fromString("ErrorPrediction"); + + /** Static value ErrorPredictionStorage for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_PREDICTION_STORAGE = fromString("ErrorPredictionStorage"); + + /** Static value ErrorRegionProposal for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_REGION_PROPOSAL = fromString("ErrorRegionProposal"); + + /** Static value ErrorInvalid for CustomVisionErrorCodes. */ + public static final CustomVisionErrorCodes ERROR_INVALID = fromString("ErrorInvalid"); + + /** + * Creates or finds a CustomVisionErrorCodes from its string representation. + * @param name a name to look for + * @return the corresponding CustomVisionErrorCodes + */ + @JsonCreator + public static CustomVisionErrorCodes fromString(String name) { + return fromString(name, CustomVisionErrorCodes.class); + } + + /** + * @return known CustomVisionErrorCodes values + */ + public static Collection values() { + return values(CustomVisionErrorCodes.class); + } +} diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CustomVisionErrorException.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CustomVisionErrorException.java new file mode 100644 index 000000000000..8e371bfcc331 --- /dev/null +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/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.training.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/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Export.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Export.java index c4dc3d42098e..5fe29812eb8e 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Export.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Export.java @@ -15,31 +15,35 @@ */ public class Export { /** - * Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX'. + * Platform of the export. Possible values include: 'CoreML', 'TensorFlow', + * 'DockerFile', 'ONNX', 'VAIDK'. */ @JsonProperty(value = "platform", access = JsonProperty.Access.WRITE_ONLY) private ExportPlatform 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; + private ExportStatus 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', 'ARM'. */ @JsonProperty(value = "flavor", access = JsonProperty.Access.WRITE_ONLY) private ExportFlavor 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; @@ -58,7 +62,7 @@ public ExportPlatform platform() { * * @return the status value */ - public ExportStatusModel status() { + public ExportStatus status() { return this.status; } diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportFlavor.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportFlavor.java index 72aeb179147e..0239305e6183 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportFlavor.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportFlavor.java @@ -22,6 +22,15 @@ public final class ExportFlavor extends ExpandableStringEnum { /** Static value Windows for ExportFlavor. */ public static final ExportFlavor WINDOWS = fromString("Windows"); + /** Static value ONNX10 for ExportFlavor. */ + public static final ExportFlavor ONNX10 = fromString("ONNX10"); + + /** Static value ONNX12 for ExportFlavor. */ + public static final ExportFlavor ONNX12 = fromString("ONNX12"); + + /** Static value ARM for ExportFlavor. */ + public static final ExportFlavor ARM = fromString("ARM"); + /** * Creates or finds a ExportFlavor from its string representation. * @param name a name to look for diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportIterationOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportIterationOptionalParameter.java index 9afa55cc54bd..db5a063def32 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportIterationOptionalParameter.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportIterationOptionalParameter.java @@ -14,8 +14,8 @@ */ public class ExportIterationOptionalParameter { /** - * The flavor of the target platform (Windows, Linux, ARM, or GPU). - * Possible values include: 'Linux', 'Windows'. + * The flavor of the target platform. Possible values include: 'Linux', + * 'Windows', 'ONNX10', 'ONNX12', 'ARM'. */ private String flavor; diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportPlatform.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportPlatform.java index 563148e4ad36..45cd5acc80b1 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportPlatform.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportPlatform.java @@ -28,6 +28,9 @@ public final class ExportPlatform extends ExpandableStringEnum { /** Static value ONNX for ExportPlatform. */ public static final ExportPlatform ONNX = fromString("ONNX"); + /** Static value VAIDK for ExportPlatform. */ + public static final ExportPlatform VAIDK = fromString("VAIDK"); + /** * Creates or finds a ExportPlatform from its string representation. * @param name a name to look for diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportStatus.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportStatus.java new file mode 100644 index 000000000000..458772522e8f --- /dev/null +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportStatus.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.training.models; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ExportStatus. + */ +public final class ExportStatus extends ExpandableStringEnum { + /** Static value Exporting for ExportStatus. */ + public static final ExportStatus EXPORTING = fromString("Exporting"); + + /** Static value Failed for ExportStatus. */ + public static final ExportStatus FAILED = fromString("Failed"); + + /** Static value Done for ExportStatus. */ + public static final ExportStatus DONE = fromString("Done"); + + /** + * Creates or finds a ExportStatus from its string representation. + * @param name a name to look for + * @return the corresponding ExportStatus + */ + @JsonCreator + public static ExportStatus fromString(String name) { + return fromString(name, ExportStatus.class); + } + + /** + * @return known ExportStatus values + */ + public static Collection values() { + return values(ExportStatus.class); + } +} diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportStatusModel.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportStatusModel.java deleted file mode 100644 index 533c5e883c50..000000000000 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportStatusModel.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * 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 ExportStatusModel. - */ -public final class ExportStatusModel extends ExpandableStringEnum { - /** Static value Exporting for ExportStatusModel. */ - public static final ExportStatusModel EXPORTING = fromString("Exporting"); - - /** Static value Failed for ExportStatusModel. */ - public static final ExportStatusModel FAILED = fromString("Failed"); - - /** Static value Done for ExportStatusModel. */ - public static final ExportStatusModel DONE = fromString("Done"); - - /** - * Creates or finds a ExportStatusModel from its string representation. - * @param name a name to look for - * @return the corresponding ExportStatusModel - */ - @JsonCreator - public static ExportStatusModel fromString(String name) { - return fromString(name, ExportStatusModel.class); - } - - /** - * @return known ExportStatusModel values - */ - public static Collection values() { - return values(ExportStatusModel.class); - } -} diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetImagePerformanceCountOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetImagePerformanceCountOptionalParameter.java index 5d049896a99e..4475eb19adf9 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetImagePerformanceCountOptionalParameter.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetImagePerformanceCountOptionalParameter.java @@ -9,6 +9,7 @@ package com.microsoft.azure.cognitiveservices.vision.customvision.training.models; import java.util.List; +import java.util.UUID; /** * The GetImagePerformanceCountOptionalParameter model. @@ -18,7 +19,7 @@ public class GetImagePerformanceCountOptionalParameter { * A list of tags ids to filter the images to count. Defaults to all tags * when null. */ - private List tagIds; + private List tagIds; /** * Gets or sets the preferred language for the response. @@ -30,7 +31,7 @@ public class GetImagePerformanceCountOptionalParameter { * * @return the tagIds value */ - public List tagIds() { + public List tagIds() { return this.tagIds; } @@ -40,7 +41,7 @@ public List tagIds() { * @param tagIds the tagIds value to set * @return the GetImagePerformanceCountOptionalParameter object itself. */ - public GetImagePerformanceCountOptionalParameter withTagIds(List tagIds) { + public GetImagePerformanceCountOptionalParameter withTagIds(List tagIds) { this.tagIds = tagIds; return this; } diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetImagePerformancesOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetImagePerformancesOptionalParameter.java index 0ec8af788ad8..edd718142b28 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetImagePerformancesOptionalParameter.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetImagePerformancesOptionalParameter.java @@ -9,6 +9,7 @@ package com.microsoft.azure.cognitiveservices.vision.customvision.training.models; import java.util.List; +import java.util.UUID; /** * The GetImagePerformancesOptionalParameter model. @@ -18,7 +19,7 @@ public class GetImagePerformancesOptionalParameter { * A list of tags ids to filter the images. Defaults to all tagged images * when null. Limited to 20. */ - private List tagIds; + private List tagIds; /** * The ordering. Defaults to newest. Possible values include: 'Newest', @@ -47,7 +48,7 @@ public class GetImagePerformancesOptionalParameter { * * @return the tagIds value */ - public List tagIds() { + public List tagIds() { return this.tagIds; } @@ -57,7 +58,7 @@ public List tagIds() { * @param tagIds the tagIds value to set * @return the GetImagePerformancesOptionalParameter object itself. */ - public GetImagePerformancesOptionalParameter withTagIds(List tagIds) { + public GetImagePerformancesOptionalParameter withTagIds(List tagIds) { this.tagIds = tagIds; return this; } diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetImagesByIdsOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetImagesByIdsOptionalParameter.java index 442d8ebd1965..2f3e86e7a6fd 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetImagesByIdsOptionalParameter.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetImagesByIdsOptionalParameter.java @@ -18,7 +18,7 @@ public class GetImagesByIdsOptionalParameter { /** * The list of image ids to retrieve. Limited to 256. */ - private List imageIds; + private List imageIds; /** * The iteration id. Defaults to workspace. @@ -35,7 +35,7 @@ public class GetImagesByIdsOptionalParameter { * * @return the imageIds value */ - public List imageIds() { + public List imageIds() { return this.imageIds; } @@ -45,7 +45,7 @@ public List imageIds() { * @param imageIds the imageIds value to set * @return the GetImagesByIdsOptionalParameter object itself. */ - public GetImagesByIdsOptionalParameter withImageIds(List imageIds) { + public GetImagesByIdsOptionalParameter withImageIds(List imageIds) { this.imageIds = imageIds; return this; } diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetTaggedImageCountOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetTaggedImageCountOptionalParameter.java index fe834425ae31..6dbd64af1340 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetTaggedImageCountOptionalParameter.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetTaggedImageCountOptionalParameter.java @@ -24,7 +24,7 @@ public class GetTaggedImageCountOptionalParameter { * A list of tags ids to filter the images to count. Defaults to all tags * when null. */ - private List tagIds; + private List tagIds; /** * Gets or sets the preferred language for the response. @@ -56,7 +56,7 @@ public GetTaggedImageCountOptionalParameter withIterationId(UUID iterationId) { * * @return the tagIds value */ - public List tagIds() { + public List tagIds() { return this.tagIds; } @@ -66,7 +66,7 @@ public List tagIds() { * @param tagIds the tagIds value to set * @return the GetTaggedImageCountOptionalParameter object itself. */ - public GetTaggedImageCountOptionalParameter withTagIds(List tagIds) { + public GetTaggedImageCountOptionalParameter withTagIds(List tagIds) { this.tagIds = tagIds; return this; } diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetTaggedImagesOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetTaggedImagesOptionalParameter.java index 306b1f337a02..3314442c7d13 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetTaggedImagesOptionalParameter.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetTaggedImagesOptionalParameter.java @@ -24,7 +24,7 @@ public class GetTaggedImagesOptionalParameter { * A list of tags ids to filter the images. Defaults to all tagged images * when null. Limited to 20. */ - private List tagIds; + private List tagIds; /** * The ordering. Defaults to newest. Possible values include: 'Newest', @@ -73,7 +73,7 @@ public GetTaggedImagesOptionalParameter withIterationId(UUID iterationId) { * * @return the tagIds value */ - public List tagIds() { + public List tagIds() { return this.tagIds; } @@ -83,7 +83,7 @@ public List tagIds() { * @param tagIds the tagIds value to set * @return the GetTaggedImagesOptionalParameter object itself. */ - public GetTaggedImagesOptionalParameter withTagIds(List tagIds) { + public GetTaggedImagesOptionalParameter withTagIds(List tagIds) { this.tagIds = tagIds; return this; } diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Image.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Image.java index 2dd19b767654..f91a8f0fa3eb 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Image.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Image.java @@ -18,49 +18,55 @@ */ 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; @@ -102,12 +108,12 @@ public int height() { } /** - * Get the imageUri value. + * Get the resizedImageUri value. * - * @return the imageUri value + * @return the resizedImageUri value */ - public String imageUri() { - return this.imageUri; + public String resizedImageUri() { + return this.resizedImageUri; } /** @@ -119,6 +125,15 @@ public String thumbnailUri() { return this.thumbnailUri; } + /** + * Get the originalImageUri value. + * + * @return the originalImageUri value + */ + public String originalImageUri() { + return this.originalImageUri; + } + /** * Get the tags value. * diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageCreateResult.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageCreateResult.java index 550d0a0ec3b7..160f0e627e13 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageCreateResult.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageCreateResult.java @@ -15,22 +15,23 @@ */ 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; @@ -49,7 +50,7 @@ public String sourceUrl() { * * @return the status value */ - public ImageUploadStatus status() { + public ImageCreateStatus status() { return this.status; } diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageCreateStatus.java b/sdk/cognitiveservices/ms-azure-cs-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/sdk/cognitiveservices/ms-azure-cs-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/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageCreateSummary.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageCreateSummary.java index 16597571a075..69f18a1ac396 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageCreateSummary.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageCreateSummary.java @@ -16,13 +16,14 @@ */ 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; diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageIdCreateEntry.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageIdCreateEntry.java index 050efd57101b..c1fdc9ffb23a 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageIdCreateEntry.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageIdCreateEntry.java @@ -17,7 +17,7 @@ */ public class ImageIdCreateEntry { /** - * The id property. + * Id of the image. */ @JsonProperty(value = "id") private UUID id; diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImagePrediction.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImagePrediction.java index 81f0107ce3ae..6e05bb928dc6 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImagePrediction.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImagePrediction.java @@ -14,35 +14,35 @@ 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; diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegion.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegion.java index 36e160ed153d..d7b35cefc8bb 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegion.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegion.java @@ -35,33 +35,33 @@ public class ImageRegion { private DateTime created; /** - * The tagId property. + * Id of the tag associated with this region. */ - @JsonProperty(value = "tagId") + @JsonProperty(value = "tagId", required = true) private UUID tagId; /** - * The left property. + * Coordinate of the left boundary. */ - @JsonProperty(value = "left") + @JsonProperty(value = "left", required = true) private double left; /** - * The top property. + * Coordinate of the top boundary. */ - @JsonProperty(value = "top") + @JsonProperty(value = "top", required = true) private double top; /** - * The width property. + * Width. */ - @JsonProperty(value = "width") + @JsonProperty(value = "width", required = true) private double width; /** - * The height property. + * Height. */ - @JsonProperty(value = "height") + @JsonProperty(value = "height", required = true) private double height; /** diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionCreateEntry.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionCreateEntry.java index 077f0d78db63..6bbd00436744 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionCreateEntry.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionCreateEntry.java @@ -12,43 +12,43 @@ 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") + @JsonProperty(value = "imageId", required = true) private UUID imageId; /** - * The tagId property. + * Id of the tag associated with this region. */ - @JsonProperty(value = "tagId") + @JsonProperty(value = "tagId", required = true) private UUID tagId; /** - * The left property. + * Coordinate of the left boundary. */ - @JsonProperty(value = "left") + @JsonProperty(value = "left", required = true) private double left; /** - * The top property. + * Coordinate of the top boundary. */ - @JsonProperty(value = "top") + @JsonProperty(value = "top", required = true) private double top; /** - * The width property. + * Width. */ - @JsonProperty(value = "width") + @JsonProperty(value = "width", required = true) private double width; /** - * The height property. + * Height. */ - @JsonProperty(value = "height") + @JsonProperty(value = "height", required = true) private double height; /** diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionCreateResult.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionCreateResult.java index 212f89ba2b42..40718249da72 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionCreateResult.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionCreateResult.java @@ -41,33 +41,33 @@ public class ImageRegionCreateResult { private DateTime created; /** - * The tagId property. + * Id of the tag associated with this region. */ - @JsonProperty(value = "tagId") + @JsonProperty(value = "tagId", required = true) private UUID tagId; /** - * The left property. + * Coordinate of the left boundary. */ - @JsonProperty(value = "left") + @JsonProperty(value = "left", required = true) private double left; /** - * The top property. + * Coordinate of the top boundary. */ - @JsonProperty(value = "top") + @JsonProperty(value = "top", required = true) private double top; /** - * The width property. + * Width. */ - @JsonProperty(value = "width") + @JsonProperty(value = "width", required = true) private double width; /** - * The height property. + * Height. */ - @JsonProperty(value = "height") + @JsonProperty(value = "height", required = true) private double height; /** diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageTagCreateBatch.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageTagCreateBatch.java index 1a6645dd0e2f..146245b37965 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageTagCreateBatch.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageTagCreateBatch.java @@ -12,11 +12,11 @@ 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; diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageTagCreateEntry.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageTagCreateEntry.java index f907b176be74..f0272b308f5b 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageTagCreateEntry.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageTagCreateEntry.java @@ -12,17 +12,17 @@ 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; diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageUploadStatus.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageUploadStatus.java deleted file mode 100644 index 83f41cec498e..000000000000 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageUploadStatus.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * 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 ImageUploadStatus. - */ -public final class ImageUploadStatus extends ExpandableStringEnum { - /** Static value OK for ImageUploadStatus. */ - public static final ImageUploadStatus OK = fromString("OK"); - - /** Static value OKDuplicate for ImageUploadStatus. */ - public static final ImageUploadStatus OKDUPLICATE = fromString("OKDuplicate"); - - /** Static value ErrorSource for ImageUploadStatus. */ - public static final ImageUploadStatus ERROR_SOURCE = fromString("ErrorSource"); - - /** Static value ErrorImageFormat for ImageUploadStatus. */ - public static final ImageUploadStatus ERROR_IMAGE_FORMAT = fromString("ErrorImageFormat"); - - /** Static value ErrorImageSize for ImageUploadStatus. */ - public static final ImageUploadStatus ERROR_IMAGE_SIZE = fromString("ErrorImageSize"); - - /** Static value ErrorStorage for ImageUploadStatus. */ - public static final ImageUploadStatus ERROR_STORAGE = fromString("ErrorStorage"); - - /** Static value ErrorLimitExceed for ImageUploadStatus. */ - public static final ImageUploadStatus ERROR_LIMIT_EXCEED = fromString("ErrorLimitExceed"); - - /** Static value ErrorTagLimitExceed for ImageUploadStatus. */ - public static final ImageUploadStatus ERROR_TAG_LIMIT_EXCEED = fromString("ErrorTagLimitExceed"); - - /** Static value ErrorRegionLimitExceed for ImageUploadStatus. */ - public static final ImageUploadStatus ERROR_REGION_LIMIT_EXCEED = fromString("ErrorRegionLimitExceed"); - - /** Static value ErrorUnknown for ImageUploadStatus. */ - public static final ImageUploadStatus ERROR_UNKNOWN = fromString("ErrorUnknown"); - - /** - * Creates or finds a ImageUploadStatus from its string representation. - * @param name a name to look for - * @return the corresponding ImageUploadStatus - */ - @JsonCreator - public static ImageUploadStatus fromString(String name) { - return fromString(name, ImageUploadStatus.class); - } - - /** - * @return known ImageUploadStatus values - */ - public static Collection values() { - return values(ImageUploadStatus.class); - } -} diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageUrl.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageUrl.java index 2fb58d808300..c92df04647ee 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageUrl.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageUrl.java @@ -11,13 +11,13 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The ImageUrl model. + * Image url. */ public class ImageUrl { /** - * The url property. + * Url of the image. */ - @JsonProperty(value = "url") + @JsonProperty(value = "url", required = true) private String url; /** diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageUrlCreateEntry.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageUrlCreateEntry.java index c5077f75461e..809a81616da0 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageUrlCreateEntry.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageUrlCreateEntry.java @@ -17,9 +17,9 @@ */ public class ImageUrlCreateEntry { /** - * The url property. + * Url of the image. */ - @JsonProperty(value = "url") + @JsonProperty(value = "url", required = true) private String url; /** diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Iteration.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Iteration.java index 2f3eb95aeab3..30237bfdf44e 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Iteration.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Iteration.java @@ -10,6 +10,7 @@ import java.util.UUID; import org.joda.time.DateTime; +import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -25,16 +26,9 @@ public class Iteration { /** * Gets or sets the name of the iteration. */ - @JsonProperty(value = "name") + @JsonProperty(value = "name", required = true) private String name; - /** - * Gets or sets a value indicating whether the iteration is the default - * iteration for the project. - */ - @JsonProperty(value = "isDefault") - private boolean isDefault; - /** * Gets the current iteration status. */ @@ -71,6 +65,12 @@ public class Iteration { @JsonProperty(value = "exportable", access = JsonProperty.Access.WRITE_ONLY) private boolean exportable; + /** + * A set of platforms this iteration can export to. + */ + @JsonProperty(value = "exportableTo", access = JsonProperty.Access.WRITE_ONLY) + private List exportableTo; + /** * Get or sets a guid of the domain the iteration has been trained on. */ @@ -84,6 +84,31 @@ public class Iteration { @JsonProperty(value = "classificationType", access = JsonProperty.Access.WRITE_ONLY) private Classifier classificationType; + /** + * Gets the training type of the iteration. Possible values include: + * 'Regular', 'Advanced'. + */ + @JsonProperty(value = "trainingType", access = JsonProperty.Access.WRITE_ONLY) + private TrainingType trainingType; + + /** + * Gets the reserved advanced training budget for the iteration. + */ + @JsonProperty(value = "reservedBudgetInHours", access = JsonProperty.Access.WRITE_ONLY) + private int reservedBudgetInHours; + + /** + * Name of the published model. + */ + @JsonProperty(value = "publishName", access = JsonProperty.Access.WRITE_ONLY) + private String publishName; + + /** + * Resource Provider Id this iteration was originally published to. + */ + @JsonProperty(value = "originalPublishResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String originalPublishResourceId; + /** * Get the id value. * @@ -113,26 +138,6 @@ public Iteration withName(String name) { return this; } - /** - * Get the isDefault value. - * - * @return the isDefault value - */ - public boolean isDefault() { - return this.isDefault; - } - - /** - * Set the isDefault value. - * - * @param isDefault the isDefault value to set - * @return the Iteration object itself. - */ - public Iteration withIsDefault(boolean isDefault) { - this.isDefault = isDefault; - return this; - } - /** * Get the status value. * @@ -187,6 +192,15 @@ public boolean exportable() { return this.exportable; } + /** + * Get the exportableTo value. + * + * @return the exportableTo value + */ + public List exportableTo() { + return this.exportableTo; + } + /** * Get the domainId value. * @@ -205,4 +219,40 @@ public Classifier classificationType() { return this.classificationType; } + /** + * Get the trainingType value. + * + * @return the trainingType value + */ + public TrainingType trainingType() { + return this.trainingType; + } + + /** + * Get the reservedBudgetInHours value. + * + * @return the reservedBudgetInHours value + */ + public int reservedBudgetInHours() { + return this.reservedBudgetInHours; + } + + /** + * Get the publishName value. + * + * @return the publishName value + */ + public String publishName() { + return this.publishName; + } + + /** + * Get the originalPublishResourceId value. + * + * @return the originalPublishResourceId value + */ + public String originalPublishResourceId() { + return this.originalPublishResourceId; + } + } diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Prediction.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Prediction.java index 7b22c84704c6..cd639ba1e5be 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Prediction.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Prediction.java @@ -12,29 +12,29 @@ 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; diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Project.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Project.java index 31dd5e249e6e..79a878a120dd 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Project.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Project.java @@ -25,19 +25,19 @@ public class Project { /** * Gets or sets the name of the project. */ - @JsonProperty(value = "name") + @JsonProperty(value = "name", required = true) private String name; /** * Gets or sets the description of the project. */ - @JsonProperty(value = "description") + @JsonProperty(value = "description", required = true) private String description; /** * Gets or sets the project settings. */ - @JsonProperty(value = "settings") + @JsonProperty(value = "settings", required = true) private ProjectSettings settings; /** @@ -47,17 +47,23 @@ 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; /** - * Gets the thumbnail url representing the project. + * Gets the thumbnail url representing the image. */ @JsonProperty(value = "thumbnailUri", access = JsonProperty.Access.WRITE_ONLY) private String thumbnailUri; + /** + * Gets if the DR mode is on. + */ + @JsonProperty(value = "drModeEnabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean drModeEnabled; + /** * Get the id value. * @@ -154,4 +160,13 @@ public String thumbnailUri() { return this.thumbnailUri; } + /** + * Get the drModeEnabled value. + * + * @return the drModeEnabled value + */ + public Boolean drModeEnabled() { + return this.drModeEnabled; + } + } diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ProjectSettings.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ProjectSettings.java index ba8855458e12..a9f9d4b7c589 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ProjectSettings.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ProjectSettings.java @@ -9,6 +9,7 @@ package com.microsoft.azure.cognitiveservices.vision.customvision.training.models; import java.util.UUID; +import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -28,6 +29,13 @@ public class ProjectSettings { @JsonProperty(value = "classificationType") private Classifier classificationType; + /** + * A list of ExportPlatform that the trained model should be able to + * support. + */ + @JsonProperty(value = "targetExportPlatforms") + private List targetExportPlatforms; + /** * Get the domainId value. * @@ -68,4 +76,24 @@ public ProjectSettings withClassificationType(Classifier classificationType) { return this; } + /** + * Get the targetExportPlatforms value. + * + * @return the targetExportPlatforms value + */ + public List targetExportPlatforms() { + return this.targetExportPlatforms; + } + + /** + * Set the targetExportPlatforms value. + * + * @param targetExportPlatforms the targetExportPlatforms value to set + * @return the ProjectSettings object itself. + */ + public ProjectSettings withTargetExportPlatforms(List targetExportPlatforms) { + this.targetExportPlatforms = targetExportPlatforms; + return this; + } + } diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/QuickTestImageUrlOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/QuickTestImageUrlOptionalParameter.java index 6e63337d65a1..255e4835eb10 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/QuickTestImageUrlOptionalParameter.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/QuickTestImageUrlOptionalParameter.java @@ -21,11 +21,6 @@ public class QuickTestImageUrlOptionalParameter { */ private UUID iterationId; - /** - * The url property. - */ - private String url; - /** * Gets or sets the preferred language for the response. */ @@ -51,26 +46,6 @@ public QuickTestImageUrlOptionalParameter withIterationId(UUID iterationId) { return this; } - /** - * Get the url value. - * - * @return the url value - */ - public String url() { - return this.url; - } - - /** - * Set the url value. - * - * @param url the url value to set - * @return the QuickTestImageUrlOptionalParameter object itself. - */ - public QuickTestImageUrlOptionalParameter withUrl(String url) { - this.url = url; - return this; - } - /** * Get the thisclientacceptLanguage value. * diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Region.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Region.java index 1c9cf038292c..5f8f0fefb9a5 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Region.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Region.java @@ -16,33 +16,33 @@ */ public class Region { /** - * The tagId property. + * Id of the tag associated with this region. */ - @JsonProperty(value = "tagId") + @JsonProperty(value = "tagId", required = true) private UUID tagId; /** - * The left property. + * Coordinate of the left boundary. */ - @JsonProperty(value = "left") + @JsonProperty(value = "left", required = true) private double left; /** - * The top property. + * Coordinate of the top boundary. */ - @JsonProperty(value = "top") + @JsonProperty(value = "top", required = true) private double top; /** - * The width property. + * Width. */ - @JsonProperty(value = "width") + @JsonProperty(value = "width", required = true) private double width; /** - * The height property. + * Height. */ - @JsonProperty(value = "height") + @JsonProperty(value = "height", required = true) private double height; /** diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/StoredImagePrediction.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/StoredImagePrediction.java index 763004edf3f6..6ca7fd05455f 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/StoredImagePrediction.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/StoredImagePrediction.java @@ -18,60 +18,66 @@ */ 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; /** - * 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 imageUri value. + * Get the resizedImageUri value. * - * @return the imageUri value + * @return the resizedImageUri value */ - public String imageUri() { - return this.imageUri; + public String resizedImageUri() { + return this.resizedImageUri; } /** @@ -83,6 +89,15 @@ public String thumbnailUri() { return this.thumbnailUri; } + /** + * Get the originalImageUri value. + * + * @return the originalImageUri value + */ + public String originalImageUri() { + return this.originalImageUri; + } + /** * Get the domain value. * diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Tag.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Tag.java index 42de469690e0..cc08395abc8f 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Tag.java +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Tag.java @@ -24,15 +24,22 @@ public class Tag { /** * Gets or sets the name of the tag. */ - @JsonProperty(value = "name") + @JsonProperty(value = "name", required = true) private String name; /** * Gets or sets the description of the tag. */ - @JsonProperty(value = "description") + @JsonProperty(value = "description", required = true) private String description; + /** + * Gets or sets the type of the tag. Possible values include: 'Regular', + * 'Negative'. + */ + @JsonProperty(value = "type", required = true) + private TagType type; + /** * Gets the number of images with this tag. */ @@ -88,6 +95,26 @@ public Tag withDescription(String description) { return this; } + /** + * Get the type value. + * + * @return the type value + */ + public TagType type() { + return this.type; + } + + /** + * Set the type value. + * + * @param type the type value to set + * @return the Tag object itself. + */ + public Tag withType(TagType type) { + this.type = type; + return this; + } + /** * Get the imageCount value. * diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/TagType.java b/sdk/cognitiveservices/ms-azure-cs-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/sdk/cognitiveservices/ms-azure-cs-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/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/TrainProjectOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/TrainProjectOptionalParameter.java new file mode 100644 index 000000000000..9848368d8f05 --- /dev/null +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/TrainProjectOptionalParameter.java @@ -0,0 +1,144 @@ +/** + * 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; + + +/** + * The TrainProjectOptionalParameter model. + */ +public class TrainProjectOptionalParameter { + /** + * The type of training to use to train the project (default: Regular). + * Possible values include: 'Regular', 'Advanced'. + */ + private String trainingType; + + /** + * The number of hours reserved as budget for training (if applicable). + */ + private Integer reservedBudgetInHours; + + /** + * Whether to force train even if dataset and configuration does not change + * (default: false). + */ + private Boolean forceTrain; + + /** + * The email address to send notification to when training finishes + * (default: null). + */ + private String notificationEmailAddress; + + /** + * Gets or sets the preferred language for the response. + */ + private String thisclientacceptLanguage; + + /** + * Get the trainingType value. + * + * @return the trainingType value + */ + public String trainingType() { + return this.trainingType; + } + + /** + * Set the trainingType value. + * + * @param trainingType the trainingType value to set + * @return the TrainProjectOptionalParameter object itself. + */ + public TrainProjectOptionalParameter withTrainingType(String trainingType) { + this.trainingType = trainingType; + return this; + } + + /** + * Get the reservedBudgetInHours value. + * + * @return the reservedBudgetInHours value + */ + public Integer reservedBudgetInHours() { + return this.reservedBudgetInHours; + } + + /** + * Set the reservedBudgetInHours value. + * + * @param reservedBudgetInHours the reservedBudgetInHours value to set + * @return the TrainProjectOptionalParameter object itself. + */ + public TrainProjectOptionalParameter withReservedBudgetInHours(Integer reservedBudgetInHours) { + this.reservedBudgetInHours = reservedBudgetInHours; + return this; + } + + /** + * Get the forceTrain value. + * + * @return the forceTrain value + */ + public Boolean forceTrain() { + return this.forceTrain; + } + + /** + * Set the forceTrain value. + * + * @param forceTrain the forceTrain value to set + * @return the TrainProjectOptionalParameter object itself. + */ + public TrainProjectOptionalParameter withForceTrain(Boolean forceTrain) { + this.forceTrain = forceTrain; + return this; + } + + /** + * Get the notificationEmailAddress value. + * + * @return the notificationEmailAddress value + */ + public String notificationEmailAddress() { + return this.notificationEmailAddress; + } + + /** + * Set the notificationEmailAddress value. + * + * @param notificationEmailAddress the notificationEmailAddress value to set + * @return the TrainProjectOptionalParameter object itself. + */ + public TrainProjectOptionalParameter withNotificationEmailAddress(String notificationEmailAddress) { + this.notificationEmailAddress = notificationEmailAddress; + return this; + } + + /** + * Get the thisclientacceptLanguage value. + * + * @return the thisclientacceptLanguage value + */ + public String thisclientacceptLanguage() { + return this.thisclientacceptLanguage; + } + + /** + * Set the thisclientacceptLanguage value. + * + * @param thisclientacceptLanguage the thisclientacceptLanguage value to set + * @return the TrainProjectOptionalParameter object itself. + */ + public TrainProjectOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/TrainingType.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/TrainingType.java new file mode 100644 index 000000000000..5ee70ee1b563 --- /dev/null +++ b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/TrainingType.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 TrainingType. + */ +public final class TrainingType extends ExpandableStringEnum { + /** Static value Regular for TrainingType. */ + public static final TrainingType REGULAR = fromString("Regular"); + + /** Static value Advanced for TrainingType. */ + public static final TrainingType ADVANCED = fromString("Advanced"); + + /** + * Creates or finds a TrainingType from its string representation. + * @param name a name to look for + * @return the corresponding TrainingType + */ + @JsonCreator + public static TrainingType fromString(String name) { + return fromString(name, TrainingType.class); + } + + /** + * @return known TrainingType values + */ + public static Collection values() { + return values(TrainingType.class); + } +} diff --git a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/package-info.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/package-info.java index a23776b5606c..06f9626aacbd 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/package-info.java +++ b/sdk/cognitiveservices/ms-azure-cs-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/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/package-info.java b/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/package-info.java index 40cf7938d6de..92a37b7d2484 100644 --- a/sdk/cognitiveservices/ms-azure-cs-customvision-training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/package-info.java +++ b/sdk/cognitiveservices/ms-azure-cs-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;