diff --git a/cognitiveservices/data-plane/language/bingspellcheck/pom.xml b/cognitiveservices/data-plane/language/bingspellcheck/pom.xml index 11852af03000..a175bc04e384 100755 --- a/cognitiveservices/data-plane/language/bingspellcheck/pom.xml +++ b/cognitiveservices/data-plane/language/bingspellcheck/pom.xml @@ -8,15 +8,15 @@ com.microsoft.azure.cognitiveservices azure-cognitiveservices-parent - 1.0.1 + 1.0.2 ../../pom.xml - 1.0.1 + 1.0.2 azure-cognitiveservices-spellcheck jar Microsoft Azure SDK for Cognitive Service Spell Check This package contains Microsoft Cognitive Service Spell Check SDK. - https://github.com/Azure/azure-sdk-for-java/azure-cognitiveservices/language/bingspellcheck + https://github.com/Azure/azure-sdk-for-java/cognitiveservices/data-plane/language/bingspellcheck The MIT License (MIT) diff --git a/cognitiveservices/data-plane/language/luis/authoring/pom.xml b/cognitiveservices/data-plane/language/luis/authoring/pom.xml index 095807a44801..878d915c0ed1 100644 --- a/cognitiveservices/data-plane/language/luis/authoring/pom.xml +++ b/cognitiveservices/data-plane/language/luis/authoring/pom.xml @@ -8,15 +8,15 @@ com.microsoft.azure.cognitiveservices azure-cognitiveservices-parent - 1.0.1 + 1.0.2 ../../../pom.xml - azure-cognitiveservices-languageunderstanding-authoring - 1.0.1-beta + azure-cognitiveservices-luis-authoring + 1.0.2-beta jar Microsoft Azure SDK for Cognitive Service Language Understanding (LUIS) This package contains Microsoft Cognitive Service Language Understanding (LUIS). - https://github.com/Azure/azure-sdk-for-java/azure-cognitiveservices/language/luis/authoring + https://github.com/Azure/azure-sdk-for-java/cognitiveservices/data-plane/language/luis/authoring The MIT License (MIT) diff --git a/cognitiveservices/data-plane/language/luis/runtime/pom.xml b/cognitiveservices/data-plane/language/luis/runtime/pom.xml index 0a9c466893d3..e8beb8142586 100755 --- a/cognitiveservices/data-plane/language/luis/runtime/pom.xml +++ b/cognitiveservices/data-plane/language/luis/runtime/pom.xml @@ -8,15 +8,15 @@ com.microsoft.azure.cognitiveservices azure-cognitiveservices-parent - 1.0.1 + 1.0.2 ../../../pom.xml azure-cognitiveservices-luis-runtime - 1.0.1-beta + 1.0.2-beta jar Microsoft Azure SDK for Cognitive Service Language Understanding (LUIS) Runtime This package contains Microsoft Cognitive Service Language Understanding (LUIS) Runtime. - https://github.com/Azure/azure-sdk-for-java/azure-cognitiveservices/language/luis/runtime + https://github.com/Azure/azure-sdk-for-java/cognitiveservices/data-plane/language/luis/runtime The MIT License (MIT) diff --git a/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/LuisRuntimeAPI.java b/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/LuisRuntimeAPI.java index e2b302758c11..4cdc67e772bd 100644 --- a/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/LuisRuntimeAPI.java +++ b/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/LuisRuntimeAPI.java @@ -9,7 +9,6 @@ package com.microsoft.azure.cognitiveservices.language.luis.runtime; import com.microsoft.azure.AzureClient; -import com.microsoft.azure.cognitiveservices.language.luis.runtime.models.AzureRegions; import com.microsoft.rest.RestClient; /** @@ -36,21 +35,6 @@ public interface LuisRuntimeAPI { */ String userAgent(); - /** - * Gets Supported Azure regions for Cognitive Services endpoints. Possible values include: 'westus', 'westeurope', 'southeastasia', 'eastus2', 'westcentralus', 'westus2', 'eastus', 'southcentralus', 'northeurope', 'eastasia', 'australiaeast', 'brazilsouth'. - * - * @return the azureRegion value. - */ - AzureRegions azureRegion(); - - /** - * Sets Supported Azure regions for Cognitive Services endpoints. Possible values include: 'westus', 'westeurope', 'southeastasia', 'eastus2', 'westcentralus', 'westus2', 'eastus', 'southcentralus', 'northeurope', 'eastasia', 'australiaeast', 'brazilsouth'. - * - * @param azureRegion the azureRegion value. - * @return the service client itself - */ - LuisRuntimeAPI withAzureRegion(AzureRegions azureRegion); - /** * Gets Gets or sets the preferred language for the response.. * diff --git a/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/LuisRuntimeManager.java b/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/LuisRuntimeManager.java index 8cdeadb8df60..a70dc9de8371 100644 --- a/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/LuisRuntimeManager.java +++ b/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/LuisRuntimeManager.java @@ -7,7 +7,6 @@ package com.microsoft.azure.cognitiveservices.language.luis.runtime; import com.microsoft.azure.cognitiveservices.language.luis.runtime.implementation.LuisRuntimeAPIImpl; -import com.microsoft.azure.cognitiveservices.language.luis.runtime.models.AzureRegions; import com.microsoft.rest.RestClient; import com.microsoft.rest.credentials.ServiceClientCredentials; import okhttp3.Interceptor; @@ -24,13 +23,11 @@ public class LuisRuntimeManager { /** * Initializes an instance of Language Understanding (LUIS) Runtime API client. * - * @param region Supported Azure regions for Cognitive Services endpoints. * @param subscriptionKey the Language Understanding (LUIS) Runtime API key * @return the Language Understanding Runtime API client */ - public static LuisRuntimeAPI authenticate(AzureRegions region, String subscriptionKey) { - return authenticate("https://{AzureRegion}.api.cognitive.microsoft.com/luis/v2.0/apps/", subscriptionKey) - .withAzureRegion(region); + public static LuisRuntimeAPI authenticate(String subscriptionKey) { + return authenticate("https://api.cognitive.microsoft.com/luis/v2.0/", subscriptionKey); } /** @@ -65,13 +62,11 @@ public Response intercept(Chain chain) throws IOException { /** * Initializes an instance of Language Understanding (LUIS) Runtime API client. * - * @param region Supported Azure regions for Cognitive Services endpoints. * @param credentials the management credentials for Azure * @return the Language Understanding (LUIS) Runtime API client */ - public static LuisRuntimeAPI authenticate(AzureRegions region, ServiceClientCredentials credentials) { - return authenticate("https://{AzureRegion}.api.cognitive.microsoft.com/luis/v2.0/apps/", credentials) - .withAzureRegion(region); + public static LuisRuntimeAPI authenticate(ServiceClientCredentials credentials) { + return authenticate("https://api.cognitive.microsoft.com/luis/v2.0/", credentials); } /** diff --git a/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/Predictions.java b/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/Predictions.java index aeb26a576e3a..76c3d6d1462d 100755 --- a/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/Predictions.java +++ b/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/Predictions.java @@ -30,7 +30,7 @@ public interface Predictions { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the LuisResult object if successful. */ - + @Deprecated LuisResult resolve(String appId, String query, ResolveOptionalParameter resolveOptionalParameter); /** @@ -43,7 +43,7 @@ public interface Predictions { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the LuisResult object */ - + @Deprecated Observable resolveAsync(String appId, String query, ResolveOptionalParameter resolveOptionalParameter); /** diff --git a/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/implementation/LuisRuntimeAPIImpl.java b/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/implementation/LuisRuntimeAPIImpl.java index fad2218eb896..391f1cc5d8a5 100644 --- a/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/implementation/LuisRuntimeAPIImpl.java +++ b/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/implementation/LuisRuntimeAPIImpl.java @@ -11,7 +11,6 @@ import com.microsoft.azure.AzureClient; import com.microsoft.azure.AzureServiceClient; import com.microsoft.azure.cognitiveservices.language.luis.runtime.LuisRuntimeAPI; -import com.microsoft.azure.cognitiveservices.language.luis.runtime.models.AzureRegions; import com.microsoft.azure.cognitiveservices.language.luis.runtime.Predictions; import com.microsoft.rest.credentials.ServiceClientCredentials; import com.microsoft.rest.RestClient; @@ -31,29 +30,6 @@ public AzureClient getAzureClient() { return this.azureClient; } - /** Supported Azure regions for Cognitive Services endpoints. Possible values include: 'westus', 'westeurope', 'southeastasia', 'eastus2', 'westcentralus', 'westus2', 'eastus', 'southcentralus', 'northeurope', 'eastasia', 'australiaeast', 'brazilsouth'. */ - private AzureRegions azureRegion; - - /** - * Gets Supported Azure regions for Cognitive Services endpoints. Possible values include: 'westus', 'westeurope', 'southeastasia', 'eastus2', 'westcentralus', 'westus2', 'eastus', 'southcentralus', 'northeurope', 'eastasia', 'australiaeast', 'brazilsouth'. - * - * @return the azureRegion value. - */ - public AzureRegions azureRegion() { - return this.azureRegion; - } - - /** - * Sets Supported Azure regions for Cognitive Services endpoints. Possible values include: 'westus', 'westeurope', 'southeastasia', 'eastus2', 'westcentralus', 'westus2', 'eastus', 'southcentralus', 'northeurope', 'eastasia', 'australiaeast', 'brazilsouth'. - * - * @param azureRegion the azureRegion value. - * @return the service client itself - */ - public LuisRuntimeAPIImpl withAzureRegion(AzureRegions azureRegion) { - this.azureRegion = azureRegion; - return this; - } - /** Gets or sets the preferred language for the response. */ private String acceptLanguage; @@ -142,7 +118,7 @@ public Predictions predictions() { * @param credentials the management credentials for Azure */ public LuisRuntimeAPIImpl(ServiceClientCredentials credentials) { - this("https://{AzureRegion}.api.cognitive.microsoft.com/luis/v2.0/apps", credentials); + this("https://api.cognitive.microsoft.com/luis/v2.0", credentials); } /** @@ -181,6 +157,6 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "LuisRuntimeAPI", "v2.0 preview"); + return String.format("%s (%s, %s)", super.userAgent(), "LuisRuntimeAPI", "2.0"); } } diff --git a/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/implementation/PredictionsImpl.java b/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/implementation/PredictionsImpl.java index 31813ef4b6c4..bda630f0ca0d 100755 --- a/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/implementation/PredictionsImpl.java +++ b/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/implementation/PredictionsImpl.java @@ -11,7 +11,6 @@ import com.microsoft.azure.cognitiveservices.language.luis.runtime.models.ResolveOptionalParameter; import retrofit2.Retrofit; import com.microsoft.azure.cognitiveservices.language.luis.runtime.Predictions; -import com.google.common.base.Joiner; import com.google.common.reflect.TypeToken; import com.microsoft.azure.cognitiveservices.language.luis.runtime.models.APIErrorException; import com.microsoft.azure.cognitiveservices.language.luis.runtime.models.LuisResult; @@ -57,8 +56,8 @@ public PredictionsImpl(Retrofit retrofit, LuisRuntimeAPIImpl client) { */ interface PredictionsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.runtime.Predictions resolve" }) - @POST("{appId}") - Observable> resolve(@Path("appId") String appId, @Body String query, @Query("timezoneOffset") Double timezoneOffset, @Query("verbose") Boolean verbose, @Query("staging") Boolean staging, @Query("spellCheck") Boolean spellCheck, @Query("bing-spell-check-subscription-key") String bingSpellCheckSubscriptionKey, @Query("log") Boolean log, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + @POST("apps/{appId}") + Observable> resolve(@Path("appId") String appId, @Body String query, @Query("timezoneOffset") Double timezoneOffset, @Query("verbose") Boolean verbose, @Query("staging") Boolean staging, @Query("spellCheck") Boolean spellCheck, @Query("bing-spell-check-subscription-key") String bingSpellCheckSubscriptionKey, @Query("log") Boolean log, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); } @@ -120,9 +119,6 @@ public LuisResult call(ServiceResponse response) { * @return the observable to the LuisResult object */ public Observable> resolveWithServiceResponseAsync(String appId, String query, ResolveOptionalParameter resolveOptionalParameter) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); - } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } @@ -154,17 +150,13 @@ public Observable> resolveWithServiceResponseAsync(S * @return the observable to the LuisResult object */ public Observable> resolveWithServiceResponseAsync(String appId, String query, Double timezoneOffset, Boolean verbose, Boolean staging, Boolean spellCheck, String bingSpellCheckSubscriptionKey, Boolean log) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); - } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (query == null) { throw new IllegalArgumentException("Parameter query is required and cannot be null."); } - String parameterizedHost = Joiner.on(", ").join("{AzureRegion}", this.client.azureRegion()); - return service.resolve(appId, query, timezoneOffset, verbose, staging, spellCheck, bingSpellCheckSubscriptionKey, log, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + return service.resolve(appId, query, timezoneOffset, verbose, staging, spellCheck, bingSpellCheckSubscriptionKey, log, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { diff --git a/cognitiveservices/data-plane/language/textanalytics/pom.xml b/cognitiveservices/data-plane/language/textanalytics/pom.xml index be225a8a9289..3f19296b1569 100755 --- a/cognitiveservices/data-plane/language/textanalytics/pom.xml +++ b/cognitiveservices/data-plane/language/textanalytics/pom.xml @@ -10,11 +10,11 @@ com.microsoft.azure.cognitiveservices azure-cognitiveservices-parent - 1.0.1 + 1.0.2 ../../pom.xml azure-cognitiveservices-textanalytics - 1.0.1-beta + 1.0.2-beta jar Microsoft Azure SDK for Cognitive Service Text Analytics This package contains Microsoft Cognitive Service Text Analytics SDK. diff --git a/cognitiveservices/data-plane/pom.xml b/cognitiveservices/data-plane/pom.xml index 5d98292a6c7c..9736fb1b6ade 100755 --- a/cognitiveservices/data-plane/pom.xml +++ b/cognitiveservices/data-plane/pom.xml @@ -7,7 +7,7 @@ 4.0.0 com.microsoft.azure.cognitiveservices azure-cognitiveservices-parent - 1.0.1 + 1.0.2 pom Microsoft Azure Cognitive Services SDK Parent @@ -300,6 +300,7 @@ ./language/luis/authoring ./language/luis/runtime ./language/textanalytics + ./search/bingautosuggest ./search/bingcustomimagesearch ./search/bingcustomsearch ./search/bingentitysearch @@ -310,6 +311,8 @@ ./search/bingwebsearch ./vision/computervision ./vision/contentmoderator + ./vision/customvision/prediction + ./vision/customvision/training ./vision/faceapi \ No newline at end of file diff --git a/cognitiveservices/data-plane/search/bingautosuggest/pom.xml b/cognitiveservices/data-plane/search/bingautosuggest/pom.xml new file mode 100644 index 000000000000..115e1708562a --- /dev/null +++ b/cognitiveservices/data-plane/search/bingautosuggest/pom.xml @@ -0,0 +1,89 @@ + + + 4.0.0 + + com.microsoft.azure.cognitiveservices + azure-cognitiveservices-parent + 1.0.2 + ../../pom.xml + + azure-cognitiveservices-autosuggest + 1.0.2-beta + jar + Microsoft Azure SDK for Cognitive Services Auto Suggest + This package contains Microsoft Cognitive Service Auto Suggest SDK. + https://github.com/Azure/azure-sdk-for-java/cognitiveservices/data-plane/search/bingautosuggest + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + UTF-8 + + + + + microsoft + Microsoft + + + + + ossrh + Sonatype Snapshots + https://oss.sonatype.org/content/repositories/snapshots/ + true + default + + + + + com.microsoft.azure + azure-client-runtime + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
\ No newline at end of file diff --git a/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/BingAutoSuggestSearch.java b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/BingAutoSuggestSearch.java new file mode 100644 index 000000000000..5c6485bb8f70 --- /dev/null +++ b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/BingAutoSuggestSearch.java @@ -0,0 +1,286 @@ +/** + * 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.search.autosuggest; + +import com.microsoft.azure.cognitiveservices.search.autosuggest.models.AutoSuggestOptionalParameter; +import com.microsoft.azure.cognitiveservices.search.autosuggest.models.ErrorResponseException; +import com.microsoft.azure.cognitiveservices.search.autosuggest.models.ResponseFormat; +import com.microsoft.azure.cognitiveservices.search.autosuggest.models.SafeSearch; +import com.microsoft.azure.cognitiveservices.search.autosuggest.models.Suggestions; +import java.util.List; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in BingAutoSuggestSearch. + */ +public interface BingAutoSuggestSearch { + /** + * The AutoSuggest API lets you send a search query to Bing and get back a list of suggestions. This section + * provides technical details about the query parameters and headers that you use to request suggestions and + * the JSON response objects that contain them. + * + * @param query The user's search term. + * @param autoSuggestOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Suggestions object if successful. + */ + @Deprecated + Suggestions autoSuggest(String query, AutoSuggestOptionalParameter autoSuggestOptionalParameter); + + /** + * The AutoSuggest API lets you send a search query to Bing and get back a list of suggestions. This section + * provides technical details about the query parameters and headers that you use to request suggestions and + * the JSON response objects that contain them. + * + * @param query The user's search term. + * @param autoSuggestOptionalParameter 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 Suggestions object + */ + @Deprecated + Observable autoSuggestAsync(String query, AutoSuggestOptionalParameter autoSuggestOptionalParameter); + + /** + * The AutoSuggest API lets you send a search query to Bing and get back a list of suggestions. This section + * provides technical details about the query parameters and headers that you use to request suggestions and + * the JSON response objects that contain them. + * + * @return the first stage of the autoSuggest call + */ + BingAutoSuggestSearchAutoSuggestDefinitionStages.WithQuery autoSuggest(); + + /** + * Grouping of autoSuggest definition stages. + */ + interface BingAutoSuggestSearchAutoSuggestDefinitionStages { + /** + * The stage of the definition to be specify query. + */ + interface WithQuery { + /** + * The user's search term. + * + * @return next definition stage + */ + BingAutoSuggestSearchAutoSuggestDefinitionStages.WithExecute withQuery(String query); + } + + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + interface WithAllOptions { + /** + * A comma-delimited list of one or more languages to use for user interface strings. The list is in decreasing + * order of preference. For additional information, including expected format, see + * [RFC2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). This header and the setLang query + * parameter are mutually exclusive; do not specify both. If you set this header, you must also specify the + * [cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-autosuggest-api-v7-reference#cc) query + * parameter. To determine the market to return results for, Bing uses the first supported language it finds + * from the list and combines it with the cc parameter value. If the list does not include a supported + * language, Bing finds the closest language and market that supports the request or it uses an aggregated or + * default market for the results. To determine the market that Bing used, see the BingAPIs-Market header. Use + * this header and the cc query parameter only if you specify multiple languages. Otherwise, use the + * [mkt](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-autosuggest-api-v7-reference#mkt) and + [set* Lang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-autosuggest-api-v7-reference#setlang) + * query parameters. A user interface string is a string that's used as a label in a user interface. There are + * few user interface strings in the JSON response objects. Any links to Bing.com properties in the response + * objects apply the specified language. + * + * @return next definition stage + */ + BingAutoSuggestSearchAutoSuggestDefinitionStages.WithExecute withAcceptLanguage(String acceptLanguage); + + /** + * By default, Bing returns cached content, if available. To prevent Bing from returning cached content, set + * the Pragma header to no-cache (for example, Pragma: no-cache). + * + * @return next definition stage + */ + BingAutoSuggestSearchAutoSuggestDefinitionStages.WithExecute withPragma(String pragma); + + /** + * The user agent originating the request. Bing uses the user agent to provide mobile users with an optimized + * experience. Although optional, you are encouraged to always specify this header. The user-agent should be + * the same string that any commonly used browser sends. For information about user agents, see [RFC + * 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). The following are examples of user-agent + * strings. Windows Phone: Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; + * ARM; Touch; NOKIA; Lumia 822). Android: Mozilla / 5.0 (Linux; U; Android 2.3.5; en - us; SCH - I500 Build / + * GINGERBREAD) AppleWebKit / 533.1 (KHTML; like Gecko) Version / 4.0 Mobile Safari / 533.1. iPhone: Mozilla / + * 5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit / 536.26 (KHTML; like Gecko) Mobile / 10B142 + * iPhone4; 1 BingWeb / 3.03.1428.20120423. PC: Mozilla / 5.0 (Windows NT 6.3; WOW64; Trident / 7.0; Touch; + * rv:11.0) like Gecko. iPad: Mozilla / 5.0 (iPad; CPU OS 7_0 like Mac OS X) AppleWebKit / 537.51.1 (KHTML, + * like Gecko) Version / 7.0 Mobile / 11A465 Safari / 9537.53. + * + * @return next definition stage + */ + BingAutoSuggestSearchAutoSuggestDefinitionStages.WithExecute withUserAgent(String userAgent); + + /** + * Bing uses this header to provide users with consistent behavior across Bing API calls. Bing often flights + * new features and improvements, and it uses the client ID as a key for assigning traffic on different + * flights. If you do not use the same client ID for a user across multiple requests, then Bing may assign the + * user to multiple conflicting flights. Being assigned to multiple conflicting flights can lead to an + * inconsistent user experience. For example, if the second request has a different flight assignment than the + * first, the experience may be unexpected. Also, Bing can use the client ID to tailor web results to that + * client ID’s search history, providing a richer experience for the user. Bing also uses this header to help + * improve result rankings by analyzing the activity generated by a client ID. The relevance improvements help + * with better quality of results delivered by Bing APIs and in turn enables higher click-through rates for the + * API consumer. IMPORTANT: Although optional, you should consider this header required. Persisting the client + * ID across multiple requests for the same end user and device combination enables 1) the API consumer to + * receive a consistent user experience, and 2) higher click-through rates via better quality of results from + * the Bing APIs. Each user that uses your application on the device must have a unique, Bing generated client + * ID. If you do not include this header in the request, Bing generates an ID and returns it in the + * X-MSEdge-ClientID response header. The only time that you should NOT include this header in a request is the + * first time the user uses your app on that device. Use the client ID for each Bing API request that your app + * makes for this user on the device. Persist the client ID. To persist the ID in a browser app, use a + * persistent HTTP cookie to ensure the ID is used across all sessions. Do not use a session cookie. For other + * apps such as mobile apps, use the device's persistent storage to persist the ID. The next time the user uses + * your app on that device, get the client ID that you persisted. Bing responses may or may not include this + * header. If the response includes this header, capture the client ID and use it for all subsequent Bing + * requests for the user on that device. If you include the X-MSEdge-ClientID, you must not include cookies in + * the request. + * + * @return next definition stage + */ + BingAutoSuggestSearchAutoSuggestDefinitionStages.WithExecute withClientId(String clientId); + + /** + * The IPv4 or IPv6 address of the client device. The IP address is used to discover the user's location. Bing + * uses the location information to determine safe search behavior. Although optional, you are encouraged to + * always specify this header and the X-Search-Location header. Do not obfuscate the address (for example, by + * changing the last octet to 0). Obfuscating the address results in the location not being anywhere near the + * device's actual location, which may result in Bing serving erroneous results. + * + * @return next definition stage + */ + BingAutoSuggestSearchAutoSuggestDefinitionStages.WithExecute withClientIp(String clientIp); + + /** + * A semicolon-delimited list of key/value pairs that describe the client's geographical location. Bing uses + * the location information to determine safe search behavior and to return relevant local content. Specify the + * key/value pair as <key>:<value>. The following + * are the keys that you use to specify the user's location. lat (required): The latitude of the client's + * location, in degrees. The latitude must be greater than or equal to -90.0 and less than or equal to +90.0. + * Negative values indicate southern latitudes and positive values indicate northern latitudes. long + * (required): The longitude of the client's location, in degrees. The longitude must be greater than or equal + * to -180.0 and less than or equal to +180.0. Negative values indicate western longitudes and positive values + * indicate eastern longitudes. re (required): The radius, in meters, which specifies the horizontal accuracy + * of the coordinates. Pass the value returned by the device's location service. Typical values might be 22m + * for GPS/Wi-Fi, 380m for cell tower triangulation, and 18,000m for reverse IP lookup. ts (optional): The UTC + * UNIX timestamp of when the client was at the location. (The UNIX timestamp is the number of seconds since + * January 1, 1970.) head (optional): The client's relative heading or direction of travel. Specify the + * direction of travel as degrees from 0 through 360, counting clockwise relative to true north. Specify this + * key only if the sp key is nonzero. sp (optional): The horizontal velocity (speed), in meters per second, + * that the client device is traveling. alt (optional): The altitude of the client device, in meters. are + * (optional): The radius, in meters, that specifies the vertical accuracy of the coordinates. Specify this key + * only if you specify the alt key. Although many of the keys are optional, the more information that you + * provide, the more accurate the location results are. Although optional, you are encouraged to always specify + * the user's geographical location. Providing the location is especially important if the client's IP address + * does not accurately reflect the user's physical location (for example, if the client uses VPN). For optimal + * results, you should include this header and the X-MSEdge-ClientIP header, but at a minimum, you should + * include this header. + * + * @return next definition stage + */ + BingAutoSuggestSearchAutoSuggestDefinitionStages.WithExecute withLocation(String location); + + /** + * A 2-character country code of the country where the results come from. This API supports only the United + * States market. If you specify this query parameter, it must be set to us. If you set this parameter, you + * must also specify the Accept-Language header. Bing uses the first supported language it finds from the + * languages list, and combine that language with the country code that you specify to determine the market to + * return results for. If the languages list does not include a supported language, Bing finds the closest + * language and market that supports the request, or it may use an aggregated or default market for the results + * instead of a specified one. You should use this query parameter and the Accept-Language query parameter only + * if you specify multiple languages; otherwise, you should use the mkt and setLang query parameters. This + * parameter and the mkt query parameter are mutually exclusive—do not specify both. + * + * @return next definition stage + */ + BingAutoSuggestSearchAutoSuggestDefinitionStages.WithExecute withCountryCode(String countryCode); + + /** + * The market where the results come from. You are strongly encouraged to always specify the market, if known. + * Specifying the market helps Bing route the request and return an appropriate and optimal response. This + * parameter and the cc query parameter are mutually exclusive—do not specify both. + * + * @return next definition stage + */ + BingAutoSuggestSearchAutoSuggestDefinitionStages.WithExecute withMarket(String market); + + /** + * Filter suggestions for adult content. The following are the possible filter values. Off: Return suggestions + * with adult text, images, or videos. Moderate: Return suggestion with adult text but not adult images or + * videos. Strict: Do not return news articles with adult text, images, or videos. If the request comes from a + * market that Bing's adult policy requires that safeSearch is set to Strict, Bing ignores the safeSearch value + * and uses Strict. If you use the site: query operator, there is the chance that the response may contain + * adult content regardless of what the safeSearch query parameter is set to. Use site: only if you are aware + * of the content on the site and your scenario supports the possibility of adult content. Possible values + * include: 'Off', 'Moderate', 'Strict'. + * + * @return next definition stage + */ + BingAutoSuggestSearchAutoSuggestDefinitionStages.WithExecute withSafeSearch(SafeSearch safeSearch); + + /** + * The language to use for user interface strings. Specify the language using the ISO 639-1 2-letter language + * code. For example, the language code for English is EN. The default is EN (English). Although optional, you + * should always specify the language. Typically, you set setLang to the same language specified by mkt unless + * the user wants the user interface strings displayed in a different language. This parameter and the + * Accept-Language header are mutually exclusive; do not specify both. A user interface string is a string + * that's used as a label in a user interface. There are few user interface strings in the JSON response + * objects. Also, any links to Bing.com properties in the response objects apply the specified language. + * + * @return next definition stage + */ + BingAutoSuggestSearchAutoSuggestDefinitionStages.WithExecute withSetLang(String setLang); + + /** + * The media type to use for the response. The following are the possible case-insensitive values: JSON, + * JSONLD. The default is JSON. If you specify JSONLD, the response body includes JSON-LD objects that contain + * the search results. + * + * @return next definition stage + */ + BingAutoSuggestSearchAutoSuggestDefinitionStages.WithExecute withResponseFormat(List responseFormat); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends BingAutoSuggestSearchAutoSuggestDefinitionStages.WithAllOptions { + /** + * Execute the request. + * + * @return the Suggestions object if successful. + */ + Suggestions execute(); + + /** + * Execute the request asynchronously. + * + * @return the observable to the Suggestions object + */ + Observable executeAsync(); + } + } + + /** + * The entirety of autoSuggest definition. + */ + interface BingAutoSuggestSearchAutoSuggestDefinition extends + BingAutoSuggestSearchAutoSuggestDefinitionStages.WithQuery, + BingAutoSuggestSearchAutoSuggestDefinitionStages.WithExecute { + } + +} diff --git a/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/BingAutoSuggestSearchAPI.java b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/BingAutoSuggestSearchAPI.java new file mode 100644 index 000000000000..2b9d34807b2b --- /dev/null +++ b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/BingAutoSuggestSearchAPI.java @@ -0,0 +1,89 @@ +/** + * 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.search.autosuggest; + +import com.microsoft.azure.AzureClient; +import com.microsoft.rest.RestClient; + +/** + * The interface for BingAutoSuggestSearchAPI class. + */ +public interface BingAutoSuggestSearchAPI { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + AzureClient getAzureClient(); + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + String userAgent(); + + /** + * Gets Gets or sets the preferred language for the response.. + * + * @return the acceptLanguage value. + */ + String acceptLanguage(); + + /** + * Sets Gets or sets the preferred language for the response.. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + BingAutoSuggestSearchAPI withAcceptLanguage(String acceptLanguage); + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @return the longRunningOperationRetryTimeout value. + */ + int longRunningOperationRetryTimeout(); + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + BingAutoSuggestSearchAPI 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.. + * + * @return the generateClientRequestId value. + */ + boolean generateClientRequestId(); + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + BingAutoSuggestSearchAPI withGenerateClientRequestId(boolean generateClientRequestId); + + /** + * Gets the BingAutoSuggestSearch object to access its operations. + * @return the BingAutoSuggestSearch object. + */ + BingAutoSuggestSearch bingAutoSuggestSearch(); + +} diff --git a/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/BingAutoSuggestSearchManager.java b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/BingAutoSuggestSearchManager.java new file mode 100644 index 000000000000..aebe947e10ca --- /dev/null +++ b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/BingAutoSuggestSearchManager.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.cognitiveservices.search.autosuggest; + +import com.microsoft.azure.cognitiveservices.search.autosuggest.implementation.BingAutoSuggestSearchAPIImpl; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import okhttp3.Interceptor; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; + +import java.io.IOException; + +/** + * Entry point to Azure Cognitive Services Bing Auto Suggest Search manager. + */ +public class BingAutoSuggestSearchManager { + /** + * Initializes an instance of Bing Auto Suggest Search API client. + * + * @param subscriptionKey the Bing Search API key + * @return the Bing Custom Search API client + */ + public static BingAutoSuggestSearchAPI authenticate(String subscriptionKey) { + return authenticate("https://api.cognitive.microsoft.com/bing/v7.0/", subscriptionKey); + } + + /** + * Initializes an instance of Bing Auto Suggest Search API client. + * + * @param baseUrl the base URL of the service + * @param subscriptionKey the Bing Search API key + * @return the Bing Custom Search API client + */ + public static BingAutoSuggestSearchAPI authenticate(String baseUrl, final String subscriptionKey) { + ServiceClientCredentials serviceClientCredentials = new ServiceClientCredentials() { + @Override + public void applyCredentialsFilter(OkHttpClient.Builder builder) { + builder.addNetworkInterceptor( + new Interceptor() { + @Override + public Response intercept(Chain chain) throws IOException { + Request request = null; + Request original = chain.request(); + // Request customization: add request headers + Request.Builder requestBuilder = original.newBuilder() + .addHeader("Ocp-Apim-Subscription-Key", subscriptionKey); + request = requestBuilder.build(); + return chain.proceed(request); + } + }); + } + }; + return authenticate(baseUrl, serviceClientCredentials); + } + + /** + * Initializes an instance of Bing Auto Suggest Search API client. + * + * @param credentials the management credentials for Azure + * @return the Bing Auto Suggest Search API client + */ + public static BingAutoSuggestSearchAPI authenticate(ServiceClientCredentials credentials) { + return authenticate("https://api.cognitive.microsoft.com/bing/v7.0/", credentials); + } + + /** + * Initializes an instance of Bing Auto Suggest Search API client. + * + * @param baseUrl the base URL of the service + * @param credentials the management credentials for Azure + * @return the Bing Custom Image Search API client + */ + public static BingAutoSuggestSearchAPI authenticate(String baseUrl, ServiceClientCredentials credentials) { + return new BingAutoSuggestSearchAPIImpl(baseUrl, credentials); + } + + /** + * Initializes an instance of Bing Auto Suggest Search API client. + * + * @param restClient the REST client to connect to Azure. + * @return the Bing Custom Image Search API client + */ + public static BingAutoSuggestSearchAPI authenticate(RestClient restClient) { + return new BingAutoSuggestSearchAPIImpl(restClient); + } +} diff --git a/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/implementation/BingAutoSuggestSearchAPIImpl.java b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/implementation/BingAutoSuggestSearchAPIImpl.java new file mode 100644 index 000000000000..001edc324aa5 --- /dev/null +++ b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/implementation/BingAutoSuggestSearchAPIImpl.java @@ -0,0 +1,162 @@ +/** + * 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.search.autosuggest.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.cognitiveservices.search.autosuggest.BingAutoSuggestSearch; +import com.microsoft.azure.cognitiveservices.search.autosuggest.BingAutoSuggestSearchAPI; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the BingAutoSuggestSearchAPIImpl class. + */ +public class BingAutoSuggestSearchAPIImpl extends AzureServiceClient implements BingAutoSuggestSearchAPI { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public BingAutoSuggestSearchAPIImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public BingAutoSuggestSearchAPIImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public BingAutoSuggestSearchAPIImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The BingAutoSuggestSearch object to access its operations. + */ + private BingAutoSuggestSearch bingAutoSuggestSearch; + + /** + * Gets the BingAutoSuggestSearch object to access its operations. + * @return the BingAutoSuggestSearch object. + */ + public BingAutoSuggestSearch bingAutoSuggestSearch() { + return this.bingAutoSuggestSearch; + } + + /** + * Initializes an instance of BingAutoSuggestSearchAPI client. + * + * @param credentials the management credentials for Azure + */ + public BingAutoSuggestSearchAPIImpl(ServiceClientCredentials credentials) { + this("https://api.cognitive.microsoft.com/bing/v7.0", credentials); + } + + /** + * Initializes an instance of BingAutoSuggestSearchAPI client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public BingAutoSuggestSearchAPIImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of BingAutoSuggestSearchAPI client. + * + * @param restClient the REST client to connect to Azure. + */ + public BingAutoSuggestSearchAPIImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.bingAutoSuggestSearch = new BingAutoSuggestSearchImpl(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "BingAutoSuggestSearchAPI", "1.0"); + } +} diff --git a/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/implementation/BingAutoSuggestSearchImpl.java b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/implementation/BingAutoSuggestSearchImpl.java new file mode 100644 index 000000000000..01a322eaef73 --- /dev/null +++ b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/implementation/BingAutoSuggestSearchImpl.java @@ -0,0 +1,304 @@ +/** + * 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.search.autosuggest.implementation; + +import com.microsoft.azure.cognitiveservices.search.autosuggest.models.AutoSuggestOptionalParameter; +import retrofit2.Retrofit; +import com.microsoft.azure.cognitiveservices.search.autosuggest.BingAutoSuggestSearch; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.cognitiveservices.search.autosuggest.models.ErrorResponseException; +import com.microsoft.azure.cognitiveservices.search.autosuggest.models.ResponseFormat; +import com.microsoft.azure.cognitiveservices.search.autosuggest.models.SafeSearch; +import com.microsoft.azure.cognitiveservices.search.autosuggest.models.Suggestions; +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 okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in BingAutoSuggestSearch. + */ +public class BingAutoSuggestSearchImpl implements BingAutoSuggestSearch { + /** The Retrofit service to perform REST calls. */ + private BingAutoSuggestSearchService service; + /** The service client containing this operation class. */ + private BingAutoSuggestSearchAPIImpl client; + + /** + * Initializes an instance of BingAutoSuggestSearchImpl. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BingAutoSuggestSearchImpl(Retrofit retrofit, BingAutoSuggestSearchAPIImpl client) { + this.service = retrofit.create(BingAutoSuggestSearchService.class); + this.client = client; + } + + /** + * The interface defining all the services for BingAutoSuggestSearch to be + * used by Retrofit to perform actually REST calls. + */ + interface BingAutoSuggestSearchService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.search.autosuggest.BingAutoSuggestSearch autoSuggest" }) + @GET("Suggestions") + Observable> autoSuggest(@Header("X-BingApis-SDK") String xBingApisSDK, @Header("Accept-Language") String acceptLanguage, @Header("Pragma") String pragma, @Header("User-Agent") String userAgent, @Header("X-MSEdge-ClientID") String clientId, @Header("X-MSEdge-ClientIP") String clientIp, @Header("X-Search-Location") String location, @Query("cc") String countryCode, @Query("mkt") String market, @Query("q") String query, @Query("safeSearch") SafeSearch safeSearch, @Query("setLang") String setLang, @Query("ResponseFormat") String responseFormat); + + } + + + /** + * The AutoSuggest API lets you send a search query to Bing and get back a list of suggestions. This section provides technical details about the query parameters and headers that you use to request suggestions and the JSON response objects that contain them. + * + * @param query The user's search term. + * @param autoSuggestOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Suggestions object if successful. + */ + public Suggestions autoSuggest(String query, AutoSuggestOptionalParameter autoSuggestOptionalParameter) { + return autoSuggestWithServiceResponseAsync(query, autoSuggestOptionalParameter).toBlocking().single().body(); + } + + /** + * The AutoSuggest API lets you send a search query to Bing and get back a list of suggestions. This section provides technical details about the query parameters and headers that you use to request suggestions and the JSON response objects that contain them. + * + * @param query The user's search term. + * @param autoSuggestOptionalParameter 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 autoSuggestAsync(String query, AutoSuggestOptionalParameter autoSuggestOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(autoSuggestWithServiceResponseAsync(query, autoSuggestOptionalParameter), serviceCallback); + } + + /** + * The AutoSuggest API lets you send a search query to Bing and get back a list of suggestions. This section provides technical details about the query parameters and headers that you use to request suggestions and the JSON response objects that contain them. + * + * @param query The user's search term. + * @param autoSuggestOptionalParameter 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 Suggestions object + */ + public Observable autoSuggestAsync(String query, AutoSuggestOptionalParameter autoSuggestOptionalParameter) { + return autoSuggestWithServiceResponseAsync(query, autoSuggestOptionalParameter).map(new Func1, Suggestions>() { + @Override + public Suggestions call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The AutoSuggest API lets you send a search query to Bing and get back a list of suggestions. This section provides technical details about the query parameters and headers that you use to request suggestions and the JSON response objects that contain them. + * + * @param query The user's search term. + * @param autoSuggestOptionalParameter 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 Suggestions object + */ + public Observable> autoSuggestWithServiceResponseAsync(String query, AutoSuggestOptionalParameter autoSuggestOptionalParameter) { + if (query == null) { + throw new IllegalArgumentException("Parameter query is required and cannot be null."); + } + final String acceptLanguage = autoSuggestOptionalParameter != null ? autoSuggestOptionalParameter.acceptLanguage() : null; + final String pragma = autoSuggestOptionalParameter != null ? autoSuggestOptionalParameter.pragma() : null; + final String userAgent = autoSuggestOptionalParameter != null ? autoSuggestOptionalParameter.userAgent() : this.client.userAgent(); + final String clientId = autoSuggestOptionalParameter != null ? autoSuggestOptionalParameter.clientId() : null; + final String clientIp = autoSuggestOptionalParameter != null ? autoSuggestOptionalParameter.clientIp() : null; + final String location = autoSuggestOptionalParameter != null ? autoSuggestOptionalParameter.location() : null; + final String countryCode = autoSuggestOptionalParameter != null ? autoSuggestOptionalParameter.countryCode() : null; + final String market = autoSuggestOptionalParameter != null ? autoSuggestOptionalParameter.market() : null; + final SafeSearch safeSearch = autoSuggestOptionalParameter != null ? autoSuggestOptionalParameter.safeSearch() : null; + final String setLang = autoSuggestOptionalParameter != null ? autoSuggestOptionalParameter.setLang() : null; + final List responseFormat = autoSuggestOptionalParameter != null ? autoSuggestOptionalParameter.responseFormat() : null; + + return autoSuggestWithServiceResponseAsync(query, acceptLanguage, pragma, userAgent, clientId, clientIp, location, countryCode, market, safeSearch, setLang, responseFormat); + } + + /** + * The AutoSuggest API lets you send a search query to Bing and get back a list of suggestions. This section provides technical details about the query parameters and headers that you use to request suggestions and the JSON response objects that contain them. + * + * @param query The user's search term. + * @param acceptLanguage A comma-delimited list of one or more languages to use for user interface strings. The list is in decreasing order of preference. For additional information, including expected format, see [RFC2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). This header and the setLang query parameter are mutually exclusive; do not specify both. If you set this header, you must also specify the [cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-autosuggest-api-v7-reference#cc) query parameter. To determine the market to return results for, Bing uses the first supported language it finds from the list and combines it with the cc parameter value. If the list does not include a supported language, Bing finds the closest language and market that supports the request or it uses an aggregated or default market for the results. To determine the market that Bing used, see the BingAPIs-Market header. Use this header and the cc query parameter only if you specify multiple languages. Otherwise, use the [mkt](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-autosuggest-api-v7-reference#mkt) and [setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-autosuggest-api-v7-reference#setlang) query parameters. A user interface string is a string that's used as a label in a user interface. There are few user interface strings in the JSON response objects. Any links to Bing.com properties in the response objects apply the specified language. + * @param pragma By default, Bing returns cached content, if available. To prevent Bing from returning cached content, set the Pragma header to no-cache (for example, Pragma: no-cache). + * @param userAgent The user agent originating the request. Bing uses the user agent to provide mobile users with an optimized experience. Although optional, you are encouraged to always specify this header. The user-agent should be the same string that any commonly used browser sends. For information about user agents, see [RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). The following are examples of user-agent strings. Windows Phone: Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 822). Android: Mozilla / 5.0 (Linux; U; Android 2.3.5; en - us; SCH - I500 Build / GINGERBREAD) AppleWebKit / 533.1 (KHTML; like Gecko) Version / 4.0 Mobile Safari / 533.1. iPhone: Mozilla / 5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit / 536.26 (KHTML; like Gecko) Mobile / 10B142 iPhone4; 1 BingWeb / 3.03.1428.20120423. PC: Mozilla / 5.0 (Windows NT 6.3; WOW64; Trident / 7.0; Touch; rv:11.0) like Gecko. iPad: Mozilla / 5.0 (iPad; CPU OS 7_0 like Mac OS X) AppleWebKit / 537.51.1 (KHTML, like Gecko) Version / 7.0 Mobile / 11A465 Safari / 9537.53 + * @param clientId Bing uses this header to provide users with consistent behavior across Bing API calls. Bing often flights new features and improvements, and it uses the client ID as a key for assigning traffic on different flights. If you do not use the same client ID for a user across multiple requests, then Bing may assign the user to multiple conflicting flights. Being assigned to multiple conflicting flights can lead to an inconsistent user experience. For example, if the second request has a different flight assignment than the first, the experience may be unexpected. Also, Bing can use the client ID to tailor web results to that client ID’s search history, providing a richer experience for the user. Bing also uses this header to help improve result rankings by analyzing the activity generated by a client ID. The relevance improvements help with better quality of results delivered by Bing APIs and in turn enables higher click-through rates for the API consumer. IMPORTANT: Although optional, you should consider this header required. Persisting the client ID across multiple requests for the same end user and device combination enables 1) the API consumer to receive a consistent user experience, and 2) higher click-through rates via better quality of results from the Bing APIs. Each user that uses your application on the device must have a unique, Bing generated client ID. If you do not include this header in the request, Bing generates an ID and returns it in the X-MSEdge-ClientID response header. The only time that you should NOT include this header in a request is the first time the user uses your app on that device. Use the client ID for each Bing API request that your app makes for this user on the device. Persist the client ID. To persist the ID in a browser app, use a persistent HTTP cookie to ensure the ID is used across all sessions. Do not use a session cookie. For other apps such as mobile apps, use the device's persistent storage to persist the ID. The next time the user uses your app on that device, get the client ID that you persisted. Bing responses may or may not include this header. If the response includes this header, capture the client ID and use it for all subsequent Bing requests for the user on that device. If you include the X-MSEdge-ClientID, you must not include cookies in the request. + * @param clientIp The IPv4 or IPv6 address of the client device. The IP address is used to discover the user's location. Bing uses the location information to determine safe search behavior. Although optional, you are encouraged to always specify this header and the X-Search-Location header. Do not obfuscate the address (for example, by changing the last octet to 0). Obfuscating the address results in the location not being anywhere near the device's actual location, which may result in Bing serving erroneous results. + * @param location A semicolon-delimited list of key/value pairs that describe the client's geographical location. Bing uses the location information to determine safe search behavior and to return relevant local content. Specify the key/value pair as <key>:<value>. The following are the keys that you use to specify the user's location. lat (required): The latitude of the client's location, in degrees. The latitude must be greater than or equal to -90.0 and less than or equal to +90.0. Negative values indicate southern latitudes and positive values indicate northern latitudes. long (required): The longitude of the client's location, in degrees. The longitude must be greater than or equal to -180.0 and less than or equal to +180.0. Negative values indicate western longitudes and positive values indicate eastern longitudes. re (required): The radius, in meters, which specifies the horizontal accuracy of the coordinates. Pass the value returned by the device's location service. Typical values might be 22m for GPS/Wi-Fi, 380m for cell tower triangulation, and 18,000m for reverse IP lookup. ts (optional): The UTC UNIX timestamp of when the client was at the location. (The UNIX timestamp is the number of seconds since January 1, 1970.) head (optional): The client's relative heading or direction of travel. Specify the direction of travel as degrees from 0 through 360, counting clockwise relative to true north. Specify this key only if the sp key is nonzero. sp (optional): The horizontal velocity (speed), in meters per second, that the client device is traveling. alt (optional): The altitude of the client device, in meters. are (optional): The radius, in meters, that specifies the vertical accuracy of the coordinates. Specify this key only if you specify the alt key. Although many of the keys are optional, the more information that you provide, the more accurate the location results are. Although optional, you are encouraged to always specify the user's geographical location. Providing the location is especially important if the client's IP address does not accurately reflect the user's physical location (for example, if the client uses VPN). For optimal results, you should include this header and the X-MSEdge-ClientIP header, but at a minimum, you should include this header. + * @param countryCode A 2-character country code of the country where the results come from. This API supports only the United States market. If you specify this query parameter, it must be set to us. If you set this parameter, you must also specify the Accept-Language header. Bing uses the first supported language it finds from the languages list, and combine that language with the country code that you specify to determine the market to return results for. If the languages list does not include a supported language, Bing finds the closest language and market that supports the request, or it may use an aggregated or default market for the results instead of a specified one. You should use this query parameter and the Accept-Language query parameter only if you specify multiple languages; otherwise, you should use the mkt and setLang query parameters. This parameter and the mkt query parameter are mutually exclusive—do not specify both. + * @param market The market where the results come from. You are strongly encouraged to always specify the market, if known. Specifying the market helps Bing route the request and return an appropriate and optimal response. This parameter and the cc query parameter are mutually exclusive—do not specify both. + * @param safeSearch Filter suggestions for adult content. The following are the possible filter values. Off: Return suggestions with adult text, images, or videos. Moderate: Return suggestion with adult text but not adult images or videos. Strict: Do not return news articles with adult text, images, or videos. If the request comes from a market that Bing's adult policy requires that safeSearch is set to Strict, Bing ignores the safeSearch value and uses Strict. If you use the site: query operator, there is the chance that the response may contain adult content regardless of what the safeSearch query parameter is set to. Use site: only if you are aware of the content on the site and your scenario supports the possibility of adult content. Possible values include: 'Off', 'Moderate', 'Strict' + * @param setLang The language to use for user interface strings. Specify the language using the ISO 639-1 2-letter language code. For example, the language code for English is EN. The default is EN (English). Although optional, you should always specify the language. Typically, you set setLang to the same language specified by mkt unless the user wants the user interface strings displayed in a different language. This parameter and the Accept-Language header are mutually exclusive; do not specify both. A user interface string is a string that's used as a label in a user interface. There are few user interface strings in the JSON response objects. Also, any links to Bing.com properties in the response objects apply the specified language. + * @param responseFormat The media type to use for the response. The following are the possible case-insensitive values: JSON, JSONLD. The default is JSON. If you specify JSONLD, the response body includes JSON-LD objects that contain the search results. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Suggestions object + */ + public Observable> autoSuggestWithServiceResponseAsync(String query, String acceptLanguage, String pragma, String userAgent, String clientId, String clientIp, String location, String countryCode, String market, SafeSearch safeSearch, String setLang, List responseFormat) { + if (query == null) { + throw new IllegalArgumentException("Parameter query is required and cannot be null."); + } + Validator.validate(responseFormat); + final String xBingApisSDK = "true"; + String responseFormatConverted = this.client.serializerAdapter().serializeList(responseFormat, CollectionFormat.CSV); + return service.autoSuggest(xBingApisSDK, acceptLanguage, pragma, userAgent, clientId, clientIp, location, countryCode, market, query, safeSearch, setLang, responseFormatConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = autoSuggestDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse autoSuggestDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + @Override + public BingAutoSuggestSearchAutoSuggestParameters autoSuggest() { + return new BingAutoSuggestSearchAutoSuggestParameters(this); + } + + /** + * Internal class implementing BingAutoSuggestSearchAutoSuggestDefinition. + */ + class BingAutoSuggestSearchAutoSuggestParameters implements BingAutoSuggestSearchAutoSuggestDefinition { + private BingAutoSuggestSearchImpl parent; + private String query; + private String acceptLanguage; + private String pragma; + private String userAgent; + private String clientId; + private String clientIp; + private String location; + private String countryCode; + private String market; + private SafeSearch safeSearch; + private String setLang; + private List responseFormat; + + /** + * Constructor. + * @param parent the parent object. + */ + BingAutoSuggestSearchAutoSuggestParameters(BingAutoSuggestSearchImpl parent) { + this.parent = parent; + } + + @Override + public BingAutoSuggestSearchAutoSuggestParameters withQuery(String query) { + this.query = query; + return this; + } + + @Override + public BingAutoSuggestSearchAutoSuggestParameters withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + @Override + public BingAutoSuggestSearchAutoSuggestParameters withPragma(String pragma) { + this.pragma = pragma; + return this; + } + + @Override + public BingAutoSuggestSearchAutoSuggestParameters withUserAgent(String userAgent) { + this.userAgent = userAgent; + return this; + } + + @Override + public BingAutoSuggestSearchAutoSuggestParameters withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + @Override + public BingAutoSuggestSearchAutoSuggestParameters withClientIp(String clientIp) { + this.clientIp = clientIp; + return this; + } + + @Override + public BingAutoSuggestSearchAutoSuggestParameters withLocation(String location) { + this.location = location; + return this; + } + + @Override + public BingAutoSuggestSearchAutoSuggestParameters withCountryCode(String countryCode) { + this.countryCode = countryCode; + return this; + } + + @Override + public BingAutoSuggestSearchAutoSuggestParameters withMarket(String market) { + this.market = market; + return this; + } + + @Override + public BingAutoSuggestSearchAutoSuggestParameters withSafeSearch(SafeSearch safeSearch) { + this.safeSearch = safeSearch; + return this; + } + + @Override + public BingAutoSuggestSearchAutoSuggestParameters withSetLang(String setLang) { + this.setLang = setLang; + return this; + } + + @Override + public BingAutoSuggestSearchAutoSuggestParameters withResponseFormat(List responseFormat) { + this.responseFormat = responseFormat; + return this; + } + + @Override + public Suggestions execute() { + return autoSuggestWithServiceResponseAsync(query, acceptLanguage, pragma, userAgent, clientId, clientIp, location, countryCode, market, safeSearch, setLang, responseFormat).toBlocking().single().body(); + } + + @Override + public Observable executeAsync() { + return autoSuggestWithServiceResponseAsync(query, acceptLanguage, pragma, userAgent, clientId, clientIp, location, countryCode, market, safeSearch, setLang, responseFormat).map(new Func1, Suggestions>() { + @Override + public Suggestions call(ServiceResponse response) { + return response.body(); + } + }); + } + } + +} diff --git a/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/implementation/package-info.java b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/implementation/package-info.java new file mode 100644 index 000000000000..0611f6894deb --- /dev/null +++ b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/implementation/package-info.java @@ -0,0 +1,11 @@ +// 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. + +/** + * This package contains the implementation classes for BingAutoSuggestSearchAPI. + * The AutoSuggest Search API lets you send a search query to Bing and get back a list of news that are relevant to the search query. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the web for AutoSuggest](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-autosuggest-api-v7-reference). + */ +package com.microsoft.azure.cognitiveservices.search.autosuggest.implementation; diff --git a/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/Action.java b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/Action.java new file mode 100644 index 000000000000..1ecb70dce45b --- /dev/null +++ b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/Action.java @@ -0,0 +1,86 @@ +/** + * 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.search.autosuggest.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The Action model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = Action.class) +@JsonTypeName("Action") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "SearchAction", value = SearchAction.class) +}) +public class Action extends CreativeWork { + /** + * The result property. + */ + @JsonProperty(value = "result", access = JsonProperty.Access.WRITE_ONLY) + private List result; + + /** + * The displayName property. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /** + * The isTopAction property. + */ + @JsonProperty(value = "isTopAction", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isTopAction; + + /** + * The serviceUrl property. + */ + @JsonProperty(value = "serviceUrl", access = JsonProperty.Access.WRITE_ONLY) + private String serviceUrl; + + /** + * Get the result value. + * + * @return the result value + */ + public List result() { + return this.result; + } + + /** + * Get the displayName value. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the isTopAction value. + * + * @return the isTopAction value + */ + public Boolean isTopAction() { + return this.isTopAction; + } + + /** + * Get the serviceUrl value. + * + * @return the serviceUrl value + */ + public String serviceUrl() { + return this.serviceUrl; + } + +} diff --git a/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/Answer.java b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/Answer.java new file mode 100644 index 000000000000..ae1eb42c3950 --- /dev/null +++ b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/Answer.java @@ -0,0 +1,24 @@ +/** + * 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.search.autosuggest.models; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Defines an answer. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = Answer.class) +@JsonTypeName("Answer") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "SearchResultsAnswer", value = SearchResultsAnswer.class) +}) +public class Answer extends Response { +} diff --git a/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/AutoSuggestOptionalParameter.java b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/AutoSuggestOptionalParameter.java new file mode 100644 index 000000000000..89b563796edc --- /dev/null +++ b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/AutoSuggestOptionalParameter.java @@ -0,0 +1,444 @@ +/** + * 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.search.autosuggest.models; + +import java.util.List; + +/** + * The AutoSuggestOptionalParameter model. + */ +public class AutoSuggestOptionalParameter { + /** + * A comma-delimited list of one or more languages to use for user + * interface strings. The list is in decreasing order of preference. For + * additional information, including expected format, see + * [RFC2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). This + * header and the setLang query parameter are mutually exclusive; do not + * specify both. If you set this header, you must also specify the + * [cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-autosuggest-api-v7-reference#cc) + * query parameter. To determine the market to return results for, Bing + * uses the first supported language it finds from the list and combines it + * with the cc parameter value. If the list does not include a supported + * language, Bing finds the closest language and market that supports the + * request or it uses an aggregated or default market for the results. To + * determine the market that Bing used, see the BingAPIs-Market header. Use + * this header and the cc query parameter only if you specify multiple + * languages. Otherwise, use the + * [mkt](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-autosuggest-api-v7-reference#mkt) + * and + * [setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-autosuggest-api-v7-reference#setlang) + * query parameters. A user interface string is a string that's used as a + * label in a user interface. There are few user interface strings in the + * JSON response objects. Any links to Bing.com properties in the response + * objects apply the specified language. + */ + private String acceptLanguage; + + /** + * By default, Bing returns cached content, if available. To prevent Bing + * from returning cached content, set the Pragma header to no-cache (for + * example, Pragma: no-cache). + */ + private String pragma; + + /** + * The user agent originating the request. Bing uses the user agent to + * provide mobile users with an optimized experience. Although optional, + * you are encouraged to always specify this header. The user-agent should + * be the same string that any commonly used browser sends. For information + * about user agents, see [RFC + * 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). The + * following are examples of user-agent strings. Windows Phone: Mozilla/5.0 + * (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; + * ARM; Touch; NOKIA; Lumia 822). Android: Mozilla / 5.0 (Linux; U; Android + * 2.3.5; en - us; SCH - I500 Build / GINGERBREAD) AppleWebKit / 533.1 + * (KHTML; like Gecko) Version / 4.0 Mobile Safari / 533.1. iPhone: Mozilla + * / 5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit / 536.26 + * (KHTML; like Gecko) Mobile / 10B142 iPhone4; 1 BingWeb / + * 3.03.1428.20120423. PC: Mozilla / 5.0 (Windows NT 6.3; WOW64; Trident / + * 7.0; Touch; rv:11.0) like Gecko. iPad: Mozilla / 5.0 (iPad; CPU OS 7_0 + * like Mac OS X) AppleWebKit / 537.51.1 (KHTML, like Gecko) Version / 7.0 + * Mobile / 11A465 Safari / 9537.53. + */ + private String userAgent; + + /** + * Bing uses this header to provide users with consistent behavior across + * Bing API calls. Bing often flights new features and improvements, and it + * uses the client ID as a key for assigning traffic on different flights. + * If you do not use the same client ID for a user across multiple + * requests, then Bing may assign the user to multiple conflicting flights. + * Being assigned to multiple conflicting flights can lead to an + * inconsistent user experience. For example, if the second request has a + * different flight assignment than the first, the experience may be + * unexpected. Also, Bing can use the client ID to tailor web results to + * that client ID’s search history, providing a richer experience for the + * user. Bing also uses this header to help improve result rankings by + * analyzing the activity generated by a client ID. The relevance + * improvements help with better quality of results delivered by Bing APIs + * and in turn enables higher click-through rates for the API consumer. + * IMPORTANT: Although optional, you should consider this header required. + * Persisting the client ID across multiple requests for the same end user + * and device combination enables 1) the API consumer to receive a + * consistent user experience, and 2) higher click-through rates via better + * quality of results from the Bing APIs. Each user that uses your + * application on the device must have a unique, Bing generated client ID. + * If you do not include this header in the request, Bing generates an ID + * and returns it in the X-MSEdge-ClientID response header. The only time + * that you should NOT include this header in a request is the first time + * the user uses your app on that device. Use the client ID for each Bing + * API request that your app makes for this user on the device. Persist the + * client ID. To persist the ID in a browser app, use a persistent HTTP + * cookie to ensure the ID is used across all sessions. Do not use a + * session cookie. For other apps such as mobile apps, use the device's + * persistent storage to persist the ID. The next time the user uses your + * app on that device, get the client ID that you persisted. Bing responses + * may or may not include this header. If the response includes this + * header, capture the client ID and use it for all subsequent Bing + * requests for the user on that device. If you include the + * X-MSEdge-ClientID, you must not include cookies in the request. + */ + private String clientId; + + /** + * The IPv4 or IPv6 address of the client device. The IP address is used to + * discover the user's location. Bing uses the location information to + * determine safe search behavior. Although optional, you are encouraged to + * always specify this header and the X-Search-Location header. Do not + * obfuscate the address (for example, by changing the last octet to 0). + * Obfuscating the address results in the location not being anywhere near + * the device's actual location, which may result in Bing serving erroneous + * results. + */ + private String clientIp; + + /** + * A semicolon-delimited list of key/value pairs that describe the client's + * geographical location. Bing uses the location information to determine + * safe search behavior and to return relevant local content. Specify the + * key/value pair as <key>:<value>. The following are the keys + * that you use to specify the user's location. lat (required): The + * latitude of the client's location, in degrees. The latitude must be + * greater than or equal to -90.0 and less than or equal to +90.0. Negative + * values indicate southern latitudes and positive values indicate northern + * latitudes. long (required): The longitude of the client's location, in + * degrees. The longitude must be greater than or equal to -180.0 and less + * than or equal to +180.0. Negative values indicate western longitudes and + * positive values indicate eastern longitudes. re (required): The radius, + * in meters, which specifies the horizontal accuracy of the coordinates. + * Pass the value returned by the device's location service. Typical values + * might be 22m for GPS/Wi-Fi, 380m for cell tower triangulation, and + * 18,000m for reverse IP lookup. ts (optional): The UTC UNIX timestamp of + * when the client was at the location. (The UNIX timestamp is the number + * of seconds since January 1, 1970.) head (optional): The client's + * relative heading or direction of travel. Specify the direction of travel + * as degrees from 0 through 360, counting clockwise relative to true + * north. Specify this key only if the sp key is nonzero. sp (optional): + * The horizontal velocity (speed), in meters per second, that the client + * device is traveling. alt (optional): The altitude of the client device, + * in meters. are (optional): The radius, in meters, that specifies the + * vertical accuracy of the coordinates. Specify this key only if you + * specify the alt key. Although many of the keys are optional, the more + * information that you provide, the more accurate the location results + * are. Although optional, you are encouraged to always specify the user's + * geographical location. Providing the location is especially important if + * the client's IP address does not accurately reflect the user's physical + * location (for example, if the client uses VPN). For optimal results, you + * should include this header and the X-MSEdge-ClientIP header, but at a + * minimum, you should include this header. + */ + private String location; + + /** + * A 2-character country code of the country where the results come from. + * This API supports only the United States market. If you specify this + * query parameter, it must be set to us. If you set this parameter, you + * must also specify the Accept-Language header. Bing uses the first + * supported language it finds from the languages list, and combine that + * language with the country code that you specify to determine the market + * to return results for. If the languages list does not include a + * supported language, Bing finds the closest language and market that + * supports the request, or it may use an aggregated or default market for + * the results instead of a specified one. You should use this query + * parameter and the Accept-Language query parameter only if you specify + * multiple languages; otherwise, you should use the mkt and setLang query + * parameters. This parameter and the mkt query parameter are mutually + * exclusive—do not specify both. + */ + private String countryCode; + + /** + * The market where the results come from. You are strongly encouraged to + * always specify the market, if known. Specifying the market helps Bing + * route the request and return an appropriate and optimal response. This + * parameter and the cc query parameter are mutually exclusive—do not + * specify both. + */ + private String market; + + /** + * Filter suggestions for adult content. The following are the possible + * filter values. Off: Return suggestions with adult text, images, or + * videos. Moderate: Return suggestion with adult text but not adult images + * or videos. Strict: Do not return news articles with adult text, images, + * or videos. If the request comes from a market that Bing's adult policy + * requires that safeSearch is set to Strict, Bing ignores the safeSearch + * value and uses Strict. If you use the site: query operator, there is the + * chance that the response may contain adult content regardless of what + * the safeSearch query parameter is set to. Use site: only if you are + * aware of the content on the site and your scenario supports the + * possibility of adult content. Possible values include: 'Off', + * 'Moderate', 'Strict'. + */ + private SafeSearch safeSearch; + + /** + * The language to use for user interface strings. Specify the language + * using the ISO 639-1 2-letter language code. For example, the language + * code for English is EN. The default is EN (English). Although optional, + * you should always specify the language. Typically, you set setLang to + * the same language specified by mkt unless the user wants the user + * interface strings displayed in a different language. This parameter and + * the Accept-Language header are mutually exclusive; do not specify both. + * A user interface string is a string that's used as a label in a user + * interface. There are few user interface strings in the JSON response + * objects. Also, any links to Bing.com properties in the response objects + * apply the specified language. + */ + private String setLang; + + /** + * The media type to use for the response. The following are the possible + * case-insensitive values: JSON, JSONLD. The default is JSON. If you + * specify JSONLD, the response body includes JSON-LD objects that contain + * the search results. + */ + private List responseFormat; + + /** + * Get the acceptLanguage value. + * + * @return the acceptLanguage value + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Set the acceptLanguage value. + * + * @param acceptLanguage the acceptLanguage value to set + * @return the AutoSuggestOptionalParameter object itself. + */ + public AutoSuggestOptionalParameter withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** + * Get the pragma value. + * + * @return the pragma value + */ + public String pragma() { + return this.pragma; + } + + /** + * Set the pragma value. + * + * @param pragma the pragma value to set + * @return the AutoSuggestOptionalParameter object itself. + */ + public AutoSuggestOptionalParameter withPragma(String pragma) { + this.pragma = pragma; + return this; + } + + /** + * Get the userAgent value. + * + * @return the userAgent value + */ + public String userAgent() { + return this.userAgent; + } + + /** + * Set the userAgent value. + * + * @param userAgent the userAgent value to set + * @return the AutoSuggestOptionalParameter object itself. + */ + public AutoSuggestOptionalParameter withUserAgent(String userAgent) { + this.userAgent = userAgent; + return this; + } + + /** + * Get the clientId value. + * + * @return the clientId value + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId value. + * + * @param clientId the clientId value to set + * @return the AutoSuggestOptionalParameter object itself. + */ + public AutoSuggestOptionalParameter withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the clientIp value. + * + * @return the clientIp value + */ + public String clientIp() { + return this.clientIp; + } + + /** + * Set the clientIp value. + * + * @param clientIp the clientIp value to set + * @return the AutoSuggestOptionalParameter object itself. + */ + public AutoSuggestOptionalParameter withClientIp(String clientIp) { + this.clientIp = clientIp; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the AutoSuggestOptionalParameter object itself. + */ + public AutoSuggestOptionalParameter withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the countryCode value. + * + * @return the countryCode value + */ + public String countryCode() { + return this.countryCode; + } + + /** + * Set the countryCode value. + * + * @param countryCode the countryCode value to set + * @return the AutoSuggestOptionalParameter object itself. + */ + public AutoSuggestOptionalParameter withCountryCode(String countryCode) { + this.countryCode = countryCode; + return this; + } + + /** + * Get the market value. + * + * @return the market value + */ + public String market() { + return this.market; + } + + /** + * Set the market value. + * + * @param market the market value to set + * @return the AutoSuggestOptionalParameter object itself. + */ + public AutoSuggestOptionalParameter withMarket(String market) { + this.market = market; + return this; + } + + /** + * Get the safeSearch value. + * + * @return the safeSearch value + */ + public SafeSearch safeSearch() { + return this.safeSearch; + } + + /** + * Set the safeSearch value. + * + * @param safeSearch the safeSearch value to set + * @return the AutoSuggestOptionalParameter object itself. + */ + public AutoSuggestOptionalParameter withSafeSearch(SafeSearch safeSearch) { + this.safeSearch = safeSearch; + return this; + } + + /** + * Get the setLang value. + * + * @return the setLang value + */ + public String setLang() { + return this.setLang; + } + + /** + * Set the setLang value. + * + * @param setLang the setLang value to set + * @return the AutoSuggestOptionalParameter object itself. + */ + public AutoSuggestOptionalParameter withSetLang(String setLang) { + this.setLang = setLang; + return this; + } + + /** + * Get the responseFormat value. + * + * @return the responseFormat value + */ + public List responseFormat() { + return this.responseFormat; + } + + /** + * Set the responseFormat value. + * + * @param responseFormat the responseFormat value to set + * @return the AutoSuggestOptionalParameter object itself. + */ + public AutoSuggestOptionalParameter withResponseFormat(List responseFormat) { + this.responseFormat = responseFormat; + return this; + } + +} diff --git a/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/CreativeWork.java b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/CreativeWork.java new file mode 100644 index 000000000000..7bdb0e6fae9d --- /dev/null +++ b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/CreativeWork.java @@ -0,0 +1,267 @@ +/** + * 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.search.autosuggest.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The most generic kind of creative work, including books, movies, + * photographs, software programs, etc. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = CreativeWork.class) +@JsonTypeName("CreativeWork") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Action", value = Action.class) +}) +public class CreativeWork extends Thing { + /** + * The URL to a thumbnail of the item. + */ + @JsonProperty(value = "thumbnailUrl", access = JsonProperty.Access.WRITE_ONLY) + private String thumbnailUrl; + + /** + * For internal use only. + */ + @JsonProperty(value = "about", access = JsonProperty.Access.WRITE_ONLY) + private List about; + + /** + * For internal use only. + */ + @JsonProperty(value = "mentions", access = JsonProperty.Access.WRITE_ONLY) + private List mentions; + + /** + * The source of the creative work. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private List provider; + + /** + * The creator property. + */ + @JsonProperty(value = "creator", access = JsonProperty.Access.WRITE_ONLY) + private Thing creator; + + /** + * Text content of this creative work. + */ + @JsonProperty(value = "text", access = JsonProperty.Access.WRITE_ONLY) + private String text; + + /** + * The discussionUrl property. + */ + @JsonProperty(value = "discussionUrl", access = JsonProperty.Access.WRITE_ONLY) + private String discussionUrl; + + /** + * The commentCount property. + */ + @JsonProperty(value = "commentCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer commentCount; + + /** + * The mainEntity property. + */ + @JsonProperty(value = "mainEntity", access = JsonProperty.Access.WRITE_ONLY) + private Thing mainEntity; + + /** + * The headLine property. + */ + @JsonProperty(value = "headLine", access = JsonProperty.Access.WRITE_ONLY) + private String headLine; + + /** + * The copyrightHolder property. + */ + @JsonProperty(value = "copyrightHolder", access = JsonProperty.Access.WRITE_ONLY) + private Thing copyrightHolder; + + /** + * The copyrightYear property. + */ + @JsonProperty(value = "copyrightYear", access = JsonProperty.Access.WRITE_ONLY) + private Integer copyrightYear; + + /** + * The disclaimer property. + */ + @JsonProperty(value = "disclaimer", access = JsonProperty.Access.WRITE_ONLY) + private String disclaimer; + + /** + * The isAccessibleForFree property. + */ + @JsonProperty(value = "isAccessibleForFree", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isAccessibleForFree; + + /** + * The genre property. + */ + @JsonProperty(value = "genre", access = JsonProperty.Access.WRITE_ONLY) + private List genre; + + /** + * The isFamilyFriendly property. + */ + @JsonProperty(value = "isFamilyFriendly", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isFamilyFriendly; + + /** + * Get the thumbnailUrl value. + * + * @return the thumbnailUrl value + */ + public String thumbnailUrl() { + return this.thumbnailUrl; + } + + /** + * Get the about value. + * + * @return the about value + */ + public List about() { + return this.about; + } + + /** + * Get the mentions value. + * + * @return the mentions value + */ + public List mentions() { + return this.mentions; + } + + /** + * Get the provider value. + * + * @return the provider value + */ + public List provider() { + return this.provider; + } + + /** + * Get the creator value. + * + * @return the creator value + */ + public Thing creator() { + return this.creator; + } + + /** + * Get the text value. + * + * @return the text value + */ + public String text() { + return this.text; + } + + /** + * Get the discussionUrl value. + * + * @return the discussionUrl value + */ + public String discussionUrl() { + return this.discussionUrl; + } + + /** + * Get the commentCount value. + * + * @return the commentCount value + */ + public Integer commentCount() { + return this.commentCount; + } + + /** + * Get the mainEntity value. + * + * @return the mainEntity value + */ + public Thing mainEntity() { + return this.mainEntity; + } + + /** + * Get the headLine value. + * + * @return the headLine value + */ + public String headLine() { + return this.headLine; + } + + /** + * Get the copyrightHolder value. + * + * @return the copyrightHolder value + */ + public Thing copyrightHolder() { + return this.copyrightHolder; + } + + /** + * Get the copyrightYear value. + * + * @return the copyrightYear value + */ + public Integer copyrightYear() { + return this.copyrightYear; + } + + /** + * Get the disclaimer value. + * + * @return the disclaimer value + */ + public String disclaimer() { + return this.disclaimer; + } + + /** + * Get the isAccessibleForFree value. + * + * @return the isAccessibleForFree value + */ + public Boolean isAccessibleForFree() { + return this.isAccessibleForFree; + } + + /** + * Get the genre value. + * + * @return the genre value + */ + public List genre() { + return this.genre; + } + + /** + * Get the isFamilyFriendly value. + * + * @return the isFamilyFriendly value + */ + public Boolean isFamilyFriendly() { + return this.isFamilyFriendly; + } + +} diff --git a/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/Error.java b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/Error.java new file mode 100644 index 000000000000..7fc3ea564ffc --- /dev/null +++ b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/Error.java @@ -0,0 +1,120 @@ +/** + * 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.search.autosuggest.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Defines the error that occurred. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = Error.class) +@JsonTypeName("Error") +public class Error { + /** + * The error code that identifies the category of error. Possible values + * include: 'None', 'ServerError', 'InvalidRequest', 'RateLimitExceeded', + * 'InvalidAuthorization', 'InsufficientAuthorization'. + */ + @JsonProperty(value = "code", required = true) + private ErrorCode code; + + /** + * A description of the error. + */ + @JsonProperty(value = "message", required = true) + private String message; + + /** + * A description that provides additional information about the error. + */ + @JsonProperty(value = "moreDetails", access = JsonProperty.Access.WRITE_ONLY) + private String moreDetails; + + /** + * The parameter in the request that caused the error. + */ + @JsonProperty(value = "parameter", access = JsonProperty.Access.WRITE_ONLY) + private String parameter; + + /** + * The parameter's value in the request that was not valid. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Get the code value. + * + * @return the code value + */ + public ErrorCode code() { + return this.code; + } + + /** + * Set the code value. + * + * @param code the code value to set + * @return the Error object itself. + */ + public Error withCode(ErrorCode 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 Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the moreDetails value. + * + * @return the moreDetails value + */ + public String moreDetails() { + return this.moreDetails; + } + + /** + * Get the parameter value. + * + * @return the parameter value + */ + public String parameter() { + return this.parameter; + } + + /** + * Get the value value. + * + * @return the value value + */ + public String value() { + return this.value; + } + +} diff --git a/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/ErrorCode.java b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/ErrorCode.java new file mode 100644 index 000000000000..d06c895ec29d --- /dev/null +++ b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/ErrorCode.java @@ -0,0 +1,53 @@ +/** + * 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.search.autosuggest.models; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ErrorCode. + */ +public final class ErrorCode extends ExpandableStringEnum { + /** Static value None for ErrorCode. */ + public static final ErrorCode NONE = fromString("None"); + + /** Static value ServerError for ErrorCode. */ + public static final ErrorCode SERVER_ERROR = fromString("ServerError"); + + /** Static value InvalidRequest for ErrorCode. */ + public static final ErrorCode INVALID_REQUEST = fromString("InvalidRequest"); + + /** Static value RateLimitExceeded for ErrorCode. */ + public static final ErrorCode RATE_LIMIT_EXCEEDED = fromString("RateLimitExceeded"); + + /** Static value InvalidAuthorization for ErrorCode. */ + public static final ErrorCode INVALID_AUTHORIZATION = fromString("InvalidAuthorization"); + + /** Static value InsufficientAuthorization for ErrorCode. */ + public static final ErrorCode INSUFFICIENT_AUTHORIZATION = fromString("InsufficientAuthorization"); + + /** + * Creates or finds a ErrorCode from its string representation. + * @param name a name to look for + * @return the corresponding ErrorCode + */ + @JsonCreator + public static ErrorCode fromString(String name) { + return fromString(name, ErrorCode.class); + } + + /** + * @return known ErrorCode values + */ + public static Collection values() { + return values(ErrorCode.class); + } +} diff --git a/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/ErrorResponse.java b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/ErrorResponse.java new file mode 100644 index 000000000000..f5244f2167e2 --- /dev/null +++ b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/ErrorResponse.java @@ -0,0 +1,48 @@ +/** + * 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.search.autosuggest.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The top-level response that represents a failed request. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = ErrorResponse.class) +@JsonTypeName("ErrorResponse") +public class ErrorResponse extends Response { + /** + * A list of errors that describe the reasons why the request failed. + */ + @JsonProperty(value = "errors", required = true) + private List errors; + + /** + * Get the errors value. + * + * @return the errors value + */ + public List errors() { + return this.errors; + } + + /** + * Set the errors value. + * + * @param errors the errors value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withErrors(List errors) { + this.errors = errors; + return this; + } + +} diff --git a/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/ErrorResponseException.java b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/ErrorResponseException.java new file mode 100644 index 000000000000..ca666234a7fe --- /dev/null +++ b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/ErrorResponseException.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.search.autosuggest.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException 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 ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/Identifiable.java b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/Identifiable.java new file mode 100644 index 000000000000..5004a24ad0aa --- /dev/null +++ b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/Identifiable.java @@ -0,0 +1,40 @@ +/** + * 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.search.autosuggest.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Defines the identity of a resource. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = Identifiable.class) +@JsonTypeName("Identifiable") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Response", value = Response.class) +}) +public class Identifiable extends ResponseBase { + /** + * A String identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + +} diff --git a/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/QueryContext.java b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/QueryContext.java new file mode 100644 index 000000000000..141547f0054a --- /dev/null +++ b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/QueryContext.java @@ -0,0 +1,140 @@ +/** + * 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.search.autosuggest.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Defines the query context that Bing used for the request. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = QueryContext.class) +@JsonTypeName("QueryContext") +public class QueryContext { + /** + * The query string as specified in the request. + */ + @JsonProperty(value = "originalQuery", required = true) + private String originalQuery; + + /** + * The query string used by Bing to perform the query. Bing uses the + * altered query string if the original query string contained spelling + * mistakes. For example, if the query string is "saling downwind", the + * altered query string will be "sailing downwind". This field is included + * only if the original query string contains a spelling mistake. + */ + @JsonProperty(value = "alteredQuery", access = JsonProperty.Access.WRITE_ONLY) + private String alteredQuery; + + /** + * The query string to use to force Bing to use the original string. For + * example, if the query string is "saling downwind", the override query + * string will be "+saling downwind". Remember to encode the query string + * which results in "%2Bsaling+downwind". This field is included only if + * the original query string contains a spelling mistake. + */ + @JsonProperty(value = "alterationOverrideQuery", access = JsonProperty.Access.WRITE_ONLY) + private String alterationOverrideQuery; + + /** + * A Boolean value that indicates whether the specified query has adult + * intent. The value is true if the query has adult intent; otherwise, + * false. + */ + @JsonProperty(value = "adultIntent", access = JsonProperty.Access.WRITE_ONLY) + private Boolean adultIntent; + + /** + * A Boolean value that indicates whether Bing requires the user's location + * to provide accurate results. If you specified the user's location by + * using the X-MSEdge-ClientIP and X-Search-Location headers, you can + * ignore this field. For location aware queries, such as "today's weather" + * or "restaurants near me" that need the user's location to provide + * accurate results, this field is set to true. For location aware queries + * that include the location (for example, "Seattle weather"), this field + * is set to false. This field is also set to false for queries that are + * not location aware, such as "best sellers". + */ + @JsonProperty(value = "askUserForLocation", access = JsonProperty.Access.WRITE_ONLY) + private Boolean askUserForLocation; + + /** + * The isTransactional property. + */ + @JsonProperty(value = "isTransactional", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isTransactional; + + /** + * Get the originalQuery value. + * + * @return the originalQuery value + */ + public String originalQuery() { + return this.originalQuery; + } + + /** + * Set the originalQuery value. + * + * @param originalQuery the originalQuery value to set + * @return the QueryContext object itself. + */ + public QueryContext withOriginalQuery(String originalQuery) { + this.originalQuery = originalQuery; + return this; + } + + /** + * Get the alteredQuery value. + * + * @return the alteredQuery value + */ + public String alteredQuery() { + return this.alteredQuery; + } + + /** + * Get the alterationOverrideQuery value. + * + * @return the alterationOverrideQuery value + */ + public String alterationOverrideQuery() { + return this.alterationOverrideQuery; + } + + /** + * Get the adultIntent value. + * + * @return the adultIntent value + */ + public Boolean adultIntent() { + return this.adultIntent; + } + + /** + * Get the askUserForLocation value. + * + * @return the askUserForLocation value + */ + public Boolean askUserForLocation() { + return this.askUserForLocation; + } + + /** + * Get the isTransactional value. + * + * @return the isTransactional value + */ + public Boolean isTransactional() { + return this.isTransactional; + } + +} diff --git a/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/Response.java b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/Response.java new file mode 100644 index 000000000000..a6880820d88b --- /dev/null +++ b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/Response.java @@ -0,0 +1,119 @@ +/** + * 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.search.autosuggest.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Defines a response. All schemas that could be returned at the root of a + * response should inherit from this. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = Response.class) +@JsonTypeName("Response") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Answer", value = Answer.class), + @JsonSubTypes.Type(name = "Thing", value = Thing.class), + @JsonSubTypes.Type(name = "ErrorResponse", value = ErrorResponse.class) +}) +public class Response extends Identifiable { + /** + * The URL that returns this resource. + */ + @JsonProperty(value = "readLink", access = JsonProperty.Access.WRITE_ONLY) + private String readLink; + + /** + * The URL To Bing's search result for this item. + */ + @JsonProperty(value = "webSearchUrl", access = JsonProperty.Access.WRITE_ONLY) + private String webSearchUrl; + + /** + * The potentialAction property. + */ + @JsonProperty(value = "potentialAction", access = JsonProperty.Access.WRITE_ONLY) + private List potentialAction; + + /** + * The immediateAction property. + */ + @JsonProperty(value = "immediateAction", access = JsonProperty.Access.WRITE_ONLY) + private List immediateAction; + + /** + * The preferredClickthroughUrl property. + */ + @JsonProperty(value = "preferredClickthroughUrl", access = JsonProperty.Access.WRITE_ONLY) + private String preferredClickthroughUrl; + + /** + * The adaptiveCard property. + */ + @JsonProperty(value = "adaptiveCard", access = JsonProperty.Access.WRITE_ONLY) + private String adaptiveCard; + + /** + * Get the readLink value. + * + * @return the readLink value + */ + public String readLink() { + return this.readLink; + } + + /** + * Get the webSearchUrl value. + * + * @return the webSearchUrl value + */ + public String webSearchUrl() { + return this.webSearchUrl; + } + + /** + * Get the potentialAction value. + * + * @return the potentialAction value + */ + public List potentialAction() { + return this.potentialAction; + } + + /** + * Get the immediateAction value. + * + * @return the immediateAction value + */ + public List immediateAction() { + return this.immediateAction; + } + + /** + * Get the preferredClickthroughUrl value. + * + * @return the preferredClickthroughUrl value + */ + public String preferredClickthroughUrl() { + return this.preferredClickthroughUrl; + } + + /** + * Get the adaptiveCard value. + * + * @return the adaptiveCard value + */ + public String adaptiveCard() { + return this.adaptiveCard; + } + +} diff --git a/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/ResponseBase.java b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/ResponseBase.java new file mode 100644 index 000000000000..1c61f3b18c88 --- /dev/null +++ b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/ResponseBase.java @@ -0,0 +1,24 @@ +/** + * 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.search.autosuggest.models; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Response base. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = ResponseBase.class) +@JsonTypeName("ResponseBase") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Identifiable", value = Identifiable.class) +}) +public class ResponseBase { +} diff --git a/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/ResponseFormat.java b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/ResponseFormat.java new file mode 100644 index 000000000000..8a1ec67f9f1d --- /dev/null +++ b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/ResponseFormat.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.search.autosuggest.models; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ResponseFormat. + */ +public final class ResponseFormat extends ExpandableStringEnum { + /** Static value Json for ResponseFormat. */ + public static final ResponseFormat JSON = fromString("Json"); + + /** Static value JsonLd for ResponseFormat. */ + public static final ResponseFormat JSON_LD = fromString("JsonLd"); + + /** + * Creates or finds a ResponseFormat from its string representation. + * @param name a name to look for + * @return the corresponding ResponseFormat + */ + @JsonCreator + public static ResponseFormat fromString(String name) { + return fromString(name, ResponseFormat.class); + } + + /** + * @return known ResponseFormat values + */ + public static Collection values() { + return values(ResponseFormat.class); + } +} diff --git a/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/SafeSearch.java b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/SafeSearch.java new file mode 100644 index 000000000000..409ce3aca1ff --- /dev/null +++ b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/SafeSearch.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.search.autosuggest.models; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SafeSearch. + */ +public final class SafeSearch extends ExpandableStringEnum { + /** Static value Off for SafeSearch. */ + public static final SafeSearch OFF = fromString("Off"); + + /** Static value Moderate for SafeSearch. */ + public static final SafeSearch MODERATE = fromString("Moderate"); + + /** Static value Strict for SafeSearch. */ + public static final SafeSearch STRICT = fromString("Strict"); + + /** + * Creates or finds a SafeSearch from its string representation. + * @param name a name to look for + * @return the corresponding SafeSearch + */ + @JsonCreator + public static SafeSearch fromString(String name) { + return fromString(name, SafeSearch.class); + } + + /** + * @return known SafeSearch values + */ + public static Collection values() { + return values(SafeSearch.class); + } +} diff --git a/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/ScenarioType.java b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/ScenarioType.java new file mode 100644 index 000000000000..cfc756eec2bd --- /dev/null +++ b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/ScenarioType.java @@ -0,0 +1,56 @@ +/** + * 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.search.autosuggest.models; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ScenarioType. + */ +public final class ScenarioType extends ExpandableStringEnum { + /** Static value Unknown for ScenarioType. */ + public static final ScenarioType UNKNOWN = fromString("Unknown"); + + /** Static value Web for ScenarioType. */ + public static final ScenarioType WEB = fromString("Web"); + + /** Static value StoreApps for ScenarioType. */ + public static final ScenarioType STORE_APPS = fromString("StoreApps"); + + /** Static value SearchHistory for ScenarioType. */ + public static final ScenarioType SEARCH_HISTORY = fromString("SearchHistory"); + + /** Static value PersonalSearchDocuments for ScenarioType. */ + public static final ScenarioType PERSONAL_SEARCH_DOCUMENTS = fromString("PersonalSearchDocuments"); + + /** Static value PersonalSearchTags for ScenarioType. */ + public static final ScenarioType PERSONAL_SEARCH_TAGS = fromString("PersonalSearchTags"); + + /** Static value Custom for ScenarioType. */ + public static final ScenarioType CUSTOM = fromString("Custom"); + + /** + * Creates or finds a ScenarioType from its string representation. + * @param name a name to look for + * @return the corresponding ScenarioType + */ + @JsonCreator + public static ScenarioType fromString(String name) { + return fromString(name, ScenarioType.class); + } + + /** + * @return known ScenarioType values + */ + public static Collection values() { + return values(ScenarioType.class); + } +} diff --git a/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/SearchAction.java b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/SearchAction.java new file mode 100644 index 000000000000..baf4b976051c --- /dev/null +++ b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/SearchAction.java @@ -0,0 +1,67 @@ +/** + * 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.search.autosuggest.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The SearchAction model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = SearchAction.class) +@JsonTypeName("SearchAction") +public class SearchAction extends Action { + /** + * The displayText property. + */ + @JsonProperty(value = "displayText", access = JsonProperty.Access.WRITE_ONLY) + private String displayText; + + /** + * The query property. + */ + @JsonProperty(value = "query", access = JsonProperty.Access.WRITE_ONLY) + private String query; + + /** + * Possible values include: 'WebSearch', 'HistorySearch', 'DocumentSearch', + * 'TagSearch', 'LocationSearch', 'CustomSearch'. + */ + @JsonProperty(value = "searchKind", access = JsonProperty.Access.WRITE_ONLY) + private SearchKind searchKind; + + /** + * Get the displayText value. + * + * @return the displayText value + */ + public String displayText() { + return this.displayText; + } + + /** + * Get the query value. + * + * @return the query value + */ + public String query() { + return this.query; + } + + /** + * Get the searchKind value. + * + * @return the searchKind value + */ + public SearchKind searchKind() { + return this.searchKind; + } + +} diff --git a/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/SearchKind.java b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/SearchKind.java new file mode 100644 index 000000000000..1aef698621d8 --- /dev/null +++ b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/SearchKind.java @@ -0,0 +1,53 @@ +/** + * 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.search.autosuggest.models; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SearchKind. + */ +public final class SearchKind extends ExpandableStringEnum { + /** Static value WebSearch for SearchKind. */ + public static final SearchKind WEB_SEARCH = fromString("WebSearch"); + + /** Static value HistorySearch for SearchKind. */ + public static final SearchKind HISTORY_SEARCH = fromString("HistorySearch"); + + /** Static value DocumentSearch for SearchKind. */ + public static final SearchKind DOCUMENT_SEARCH = fromString("DocumentSearch"); + + /** Static value TagSearch for SearchKind. */ + public static final SearchKind TAG_SEARCH = fromString("TagSearch"); + + /** Static value LocationSearch for SearchKind. */ + public static final SearchKind LOCATION_SEARCH = fromString("LocationSearch"); + + /** Static value CustomSearch for SearchKind. */ + public static final SearchKind CUSTOM_SEARCH = fromString("CustomSearch"); + + /** + * Creates or finds a SearchKind from its string representation. + * @param name a name to look for + * @return the corresponding SearchKind + */ + @JsonCreator + public static SearchKind fromString(String name) { + return fromString(name, SearchKind.class); + } + + /** + * @return known SearchKind values + */ + public static Collection values() { + return values(SearchKind.class); + } +} diff --git a/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/SearchResultsAnswer.java b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/SearchResultsAnswer.java new file mode 100644 index 000000000000..a07439ca03c6 --- /dev/null +++ b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/SearchResultsAnswer.java @@ -0,0 +1,40 @@ +/** + * 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.search.autosuggest.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Defines a search result answer. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = SearchResultsAnswer.class) +@JsonTypeName("SearchResultsAnswer") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Suggestions", value = Suggestions.class) +}) +public class SearchResultsAnswer extends Answer { + /** + * The queryContext property. + */ + @JsonProperty(value = "queryContext", access = JsonProperty.Access.WRITE_ONLY) + private QueryContext queryContext; + + /** + * Get the queryContext value. + * + * @return the queryContext value + */ + public QueryContext queryContext() { + return this.queryContext; + } + +} diff --git a/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/Suggestions.java b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/Suggestions.java new file mode 100644 index 000000000000..8bb72858ef21 --- /dev/null +++ b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/Suggestions.java @@ -0,0 +1,48 @@ +/** + * 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.search.autosuggest.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The Suggestions model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = Suggestions.class) +@JsonTypeName("Suggestions") +public class Suggestions extends SearchResultsAnswer { + /** + * The suggestionGroups property. + */ + @JsonProperty(value = "suggestionGroups", required = true) + private List suggestionGroups; + + /** + * Get the suggestionGroups value. + * + * @return the suggestionGroups value + */ + public List suggestionGroups() { + return this.suggestionGroups; + } + + /** + * Set the suggestionGroups value. + * + * @param suggestionGroups the suggestionGroups value to set + * @return the Suggestions object itself. + */ + public Suggestions withSuggestionGroups(List suggestionGroups) { + this.suggestionGroups = suggestionGroups; + return this; + } + +} diff --git a/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/SuggestionsSuggestionGroup.java b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/SuggestionsSuggestionGroup.java new file mode 100644 index 000000000000..cf3e184d658c --- /dev/null +++ b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/SuggestionsSuggestionGroup.java @@ -0,0 +1,75 @@ +/** + * 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.search.autosuggest.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The SuggestionsSuggestionGroup model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = SuggestionsSuggestionGroup.class) +@JsonTypeName("Suggestions/SuggestionGroup") +public class SuggestionsSuggestionGroup { + /** + * Possible values include: 'Unknown', 'Web', 'StoreApps', 'SearchHistory', + * 'PersonalSearchDocuments', 'PersonalSearchTags', 'Custom'. + */ + @JsonProperty(value = "name", required = true) + private ScenarioType name; + + /** + * The searchSuggestions property. + */ + @JsonProperty(value = "searchSuggestions", required = true) + private List searchSuggestions; + + /** + * Get the name value. + * + * @return the name value + */ + public ScenarioType name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the SuggestionsSuggestionGroup object itself. + */ + public SuggestionsSuggestionGroup withName(ScenarioType name) { + this.name = name; + return this; + } + + /** + * Get the searchSuggestions value. + * + * @return the searchSuggestions value + */ + public List searchSuggestions() { + return this.searchSuggestions; + } + + /** + * Set the searchSuggestions value. + * + * @param searchSuggestions the searchSuggestions value to set + * @return the SuggestionsSuggestionGroup object itself. + */ + public SuggestionsSuggestionGroup withSearchSuggestions(List searchSuggestions) { + this.searchSuggestions = searchSuggestions; + return this; + } + +} diff --git a/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/Thing.java b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/Thing.java new file mode 100644 index 000000000000..3641d2fc062e --- /dev/null +++ b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/Thing.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.search.autosuggest.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Defines a thing. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = Thing.class) +@JsonTypeName("Thing") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "CreativeWork", value = CreativeWork.class) +}) +public class Thing extends Response { + /** + * The URL to get more information about the thing represented by this + * object. + */ + @JsonProperty(value = "url", access = JsonProperty.Access.WRITE_ONLY) + private String url; + + /** + * Get the url value. + * + * @return the url value + */ + public String url() { + return this.url; + } + +} diff --git a/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/package-info.java b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/package-info.java new file mode 100644 index 000000000000..33998dc70a68 --- /dev/null +++ b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/models/package-info.java @@ -0,0 +1,11 @@ +// 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. + +/** + * This package contains the models classes for BingAutoSuggestSearchAPI. + * The AutoSuggest Search API lets you send a search query to Bing and get back a list of news that are relevant to the search query. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the web for AutoSuggest](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-autosuggest-api-v7-reference). + */ +package com.microsoft.azure.cognitiveservices.search.autosuggest.models; diff --git a/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/package-info.java b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/package-info.java new file mode 100644 index 000000000000..326a3f121092 --- /dev/null +++ b/cognitiveservices/data-plane/search/bingautosuggest/src/main/java/com/microsoft/azure/cognitiveservices/search/autosuggest/package-info.java @@ -0,0 +1,11 @@ +// 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. + +/** + * This package contains the classes for BingAutoSuggestSearchAPI. + * The AutoSuggest Search API lets you send a search query to Bing and get back a list of news that are relevant to the search query. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the web for AutoSuggest](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-autosuggest-api-v7-reference). + */ +package com.microsoft.azure.cognitiveservices.search.autosuggest; diff --git a/cognitiveservices/data-plane/search/bingcustomimagesearch/pom.xml b/cognitiveservices/data-plane/search/bingcustomimagesearch/pom.xml index 74c231d9ec0e..4362d9179db5 100644 --- a/cognitiveservices/data-plane/search/bingcustomimagesearch/pom.xml +++ b/cognitiveservices/data-plane/search/bingcustomimagesearch/pom.xml @@ -8,15 +8,15 @@ com.microsoft.azure.cognitiveservices azure-cognitiveservices-parent - 1.0.1 + 1.0.2 ../../pom.xml azure-cognitiveservices-customimagesearch - 1.0.1-beta + 1.0.2-beta jar Microsoft Azure SDK for Cognitive Service Custom Image Search This package contains Microsoft Cognitive Service Custom Image Search SDK. - https://github.com/Azure/azure-sdk-for-java/azure-cognitiveservices/search/bingcustomimagesearch + https://github.com/Azure/azure-sdk-for-java/cognitiveservices/data-plane/search/bingcustomimagesearch The MIT License (MIT) diff --git a/cognitiveservices/data-plane/search/bingcustomimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customimagesearch/BingCustomImageSearchManager.java b/cognitiveservices/data-plane/search/bingcustomimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customimagesearch/BingCustomImageSearchManager.java new file mode 100644 index 000000000000..14368992df2b --- /dev/null +++ b/cognitiveservices/data-plane/search/bingcustomimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customimagesearch/BingCustomImageSearchManager.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.cognitiveservices.search.customimagesearch; + +import com.microsoft.azure.cognitiveservices.search.customimagesearch.implementation.BingCustomImageSearchAPIImpl; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import okhttp3.Interceptor; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; + +import java.io.IOException; + +/** + * Entry point to Azure Cognitive Services Bing Custom Image Search manager. + */ +public class BingCustomImageSearchManager { + /** + * Initializes an instance of Bing Custom Image Search API client. + * + * @param subscriptionKey the Bing Search API key + * @return the Bing Custom Search API client + */ + public static BingCustomImageSearchAPI authenticate(String subscriptionKey) { + return authenticate("https://api.cognitive.microsoft.com/bingcustomsearch/v7.0/", subscriptionKey); + } + + /** + * Initializes an instance of Bing Custom Image Search API client. + * + * @param baseUrl the base URL of the service + * @param subscriptionKey the Bing Search API key + * @return the Bing Custom Search API client + */ + public static BingCustomImageSearchAPI authenticate(String baseUrl, final String subscriptionKey) { + ServiceClientCredentials serviceClientCredentials = new ServiceClientCredentials() { + @Override + public void applyCredentialsFilter(OkHttpClient.Builder builder) { + builder.addNetworkInterceptor( + new Interceptor() { + @Override + public Response intercept(Chain chain) throws IOException { + Request request = null; + Request original = chain.request(); + // Request customization: add request headers + Request.Builder requestBuilder = original.newBuilder() + .addHeader("Ocp-Apim-Subscription-Key", subscriptionKey); + request = requestBuilder.build(); + return chain.proceed(request); + } + }); + } + }; + return authenticate(baseUrl, serviceClientCredentials); + } + + /** + * Initializes an instance of Bing Custom Image Search API client. + * + * @param credentials the management credentials for Azure + * @return the Bing Custom Image Search API client + */ + public static BingCustomImageSearchAPI authenticate(ServiceClientCredentials credentials) { + return authenticate("https://api.cognitive.microsoft.com/bingcustomsearch/v7.0/", credentials); + } + + /** + * Initializes an instance of Bing Custom Image Search API client. + * + * @param baseUrl the base URL of the service + * @param credentials the management credentials for Azure + * @return the Bing Custom Image Search API client + */ + public static BingCustomImageSearchAPI authenticate(String baseUrl, ServiceClientCredentials credentials) { + return new BingCustomImageSearchAPIImpl(baseUrl, credentials); + } + + /** + * Initializes an instance of Bing Custom Image Search API client. + * + * @param restClient the REST client to connect to Azure. + * @return the Bing Custom Image Search API client + */ + public static BingCustomImageSearchAPI authenticate(RestClient restClient) { + return new BingCustomImageSearchAPIImpl(restClient); + } +} diff --git a/cognitiveservices/data-plane/search/bingcustomsearch/pom.xml b/cognitiveservices/data-plane/search/bingcustomsearch/pom.xml index be4bf0559b0d..14c184488025 100644 --- a/cognitiveservices/data-plane/search/bingcustomsearch/pom.xml +++ b/cognitiveservices/data-plane/search/bingcustomsearch/pom.xml @@ -8,15 +8,15 @@ com.microsoft.azure.cognitiveservices azure-cognitiveservices-parent - 1.0.1 + 1.0.2 ../../pom.xml azure-cognitiveservices-customsearch - 1.0.1 + 1.0.2 jar Microsoft Azure SDK for Cognitive Service Custom Search This package contains Microsoft Cognitive Service Custom Search SDK. - https://github.com/Azure/azure-sdk-for-java/azure-cognitiveservices/search/bingcustomsearch + https://github.com/Azure/azure-sdk-for-java/cognitiveservices/data-plane/search/bingcustomsearch The MIT License (MIT) diff --git a/cognitiveservices/data-plane/search/bingentitysearch/pom.xml b/cognitiveservices/data-plane/search/bingentitysearch/pom.xml index 45e08e242914..58421872540f 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/pom.xml +++ b/cognitiveservices/data-plane/search/bingentitysearch/pom.xml @@ -8,15 +8,15 @@ com.microsoft.azure.cognitiveservices azure-cognitiveservices-parent - 1.0.1 + 1.0.2 ../../pom.xml azure-cognitiveservices-entitysearch - 1.0.1 + 1.0.2 jar Microsoft Azure SDK for Cognitive Service Entity Search This package contains Microsoft Cognitive Service Entity Search SDK. - https://github.com/Azure/azure-sdk-for-java/azure-cognitiveservices/search/bingentitysearch + https://github.com/Azure/azure-sdk-for-java/cognitiveservices/data-plane/search/bingentitysearch The MIT License (MIT) diff --git a/cognitiveservices/data-plane/search/bingimagesearch/pom.xml b/cognitiveservices/data-plane/search/bingimagesearch/pom.xml index e3266c6cf640..6ec62a353a1e 100644 --- a/cognitiveservices/data-plane/search/bingimagesearch/pom.xml +++ b/cognitiveservices/data-plane/search/bingimagesearch/pom.xml @@ -8,15 +8,15 @@ com.microsoft.azure.cognitiveservices azure-cognitiveservices-parent - 1.0.1 + 1.0.2 ../../pom.xml azure-cognitiveservices-imagesearch - 1.0.1 + 1.0.2 jar Microsoft Azure SDK for Cognitive Service Image Search This package contains Microsoft Cognitive Service Image Search SDK. - https://github.com/Azure/azure-sdk-for-java/azure-cognitiveservices/search/bingimagesearch + https://github.com/Azure/azure-sdk-for-java/cognitiveservices/data-plane/search/bingimagesearch The MIT License (MIT) diff --git a/cognitiveservices/data-plane/search/bingnewssearch/pom.xml b/cognitiveservices/data-plane/search/bingnewssearch/pom.xml index 855d383b5939..97d457b0420a 100644 --- a/cognitiveservices/data-plane/search/bingnewssearch/pom.xml +++ b/cognitiveservices/data-plane/search/bingnewssearch/pom.xml @@ -8,15 +8,15 @@ com.microsoft.azure.cognitiveservices azure-cognitiveservices-parent - 1.0.1 + 1.0.2 ../../pom.xml azure-cognitiveservices-newssearch - 1.0.1 + 1.0.2 jar Microsoft Azure SDK for Cognitive Service News Search This package contains Microsoft Cognitive Service News Search SDK. - https://github.com/Azure/azure-sdk-for-java/azure-cognitiveservices/search/bingnewssearch + https://github.com/Azure/azure-sdk-for-java/cognitiveservices/data-plane/search/bingnewssearch The MIT License (MIT) diff --git a/cognitiveservices/data-plane/search/bingvideosearch/pom.xml b/cognitiveservices/data-plane/search/bingvideosearch/pom.xml index b086a0e28272..149edcf09ea9 100644 --- a/cognitiveservices/data-plane/search/bingvideosearch/pom.xml +++ b/cognitiveservices/data-plane/search/bingvideosearch/pom.xml @@ -8,15 +8,15 @@ com.microsoft.azure.cognitiveservices azure-cognitiveservices-parent - 1.0.1 + 1.0.2 ../../pom.xml azure-cognitiveservices-videosearch - 1.0.1 + 1.0.2 jar Microsoft Azure SDK for Cognitive Service Video Search This package contains Microsoft Cognitive Service Video Search SDK. - https://github.com/Azure/azure-sdk-for-java/azure-cognitiveservices/search/bingvideosearch + https://github.com/Azure/azure-sdk-for-java/cognitiveservices/data-plane/search/bingvideosearch The MIT License (MIT) diff --git a/cognitiveservices/data-plane/search/bingvisualsearch/pom.xml b/cognitiveservices/data-plane/search/bingvisualsearch/pom.xml index 1415d6fc9303..bf6ba0b59e49 100644 --- a/cognitiveservices/data-plane/search/bingvisualsearch/pom.xml +++ b/cognitiveservices/data-plane/search/bingvisualsearch/pom.xml @@ -8,15 +8,15 @@ com.microsoft.azure.cognitiveservices azure-cognitiveservices-parent - 1.0.1 + 1.0.2 ../../pom.xml azure-cognitiveservices-visualsearch - 1.0.1-beta + 1.0.2-beta jar Microsoft Azure SDK for Cognitive Service Visual Search This package contains Microsoft Cognitive Service Visual Search SDK. - https://github.com/Azure/azure-sdk-for-java/azure-cognitiveservices/search/bingvisualsearch + https://github.com/Azure/azure-sdk-for-java/cognitiveservices/data-plane/search/bingvisualsearch The MIT License (MIT) diff --git a/cognitiveservices/data-plane/search/bingwebsearch/pom.xml b/cognitiveservices/data-plane/search/bingwebsearch/pom.xml index 3fefc532104e..82b74ceb2e93 100644 --- a/cognitiveservices/data-plane/search/bingwebsearch/pom.xml +++ b/cognitiveservices/data-plane/search/bingwebsearch/pom.xml @@ -8,15 +8,15 @@ com.microsoft.azure.cognitiveservices azure-cognitiveservices-parent - 1.0.1 + 1.0.2 ../../pom.xml azure-cognitiveservices-websearch - 1.0.1 + 1.0.2 jar Microsoft Azure SDK for Cognitive Service Web Search This package contains Microsoft Cognitive Service Web Search SDK. - https://github.com/Azure/azure-sdk-for-java/azure-cognitiveservices/search/bingwebsearch + https://github.com/Azure/azure-sdk-for-java/cognitiveservices/data-plane/search/bingwebsearch The MIT License (MIT) diff --git a/cognitiveservices/data-plane/vision/computervision/pom.xml b/cognitiveservices/data-plane/vision/computervision/pom.xml index b60fcda537b8..f585c51f9857 100755 --- a/cognitiveservices/data-plane/vision/computervision/pom.xml +++ b/cognitiveservices/data-plane/vision/computervision/pom.xml @@ -10,15 +10,15 @@ com.microsoft.azure.cognitiveservices azure-cognitiveservices-parent - 1.0.1 + 1.0.2 ../../pom.xml azure-cognitiveservices-computervision - 1.0.1-beta + 1.0.2-beta jar Microsoft Azure SDK for Cognitive Service Computer Vision This package contains Microsoft Cognitive Service Computer Vision SDK. - https://github.com/Azure/azure-sdk-for-java/azure-cognitiveservices/vision/computervision + https://github.com/Azure/azure-sdk-for-java/cognitiveservices/data-plane/vision/computervision The MIT License (MIT) diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/ComputerVision.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/ComputerVision.java index cddbaa3fe633..8f22f907307c 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/ComputerVision.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/ComputerVision.java @@ -8,14 +8,12 @@ package com.microsoft.azure.cognitiveservices.vision.computervision; -import com.microsoft.azure.cognitiveservices.vision.computervision.models.RecognizeTextInStreamOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.computervision.models.AnalyzeImageByDomainInStreamOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.computervision.models.TagImageInStreamOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.computervision.models.DescribeImageInStreamOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.computervision.models.RecognizePrintedTextInStreamOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.computervision.models.GenerateThumbnailInStreamOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.computervision.models.AnalyzeImageInStreamOptionalParameter; -import com.microsoft.azure.cognitiveservices.vision.computervision.models.RecognizeTextOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.computervision.models.AnalyzeImageByDomainOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.computervision.models.TagImageOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.computervision.models.DescribeImageOptionalParameter; @@ -33,6 +31,7 @@ import com.microsoft.azure.cognitiveservices.vision.computervision.models.OcrResult; import com.microsoft.azure.cognitiveservices.vision.computervision.models.TagResult; import com.microsoft.azure.cognitiveservices.vision.computervision.models.TextOperationResult; +import com.microsoft.azure.cognitiveservices.vision.computervision.models.TextRecognitionMode; import com.microsoft.azure.cognitiveservices.vision.computervision.models.VisualFeatureTypes; import java.io.InputStream; import java.util.List; @@ -43,98 +42,32 @@ * in ComputerVision. */ public interface ComputerVision { + /** - * Recognize Text operation. When you use the Recognize Text interface, the response contains a field called - * 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get - * Handwritten Text Operation Result operation. + * Recognize Text operation. When you use the Recognize Text interface, the response contains a field + * called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for + * your Get Recognize Text Operation Result operation. * * @param image An image stream. - * @param recognizeTextInStreamOptionalParameter the object representing the optional parameters to be set before calling this API + * @param mode Type of text to recognize. Possible values include: 'Handwritten', 'Printed'. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ComputerVisionErrorException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ - - void recognizeTextInStream(byte[] image, RecognizeTextInStreamOptionalParameter recognizeTextInStreamOptionalParameter); + void recognizeTextInStream(byte[] image, TextRecognitionMode mode); /** - * Recognize Text operation. When you use the Recognize Text interface, the response contains a field called - * 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get - * Handwritten Text Operation Result operation. + * Recognize Text operation. When you use the Recognize Text interface, the response contains a field + * called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for + * your Get Recognize Text Operation Result operation. * * @param image An image stream. - * @param recognizeTextInStreamOptionalParameter the object representing the optional parameters to be set before calling this API + * @param mode Type of text to recognize. Possible values include: 'Handwritten', 'Printed'. * @throws IllegalArgumentException thrown if parameters fail the validation * @return a representation of the deferred computation of this call if successful. */ - - Observable recognizeTextInStreamAsync(byte[] image, RecognizeTextInStreamOptionalParameter recognizeTextInStreamOptionalParameter); - - /** - * Recognize Text operation. When you use the Recognize Text interface, the response contains a field called - * 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get - * Handwritten Text Operation Result operation. - * - * @return the first stage of the recognizeTextInStream call - */ - ComputerVisionRecognizeTextInStreamDefinitionStages.WithImage recognizeTextInStream(); - - /** - * Grouping of recognizeTextInStream definition stages. - */ - interface ComputerVisionRecognizeTextInStreamDefinitionStages { - /** - * The stage of the definition to be specify image. - */ - interface WithImage { - /** - * An image stream. - * - * @return next definition stage - */ - ComputerVisionRecognizeTextInStreamDefinitionStages.WithExecute withImage(byte[] image); - } + Observable recognizeTextInStreamAsync(byte[] image, TextRecognitionMode mode); - /** - * The stage of the definition which allows for any other optional settings to be specified. - */ - interface WithAllOptions { - /** - * If 'true' is specified, handwriting recognition is performed. If this parameter is set to 'false' or is not - * specified, printed text recognition is performed. - * - * @return next definition stage - */ - ComputerVisionRecognizeTextInStreamDefinitionStages.WithExecute withDetectHandwriting(Boolean detectHandwriting); - - } - - /** - * The last stage of the definition which will make the operation call. - */ - interface WithExecute extends ComputerVisionRecognizeTextInStreamDefinitionStages.WithAllOptions { - /** - * Execute the request. - * - */ - void execute(); - - /** - * Execute the request asynchronously. - * - * @return a representation of the deferred computation of this call if successful. - */ - Observable executeAsync(); - } - } - - /** - * The entirety of recognizeTextInStream definition. - */ - interface ComputerVisionRecognizeTextInStreamDefinition extends - ComputerVisionRecognizeTextInStreamDefinitionStages.WithImage, - ComputerVisionRecognizeTextInStreamDefinitionStages.WithExecute { - } /** * This operation recognizes content within an image by applying a domain-specific model. The list of @@ -152,7 +85,7 @@ interface ComputerVisionRecognizeTextInStreamDefinition extends * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the DomainModelResults object if successful. */ - + @Deprecated DomainModelResults analyzeImageByDomainInStream(String model, byte[] image, AnalyzeImageByDomainInStreamOptionalParameter analyzeImageByDomainInStreamOptionalParameter); /** @@ -169,7 +102,7 @@ interface ComputerVisionRecognizeTextInStreamDefinition extends * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DomainModelResults object */ - + @Deprecated Observable analyzeImageByDomainInStreamAsync(String model, byte[] image, AnalyzeImageByDomainInStreamOptionalParameter analyzeImageByDomainInStreamOptionalParameter); /** @@ -217,8 +150,8 @@ interface WithImage { interface WithAllOptions { /** * The desired language for output generation. If this parameter is not specified, the default value is - * &quot;en&quot;.Supported languages:en - English, Default.ja - Japanese pt - Portuguese zh - - * Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh'. + * &quot;en&quot;.Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - + * Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', 'ja', 'pt', 'zh'. * * @return next definition stage */ @@ -269,7 +202,7 @@ interface ComputerVisionAnalyzeImageByDomainInStreamDefinition extends * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the TagResult object if successful. */ - + @Deprecated TagResult tagImageInStream(byte[] image, TagImageInStreamOptionalParameter tagImageInStreamOptionalParameter); /** @@ -284,7 +217,7 @@ interface ComputerVisionAnalyzeImageByDomainInStreamDefinition extends * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the TagResult object */ - + @Deprecated Observable tagImageInStreamAsync(byte[] image, TagImageInStreamOptionalParameter tagImageInStreamOptionalParameter); /** @@ -320,8 +253,8 @@ interface WithImage { interface WithAllOptions { /** * The desired language for output generation. If this parameter is not specified, the default value is - * &quot;en&quot;.Supported languages:en - English, Default.ja - Japanese pt - Portuguese zh - - * Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh'. + * &quot;en&quot;.Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - + * Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', 'ja', 'pt', 'zh'. * * @return next definition stage */ @@ -372,7 +305,7 @@ interface ComputerVisionTagImageInStreamDefinition extends * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ImageDescription object if successful. */ - + @Deprecated ImageDescription describeImageInStream(byte[] image, DescribeImageInStreamOptionalParameter describeImageInStreamOptionalParameter); /** @@ -388,7 +321,7 @@ interface ComputerVisionTagImageInStreamDefinition extends * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ImageDescription object */ - + @Deprecated Observable describeImageInStreamAsync(byte[] image, DescribeImageInStreamOptionalParameter describeImageInStreamOptionalParameter); /** @@ -432,8 +365,8 @@ interface WithAllOptions { /** * The desired language for output generation. If this parameter is not specified, the default value is - * &quot;en&quot;.Supported languages:en - English, Default.ja - Japanese pt - Portuguese zh - - * Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh'. + * &quot;en&quot;.Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - + * Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', 'ja', 'pt', 'zh'. * * @return next definition stage */ @@ -484,7 +417,7 @@ interface ComputerVisionDescribeImageInStreamDefinition extends * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the OcrResult object if successful. */ - + @Deprecated OcrResult recognizePrintedTextInStream(boolean detectOrientation, byte[] image, RecognizePrintedTextInStreamOptionalParameter recognizePrintedTextInStreamOptionalParameter); /** @@ -500,7 +433,7 @@ interface ComputerVisionDescribeImageInStreamDefinition extends * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the OcrResult object */ - + @Deprecated Observable recognizePrintedTextInStreamAsync(boolean detectOrientation, byte[] image, RecognizePrintedTextInStreamOptionalParameter recognizePrintedTextInStreamOptionalParameter); /** @@ -601,7 +534,7 @@ interface ComputerVisionRecognizePrintedTextInStreamDefinition extends * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the InputStream object if successful. */ - + @Deprecated InputStream generateThumbnailInStream(int width, int height, byte[] image, GenerateThumbnailInStreamOptionalParameter generateThumbnailInStreamOptionalParameter); /** @@ -618,7 +551,7 @@ interface ComputerVisionRecognizePrintedTextInStreamDefinition extends * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the InputStream object */ - + @Deprecated Observable generateThumbnailInStreamAsync(int width, int height, byte[] image, GenerateThumbnailInStreamOptionalParameter generateThumbnailInStreamOptionalParameter); /** @@ -723,7 +656,7 @@ interface ComputerVisionGenerateThumbnailInStreamDefinition extends * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ImageAnalysis object if successful. */ - + @Deprecated ImageAnalysis analyzeImageInStream(byte[] image, AnalyzeImageInStreamOptionalParameter analyzeImageInStreamOptionalParameter); /** @@ -734,7 +667,7 @@ interface ComputerVisionGenerateThumbnailInStreamDefinition extends * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ImageAnalysis object */ - + @Deprecated Observable analyzeImageInStreamAsync(byte[] image, AnalyzeImageInStreamOptionalParameter analyzeImageInStreamOptionalParameter); /** @@ -789,8 +722,8 @@ interface WithAllOptions { /** * The desired language for output generation. If this parameter is not specified, the default value is - * &quot;en&quot;.Supported languages:en - English, Default.ja - Japanese pt - Portuguese zh - - * Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh'. + * &quot;en&quot;.Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - + * Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', 'ja', 'pt', 'zh'. * * @return next definition stage */ @@ -831,7 +764,7 @@ interface ComputerVisionAnalyzeImageInStreamDefinition extends * This interface is used for getting text operation result. The URL to this interface should be * retrieved from 'Operation-Location' field returned from Recognize Text interface. * - * @param operationId Id of the text operation returned in the response of the 'Recognize Handwritten Text'. + * @param operationId Id of the text operation returned in the response of the 'Recognize Text'. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ComputerVisionErrorException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @@ -843,105 +776,39 @@ interface ComputerVisionAnalyzeImageInStreamDefinition extends * This interface is used for getting text operation result. The URL to this interface should be * retrieved from 'Operation-Location' field returned from Recognize Text interface. * - * @param operationId Id of the text operation returned in the response of the 'Recognize Handwritten Text'. + * @param operationId Id of the text operation returned in the response of the 'Recognize Text'. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the TextOperationResult object */ Observable getTextOperationResultAsync(String operationId); + /** - * Recognize Text operation. When you use the Recognize Text interface, the response contains a field called - * 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get - * Handwritten Text Operation Result operation. + * Recognize Text operation. When you use the Recognize Text interface, the response contains a field + * called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for + * your Get Recognize Text Operation Result operation. * + * @param mode Type of text to recognize. Possible values include: 'Handwritten', 'Printed'. * @param url Publicly reachable URL of an image. - * @param recognizeTextOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ComputerVisionErrorException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ - - void recognizeText(String url, RecognizeTextOptionalParameter recognizeTextOptionalParameter); + void recognizeText(String url, TextRecognitionMode mode); /** - * Recognize Text operation. When you use the Recognize Text interface, the response contains a field called - * 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get - * Handwritten Text Operation Result operation. + * Recognize Text operation. When you use the Recognize Text interface, the response contains a field + * called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for + * your Get Recognize Text Operation Result operation. * + * @param mode Type of text to recognize. Possible values include: 'Handwritten', 'Printed'. * @param url Publicly reachable URL of an image. - * @param recognizeTextOptionalParameter 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. */ - - Observable recognizeTextAsync(String url, RecognizeTextOptionalParameter recognizeTextOptionalParameter); - - /** - * Recognize Text operation. When you use the Recognize Text interface, the response contains a field called - * 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get - * Handwritten Text Operation Result operation. - * - * @return the first stage of the recognizeText call - */ - ComputerVisionRecognizeTextDefinitionStages.WithUrl recognizeText(); - - /** - * Grouping of recognizeText definition stages. - */ - interface ComputerVisionRecognizeTextDefinitionStages { - /** - * The stage of the definition to be specify url. - */ - interface WithUrl { - /** - * Publicly reachable URL of an image. - * - * @return next definition stage - */ - ComputerVisionRecognizeTextDefinitionStages.WithExecute withUrl(String url); - } + Observable recognizeTextAsync(String url, TextRecognitionMode mode); - /** - * The stage of the definition which allows for any other optional settings to be specified. - */ - interface WithAllOptions { - /** - * If 'true' is specified, handwriting recognition is performed. If this parameter is set to 'false' or is not - * specified, printed text recognition is performed. - * - * @return next definition stage - */ - ComputerVisionRecognizeTextDefinitionStages.WithExecute withDetectHandwriting(Boolean detectHandwriting); - - } - - /** - * The last stage of the definition which will make the operation call. - */ - interface WithExecute extends ComputerVisionRecognizeTextDefinitionStages.WithAllOptions { - /** - * Execute the request. - * - */ - void execute(); - - /** - * Execute the request asynchronously. - * - * @return a representation of the deferred computation of this call if successful. - */ - Observable executeAsync(); - } - } - - /** - * The entirety of recognizeText definition. - */ - interface ComputerVisionRecognizeTextDefinition extends - ComputerVisionRecognizeTextDefinitionStages.WithUrl, - ComputerVisionRecognizeTextDefinitionStages.WithExecute { - } /** * This operation recognizes content within an image by applying a domain-specific model. The list of @@ -959,7 +826,7 @@ interface ComputerVisionRecognizeTextDefinition extends * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the DomainModelResults object if successful. */ - + @Deprecated DomainModelResults analyzeImageByDomain(String model, String url, AnalyzeImageByDomainOptionalParameter analyzeImageByDomainOptionalParameter); /** @@ -976,7 +843,7 @@ interface ComputerVisionRecognizeTextDefinition extends * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DomainModelResults object */ - + @Deprecated Observable analyzeImageByDomainAsync(String model, String url, AnalyzeImageByDomainOptionalParameter analyzeImageByDomainOptionalParameter); /** @@ -1024,8 +891,8 @@ interface WithUrl { interface WithAllOptions { /** * The desired language for output generation. If this parameter is not specified, the default value is - * &quot;en&quot;.Supported languages:en - English, Default.ja - Japanese pt - Portuguese zh - - * Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh'. + * &quot;en&quot;.Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - + * Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', 'ja', 'pt', 'zh'. * * @return next definition stage */ @@ -1076,7 +943,7 @@ interface ComputerVisionAnalyzeImageByDomainDefinition extends * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the TagResult object if successful. */ - + @Deprecated TagResult tagImage(String url, TagImageOptionalParameter tagImageOptionalParameter); /** @@ -1091,7 +958,7 @@ interface ComputerVisionAnalyzeImageByDomainDefinition extends * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the TagResult object */ - + @Deprecated Observable tagImageAsync(String url, TagImageOptionalParameter tagImageOptionalParameter); /** @@ -1127,8 +994,8 @@ interface WithUrl { interface WithAllOptions { /** * The desired language for output generation. If this parameter is not specified, the default value is - * &quot;en&quot;.Supported languages:en - English, Default.ja - Japanese pt - Portuguese zh - - * Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh'. + * &quot;en&quot;.Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - + * Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', 'ja', 'pt', 'zh'. * * @return next definition stage */ @@ -1179,7 +1046,7 @@ interface ComputerVisionTagImageDefinition extends * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ImageDescription object if successful. */ - + @Deprecated ImageDescription describeImage(String url, DescribeImageOptionalParameter describeImageOptionalParameter); /** @@ -1195,7 +1062,7 @@ interface ComputerVisionTagImageDefinition extends * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ImageDescription object */ - + @Deprecated Observable describeImageAsync(String url, DescribeImageOptionalParameter describeImageOptionalParameter); /** @@ -1239,8 +1106,8 @@ interface WithAllOptions { /** * The desired language for output generation. If this parameter is not specified, the default value is - * &quot;en&quot;.Supported languages:en - English, Default.ja - Japanese pt - Portuguese zh - - * Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh'. + * &quot;en&quot;.Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - + * Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', 'ja', 'pt', 'zh'. * * @return next definition stage */ @@ -1291,7 +1158,7 @@ interface ComputerVisionDescribeImageDefinition extends * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the OcrResult object if successful. */ - + @Deprecated OcrResult recognizePrintedText(boolean detectOrientation, String url, RecognizePrintedTextOptionalParameter recognizePrintedTextOptionalParameter); /** @@ -1307,7 +1174,7 @@ interface ComputerVisionDescribeImageDefinition extends * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the OcrResult object */ - + @Deprecated Observable recognizePrintedTextAsync(boolean detectOrientation, String url, RecognizePrintedTextOptionalParameter recognizePrintedTextOptionalParameter); /** @@ -1408,7 +1275,7 @@ interface ComputerVisionRecognizePrintedTextDefinition extends * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the InputStream object if successful. */ - + @Deprecated InputStream generateThumbnail(int width, int height, String url, GenerateThumbnailOptionalParameter generateThumbnailOptionalParameter); /** @@ -1425,7 +1292,7 @@ interface ComputerVisionRecognizePrintedTextDefinition extends * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the InputStream object */ - + @Deprecated Observable generateThumbnailAsync(int width, int height, String url, GenerateThumbnailOptionalParameter generateThumbnailOptionalParameter); /** @@ -1533,7 +1400,7 @@ interface ComputerVisionGenerateThumbnailDefinition extends * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ImageAnalysis object if successful. */ - + @Deprecated ImageAnalysis analyzeImage(String url, AnalyzeImageOptionalParameter analyzeImageOptionalParameter); /** @@ -1547,7 +1414,7 @@ interface ComputerVisionGenerateThumbnailDefinition extends * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ImageAnalysis object */ - + @Deprecated Observable analyzeImageAsync(String url, AnalyzeImageOptionalParameter analyzeImageOptionalParameter); /** @@ -1604,8 +1471,8 @@ interface WithAllOptions { /** * The desired language for output generation. If this parameter is not specified, the default value is - * &quot;en&quot;.Supported languages:en - English, Default.ja - Japanese pt - Portuguese zh - - * Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh'. + * &quot;en&quot;.Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - + * Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', 'ja', 'pt', 'zh'. * * @return next definition stage */ diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/ComputerVisionAPI.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/ComputerVisionClient.java similarity index 68% rename from cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/ComputerVisionAPI.java rename to cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/ComputerVisionClient.java index ee57c7943c78..488e17359de4 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/ComputerVisionAPI.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/ComputerVisionClient.java @@ -9,13 +9,12 @@ package com.microsoft.azure.cognitiveservices.vision.computervision; import com.microsoft.azure.AzureClient; -import com.microsoft.azure.cognitiveservices.vision.computervision.models.AzureRegions; import com.microsoft.rest.RestClient; /** - * The interface for ComputerVisionAPI class. + * The interface for ComputerVisionClient class. */ -public interface ComputerVisionAPI { +public interface ComputerVisionClient { /** * Gets the REST client. * @@ -37,19 +36,19 @@ public interface ComputerVisionAPI { String userAgent(); /** - * Gets Supported Azure regions for Cognitive Services endpoints. Possible values include: 'westus', 'westeurope', 'southeastasia', 'eastus2', 'westcentralus', 'westus2', 'eastus', 'southcentralus', 'northeurope', 'eastasia', 'australiaeast', 'brazilsouth'. + * Gets Supported Cognitive Services endpoints. * - * @return the azureRegion value. + * @return the endpoint value. */ - AzureRegions azureRegion(); + String endpoint(); /** - * Sets Supported Azure regions for Cognitive Services endpoints. Possible values include: 'westus', 'westeurope', 'southeastasia', 'eastus2', 'westcentralus', 'westus2', 'eastus', 'southcentralus', 'northeurope', 'eastasia', 'australiaeast', 'brazilsouth'. + * Sets Supported Cognitive Services endpoints. * - * @param azureRegion the azureRegion value. + * @param endpoint the endpoint value. * @return the service client itself */ - ComputerVisionAPI withAzureRegion(AzureRegions azureRegion); + ComputerVisionClient withEndpoint(String endpoint); /** * Gets Gets or sets the preferred language for the response.. @@ -64,7 +63,7 @@ public interface ComputerVisionAPI { * @param acceptLanguage the acceptLanguage value. * @return the service client itself */ - ComputerVisionAPI withAcceptLanguage(String acceptLanguage); + ComputerVisionClient withAcceptLanguage(String acceptLanguage); /** * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. @@ -79,7 +78,7 @@ public interface ComputerVisionAPI { * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. * @return the service client itself */ - ComputerVisionAPI withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout); + ComputerVisionClient 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.. @@ -94,7 +93,7 @@ public interface ComputerVisionAPI { * @param generateClientRequestId the generateClientRequestId value. * @return the service client itself */ - ComputerVisionAPI withGenerateClientRequestId(boolean generateClientRequestId); + ComputerVisionClient withGenerateClientRequestId(boolean generateClientRequestId); /** * Gets the ComputerVision object to access its operations. diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/ComputerVisionManager.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/ComputerVisionManager.java index 6ed80f273437..f5a339218bed 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/ComputerVisionManager.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/ComputerVisionManager.java @@ -6,8 +6,7 @@ package com.microsoft.azure.cognitiveservices.vision.computervision; -import com.microsoft.azure.cognitiveservices.vision.computervision.implementation.ComputerVisionAPIImpl; -import com.microsoft.azure.cognitiveservices.vision.computervision.models.AzureRegions; +import com.microsoft.azure.cognitiveservices.vision.computervision.implementation.ComputerVisionClientImpl; import com.microsoft.rest.RestClient; import com.microsoft.rest.credentials.ServiceClientCredentials; import okhttp3.Interceptor; @@ -24,13 +23,11 @@ public class ComputerVisionManager { /** * Initializes an instance of Computer Vision API client. * - * @param region Supported Azure regions for Cognitive Services endpoints. * @param subscriptionKey the Computer Vision API key * @return the Computer Vision API client */ - public static ComputerVisionAPI authenticate(AzureRegions region, String subscriptionKey) { - return authenticate("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.0/", subscriptionKey) - .withAzureRegion(region); + public static ComputerVisionClient authenticate(String subscriptionKey) { + return authenticate("https://{endpoint}/vision/v2.0/", subscriptionKey); } /** @@ -40,7 +37,7 @@ public static ComputerVisionAPI authenticate(AzureRegions region, String subscri * @param subscriptionKey the Computer Vision API key * @return the Computer Vision API client */ - public static ComputerVisionAPI authenticate(String baseUrl, final String subscriptionKey) { + public static ComputerVisionClient authenticate(String baseUrl, final String subscriptionKey) { ServiceClientCredentials serviceClientCredentials = new ServiceClientCredentials() { @Override public void applyCredentialsFilter(OkHttpClient.Builder builder) { @@ -65,13 +62,13 @@ public Response intercept(Chain chain) throws IOException { /** * Initializes an instance of Computer Vision API client. * - * @param region Supported Azure regions for Cognitive Services endpoints. * @param credentials the management credentials for Azure + * @param endpoint Supported Cognitive Services endpoints. * @return the Computer Vision API client */ - public static ComputerVisionAPI authenticate(AzureRegions region, ServiceClientCredentials credentials) { - return authenticate("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.0/", credentials) - .withAzureRegion(region); + public static ComputerVisionClient authenticate(ServiceClientCredentials credentials, String endpoint) { + return authenticate("https://{endpoint}/vision/v2.0/", credentials) + .withEndpoint(endpoint); } /** @@ -81,8 +78,8 @@ public static ComputerVisionAPI authenticate(AzureRegions region, ServiceClientC * @param credentials the management credentials for Azure * @return the Computer Vision API client */ - public static ComputerVisionAPI authenticate(String baseUrl, ServiceClientCredentials credentials) { - return new ComputerVisionAPIImpl(baseUrl, credentials); + public static ComputerVisionClient authenticate(String baseUrl, ServiceClientCredentials credentials) { + return new ComputerVisionClientImpl(baseUrl, credentials); } /** @@ -91,7 +88,7 @@ public static ComputerVisionAPI authenticate(String baseUrl, ServiceClientCreden * @param restClient the REST client to connect to Azure. * @return the Computer Vision API client */ - public static ComputerVisionAPI authenticate(RestClient restClient) { - return new ComputerVisionAPIImpl(restClient); + public static ComputerVisionClient authenticate(RestClient restClient) { + return new ComputerVisionClientImpl(restClient); } } diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionAPIImpl.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionClientImpl.java similarity index 67% rename from cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionAPIImpl.java rename to cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionClientImpl.java index 78964fdd8475..24cd15950a4d 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionAPIImpl.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionClientImpl.java @@ -11,15 +11,14 @@ import com.microsoft.azure.AzureClient; import com.microsoft.azure.AzureServiceClient; import com.microsoft.azure.cognitiveservices.vision.computervision.ComputerVision; -import com.microsoft.azure.cognitiveservices.vision.computervision.ComputerVisionAPI; -import com.microsoft.azure.cognitiveservices.vision.computervision.models.AzureRegions; +import com.microsoft.azure.cognitiveservices.vision.computervision.ComputerVisionClient; import com.microsoft.rest.credentials.ServiceClientCredentials; import com.microsoft.rest.RestClient; /** - * Initializes a new instance of the ComputerVisionAPIImpl class. + * Initializes a new instance of the ComputerVisionClientImpl class. */ -public class ComputerVisionAPIImpl extends AzureServiceClient implements ComputerVisionAPI { +public class ComputerVisionClientImpl extends AzureServiceClient implements ComputerVisionClient { /** the {@link AzureClient} used for long running operations. */ private AzureClient azureClient; @@ -31,26 +30,26 @@ public AzureClient getAzureClient() { return this.azureClient; } - /** Supported Azure regions for Cognitive Services endpoints. Possible values include: 'westus', 'westeurope', 'southeastasia', 'eastus2', 'westcentralus', 'westus2', 'eastus', 'southcentralus', 'northeurope', 'eastasia', 'australiaeast', 'brazilsouth'. */ - private AzureRegions azureRegion; + /** Supported Cognitive Services endpoints. */ + private String endpoint; /** - * Gets Supported Azure regions for Cognitive Services endpoints. Possible values include: 'westus', 'westeurope', 'southeastasia', 'eastus2', 'westcentralus', 'westus2', 'eastus', 'southcentralus', 'northeurope', 'eastasia', 'australiaeast', 'brazilsouth'. + * Gets Supported Cognitive Services endpoints. * - * @return the azureRegion value. + * @return the endpoint value. */ - public AzureRegions azureRegion() { - return this.azureRegion; + public String endpoint() { + return this.endpoint; } /** - * Sets Supported Azure regions for Cognitive Services endpoints. Possible values include: 'westus', 'westeurope', 'southeastasia', 'eastus2', 'westcentralus', 'westus2', 'eastus', 'southcentralus', 'northeurope', 'eastasia', 'australiaeast', 'brazilsouth'. + * Sets Supported Cognitive Services endpoints. * - * @param azureRegion the azureRegion value. + * @param endpoint the endpoint value. * @return the service client itself */ - public ComputerVisionAPIImpl withAzureRegion(AzureRegions azureRegion) { - this.azureRegion = azureRegion; + public ComputerVisionClientImpl withEndpoint(String endpoint) { + this.endpoint = endpoint; return this; } @@ -72,7 +71,7 @@ public String acceptLanguage() { * @param acceptLanguage the acceptLanguage value. * @return the service client itself */ - public ComputerVisionAPIImpl withAcceptLanguage(String acceptLanguage) { + public ComputerVisionClientImpl withAcceptLanguage(String acceptLanguage) { this.acceptLanguage = acceptLanguage; return this; } @@ -95,7 +94,7 @@ public int longRunningOperationRetryTimeout() { * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. * @return the service client itself */ - public ComputerVisionAPIImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + public ComputerVisionClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; return this; } @@ -118,7 +117,7 @@ public boolean generateClientRequestId() { * @param generateClientRequestId the generateClientRequestId value. * @return the service client itself */ - public ComputerVisionAPIImpl withGenerateClientRequestId(boolean generateClientRequestId) { + public ComputerVisionClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { this.generateClientRequestId = generateClientRequestId; return this; } @@ -137,31 +136,31 @@ public ComputerVision computerVision() { } /** - * Initializes an instance of ComputerVisionAPI client. + * Initializes an instance of ComputerVisionClient client. * * @param credentials the management credentials for Azure */ - public ComputerVisionAPIImpl(ServiceClientCredentials credentials) { - this("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.0", credentials); + public ComputerVisionClientImpl(ServiceClientCredentials credentials) { + this("https://{Endpoint}/vision/v2.0", credentials); } /** - * Initializes an instance of ComputerVisionAPI client. + * Initializes an instance of ComputerVisionClient client. * * @param baseUrl the base URL of the host * @param credentials the management credentials for Azure */ - public ComputerVisionAPIImpl(String baseUrl, ServiceClientCredentials credentials) { + public ComputerVisionClientImpl(String baseUrl, ServiceClientCredentials credentials) { super(baseUrl, credentials); initialize(); } /** - * Initializes an instance of ComputerVisionAPI client. + * Initializes an instance of ComputerVisionClient client. * * @param restClient the REST client to connect to Azure. */ - public ComputerVisionAPIImpl(RestClient restClient) { + public ComputerVisionClientImpl(RestClient restClient) { super(restClient); initialize(); } @@ -181,6 +180,6 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "ComputerVisionAPI", "1.0"); + return String.format("%s (%s, %s)", super.userAgent(), "ComputerVisionClient", "2.0"); } } diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java index 6b05defde602..4dac231fbe27 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java @@ -8,14 +8,12 @@ package com.microsoft.azure.cognitiveservices.vision.computervision.implementation; -import com.microsoft.azure.cognitiveservices.vision.computervision.models.RecognizeTextInStreamOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.computervision.models.AnalyzeImageByDomainInStreamOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.computervision.models.TagImageInStreamOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.computervision.models.DescribeImageInStreamOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.computervision.models.RecognizePrintedTextInStreamOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.computervision.models.GenerateThumbnailInStreamOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.computervision.models.AnalyzeImageInStreamOptionalParameter; -import com.microsoft.azure.cognitiveservices.vision.computervision.models.RecognizeTextOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.computervision.models.AnalyzeImageByDomainOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.computervision.models.TagImageOptionalParameter; import com.microsoft.azure.cognitiveservices.vision.computervision.models.DescribeImageOptionalParameter; @@ -40,6 +38,7 @@ import com.microsoft.azure.cognitiveservices.vision.computervision.models.RecognizeTextInStreamHeaders; import com.microsoft.azure.cognitiveservices.vision.computervision.models.TagResult; import com.microsoft.azure.cognitiveservices.vision.computervision.models.TextOperationResult; +import com.microsoft.azure.cognitiveservices.vision.computervision.models.TextRecognitionMode; import com.microsoft.azure.cognitiveservices.vision.computervision.models.VisualFeatureTypes; import com.microsoft.rest.CollectionFormat; import com.microsoft.rest.ServiceCallback; @@ -73,7 +72,7 @@ public class ComputerVisionImpl implements ComputerVision { /** The Retrofit service to perform REST calls. */ private ComputerVisionService service; /** The service client containing this operation class. */ - private ComputerVisionAPIImpl client; + private ComputerVisionClientImpl client; /** * Initializes an instance of ComputerVisionImpl. @@ -81,7 +80,7 @@ public class ComputerVisionImpl implements ComputerVision { * @param retrofit the Retrofit instance built from a Retrofit Builder. * @param client the instance of the service client containing this operation class. */ - public ComputerVisionImpl(Retrofit retrofit, ComputerVisionAPIImpl client) { + public ComputerVisionImpl(Retrofit retrofit, ComputerVisionClientImpl client) { this.service = retrofit.create(ComputerVisionService.class); this.client = client; } @@ -93,7 +92,7 @@ public ComputerVisionImpl(Retrofit retrofit, ComputerVisionAPIImpl client) { interface ComputerVisionService { @Headers({ "Content-Type: application/octet-stream", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.computervision.ComputerVision recognizeTextInStream" }) @POST("recognizeText") - Observable> recognizeTextInStream(@Query("detectHandwriting") Boolean detectHandwriting, @Body RequestBody image, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + Observable> recognizeTextInStream(@Body RequestBody image, @Query("mode") TextRecognitionMode mode, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/octet-stream", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.computervision.ComputerVision analyzeImageByDomainInStream" }) @POST("models/{model}/analyze") @@ -126,7 +125,7 @@ interface ComputerVisionService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.vision.computervision.ComputerVision recognizeText" }) @POST("recognizeText") - Observable> recognizeText(@Query("detectHandwriting") Boolean detectHandwriting, @Header("accept-language") String acceptLanguage, @Body ImageUrl imageUrl, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + Observable> recognizeText(@Query("mode") TextRecognitionMode mode, @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.computervision.ComputerVision analyzeImageByDomain" }) @POST("models/{model}/analyze") @@ -159,43 +158,42 @@ interface ComputerVisionService { } - /** - * Recognize Text operation. When you use the Recognize Text interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get Handwritten Text Operation Result operation. + * Recognize Text operation. When you use the Recognize Text interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get Recognize Text Operation Result operation. * * @param image An image stream. - * @param recognizeTextInStreamOptionalParameter the object representing the optional parameters to be set before calling this API + * @param mode Type of text to recognize. Possible values include: 'Handwritten', 'Printed' * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ComputerVisionErrorException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ - public void recognizeTextInStream(byte[] image, RecognizeTextInStreamOptionalParameter recognizeTextInStreamOptionalParameter) { - recognizeTextInStreamWithServiceResponseAsync(image, recognizeTextInStreamOptionalParameter).toBlocking().single().body(); + public void recognizeTextInStream(byte[] image, TextRecognitionMode mode) { + recognizeTextInStreamWithServiceResponseAsync(image, mode).toBlocking().single().body(); } /** - * Recognize Text operation. When you use the Recognize Text interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get Handwritten Text Operation Result operation. + * Recognize Text operation. When you use the Recognize Text interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get Recognize Text Operation Result operation. * * @param image An image stream. - * @param recognizeTextInStreamOptionalParameter the object representing the optional parameters to be set before calling this API + * @param mode Type of text to recognize. Possible values include: 'Handwritten', 'Printed' * @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 recognizeTextInStreamAsync(byte[] image, RecognizeTextInStreamOptionalParameter recognizeTextInStreamOptionalParameter, final ServiceCallback serviceCallback) { - return ServiceFuture.fromHeaderResponse(recognizeTextInStreamWithServiceResponseAsync(image, recognizeTextInStreamOptionalParameter), serviceCallback); + public ServiceFuture recognizeTextInStreamAsync(byte[] image, TextRecognitionMode mode, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(recognizeTextInStreamWithServiceResponseAsync(image, mode), serviceCallback); } /** - * Recognize Text operation. When you use the Recognize Text interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get Handwritten Text Operation Result operation. + * Recognize Text operation. When you use the Recognize Text interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get Recognize Text Operation Result operation. * * @param image An image stream. - * @param recognizeTextInStreamOptionalParameter the object representing the optional parameters to be set before calling this API + * @param mode Type of text to recognize. Possible values include: 'Handwritten', 'Printed' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponseWithHeaders} object if successful. */ - public Observable recognizeTextInStreamAsync(byte[] image, RecognizeTextInStreamOptionalParameter recognizeTextInStreamOptionalParameter) { - return recognizeTextInStreamWithServiceResponseAsync(image, recognizeTextInStreamOptionalParameter).map(new Func1, Void>() { + public Observable recognizeTextInStreamAsync(byte[] image, TextRecognitionMode mode) { + return recognizeTextInStreamWithServiceResponseAsync(image, mode).map(new Func1, Void>() { @Override public Void call(ServiceResponseWithHeaders response) { return response.body(); @@ -204,43 +202,26 @@ public Void call(ServiceResponseWithHeaders } /** - * Recognize Text operation. When you use the Recognize Text interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get Handwritten Text Operation Result operation. + * Recognize Text operation. When you use the Recognize Text interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get Recognize Text Operation Result operation. * * @param image An image stream. - * @param recognizeTextInStreamOptionalParameter the object representing the optional parameters to be set before calling this API + * @param mode Type of text to recognize. Possible values include: 'Handwritten', 'Printed' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponseWithHeaders} object if successful. */ - public Observable> recognizeTextInStreamWithServiceResponseAsync(byte[] image, RecognizeTextInStreamOptionalParameter recognizeTextInStreamOptionalParameter) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); + public Observable> recognizeTextInStreamWithServiceResponseAsync(byte[] image, TextRecognitionMode mode) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (image == null) { throw new IllegalArgumentException("Parameter image is required and cannot be null."); } - final Boolean detectHandwriting = recognizeTextInStreamOptionalParameter != null ? recognizeTextInStreamOptionalParameter.detectHandwriting() : null; - - return recognizeTextInStreamWithServiceResponseAsync(image, detectHandwriting); - } - - /** - * Recognize Text operation. When you use the Recognize Text interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get Handwritten Text Operation Result operation. - * - * @param image An image stream. - * @param detectHandwriting If 'true' is specified, handwriting recognition is performed. If this parameter is set to 'false' or is not specified, printed text recognition is performed. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponseWithHeaders} object if successful. - */ - public Observable> recognizeTextInStreamWithServiceResponseAsync(byte[] image, Boolean detectHandwriting) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); - } - if (image == null) { - throw new IllegalArgumentException("Parameter image is required and cannot be null."); + if (mode == null) { + throw new IllegalArgumentException("Parameter mode is required and cannot be null."); } - String parameterizedHost = Joiner.on(", ").join("{AzureRegion}", this.client.azureRegion()); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); RequestBody imageConverted = RequestBody.create(MediaType.parse("application/octet-stream"), image); - return service.recognizeTextInStream(detectHandwriting, imageConverted, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + return service.recognizeTextInStream(imageConverted, mode, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -261,55 +242,6 @@ private ServiceResponseWithHeaders recognize .buildWithHeaders(response, RecognizeTextInStreamHeaders.class); } - @Override - public ComputerVisionRecognizeTextInStreamParameters recognizeTextInStream() { - return new ComputerVisionRecognizeTextInStreamParameters(this); - } - - /** - * Internal class implementing ComputerVisionRecognizeTextInStreamDefinition. - */ - class ComputerVisionRecognizeTextInStreamParameters implements ComputerVisionRecognizeTextInStreamDefinition { - private ComputerVisionImpl parent; - private byte[] image; - private Boolean detectHandwriting; - - /** - * Constructor. - * @param parent the parent object. - */ - ComputerVisionRecognizeTextInStreamParameters(ComputerVisionImpl parent) { - this.parent = parent; - } - - @Override - public ComputerVisionRecognizeTextInStreamParameters withImage(byte[] image) { - this.image = image; - return this; - } - - @Override - public ComputerVisionRecognizeTextInStreamParameters withDetectHandwriting(Boolean detectHandwriting) { - this.detectHandwriting = detectHandwriting; - return this; - } - - @Override - public void execute() { - recognizeTextInStreamWithServiceResponseAsync(image, detectHandwriting).toBlocking().single().body(); - } - - @Override - public Observable executeAsync() { - return recognizeTextInStreamWithServiceResponseAsync(image, detectHandwriting).map(new Func1, Void>() { - @Override - public Void call(ServiceResponseWithHeaders response) { - return response.body(); - } - }); - } - } - /** * This operation recognizes content within an image by applying a domain-specific model. The list of domain-specific models that are supported by the Computer Vision API can be retrieved using the /models GET request. Currently, the API only provides a single domain-specific model: celebrities. Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. A successful response will be returned in JSON. If the request failed, the response will contain an error code and a message to help understand what went wrong. @@ -368,8 +300,8 @@ public DomainModelResults call(ServiceResponse response) { * @return the observable to the DomainModelResults object */ public Observable> analyzeImageByDomainInStreamWithServiceResponseAsync(String model, byte[] image, AnalyzeImageByDomainInStreamOptionalParameter analyzeImageByDomainInStreamOptionalParameter) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (model == null) { throw new IllegalArgumentException("Parameter model is required and cannot be null."); @@ -387,13 +319,13 @@ public Observable> analyzeImageByDomainInStr * * @param model The domain-specific content to recognize. * @param image An image stream. - * @param language The desired language for output generation. If this parameter is not specified, the default value is &quot;en&quot;.Supported languages:en - English, Default.ja - Japanese pt - Portuguese zh - Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh' + * @param language The desired language for output generation. If this parameter is not specified, the default value is &quot;en&quot;.Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', 'ja', 'pt', 'zh' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DomainModelResults object */ public Observable> analyzeImageByDomainInStreamWithServiceResponseAsync(String model, byte[] image, String language) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (model == null) { throw new IllegalArgumentException("Parameter model is required and cannot be null."); @@ -401,7 +333,7 @@ public Observable> analyzeImageByDomainInStr if (image == null) { throw new IllegalArgumentException("Parameter image is required and cannot be null."); } - String parameterizedHost = Joiner.on(", ").join("{AzureRegion}", this.client.azureRegion()); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); RequestBody imageConverted = RequestBody.create(MediaType.parse("application/octet-stream"), image); return service.analyzeImageByDomainInStream(model, language, imageConverted, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @@ -534,8 +466,8 @@ public TagResult call(ServiceResponse response) { * @return the observable to the TagResult object */ public Observable> tagImageInStreamWithServiceResponseAsync(byte[] image, TagImageInStreamOptionalParameter tagImageInStreamOptionalParameter) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (image == null) { throw new IllegalArgumentException("Parameter image is required and cannot be null."); @@ -549,18 +481,18 @@ public Observable> tagImageInStreamWithServiceRespons * This operation generates a list of words, or tags, that are relevant to the content of the supplied image. The Computer Vision API can return tags based on objects, living beings, scenery or actions found in images. Unlike categories, tags are not organized according to a hierarchical classification system, but correspond to image content. Tags may contain hints to avoid ambiguity or provide context, for example the tag 'cello' may be accompanied by the hint 'musical instrument'. All tags are in English. * * @param image An image stream. - * @param language The desired language for output generation. If this parameter is not specified, the default value is &quot;en&quot;.Supported languages:en - English, Default.ja - Japanese pt - Portuguese zh - Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh' + * @param language The desired language for output generation. If this parameter is not specified, the default value is &quot;en&quot;.Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', 'ja', 'pt', 'zh' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the TagResult object */ public Observable> tagImageInStreamWithServiceResponseAsync(byte[] image, String language) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (image == null) { throw new IllegalArgumentException("Parameter image is required and cannot be null."); } - String parameterizedHost = Joiner.on(", ").join("{AzureRegion}", this.client.azureRegion()); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); RequestBody imageConverted = RequestBody.create(MediaType.parse("application/octet-stream"), image); return service.tagImageInStream(language, imageConverted, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @@ -686,8 +618,8 @@ public ImageDescription call(ServiceResponse response) { * @return the observable to the ImageDescription object */ public Observable> describeImageInStreamWithServiceResponseAsync(byte[] image, DescribeImageInStreamOptionalParameter describeImageInStreamOptionalParameter) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (image == null) { throw new IllegalArgumentException("Parameter image is required and cannot be null."); @@ -703,18 +635,18 @@ public Observable> describeImageInStreamWithSe * * @param image An image stream. * @param maxCandidates Maximum number of candidate descriptions to be returned. The default is 1. - * @param language The desired language for output generation. If this parameter is not specified, the default value is &quot;en&quot;.Supported languages:en - English, Default.ja - Japanese pt - Portuguese zh - Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh' + * @param language The desired language for output generation. If this parameter is not specified, the default value is &quot;en&quot;.Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', 'ja', 'pt', 'zh' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ImageDescription object */ public Observable> describeImageInStreamWithServiceResponseAsync(byte[] image, String maxCandidates, String language) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (image == null) { throw new IllegalArgumentException("Parameter image is required and cannot be null."); } - String parameterizedHost = Joiner.on(", ").join("{AzureRegion}", this.client.azureRegion()); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); RequestBody imageConverted = RequestBody.create(MediaType.parse("application/octet-stream"), image); return service.describeImageInStream(maxCandidates, language, imageConverted, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @@ -851,8 +783,8 @@ public OcrResult call(ServiceResponse response) { * @return the observable to the OcrResult object */ public Observable> recognizePrintedTextInStreamWithServiceResponseAsync(boolean detectOrientation, byte[] image, RecognizePrintedTextInStreamOptionalParameter recognizePrintedTextInStreamOptionalParameter) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (image == null) { throw new IllegalArgumentException("Parameter image is required and cannot be null."); @@ -872,13 +804,13 @@ public Observable> recognizePrintedTextInStreamWithSe * @return the observable to the OcrResult object */ public Observable> recognizePrintedTextInStreamWithServiceResponseAsync(boolean detectOrientation, byte[] image, OcrLanguages language) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (image == null) { throw new IllegalArgumentException("Parameter image is required and cannot be null."); } - String parameterizedHost = Joiner.on(", ").join("{AzureRegion}", this.client.azureRegion()); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); RequestBody imageConverted = RequestBody.create(MediaType.parse("application/octet-stream"), image); return service.recognizePrintedTextInStream(language, detectOrientation, imageConverted, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @@ -1019,8 +951,8 @@ public InputStream call(ServiceResponse response) { * @return the observable to the InputStream object */ public Observable> generateThumbnailInStreamWithServiceResponseAsync(int width, int height, byte[] image, GenerateThumbnailInStreamOptionalParameter generateThumbnailInStreamOptionalParameter) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (image == null) { throw new IllegalArgumentException("Parameter image is required and cannot be null."); @@ -1041,13 +973,13 @@ public Observable> generateThumbnailInStreamWithSer * @return the observable to the InputStream object */ public Observable> generateThumbnailInStreamWithServiceResponseAsync(int width, int height, byte[] image, Boolean smartCropping) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (image == null) { throw new IllegalArgumentException("Parameter image is required and cannot be null."); } - String parameterizedHost = Joiner.on(", ").join("{AzureRegion}", this.client.azureRegion()); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); RequestBody imageConverted = RequestBody.create(MediaType.parse("application/octet-stream"), image); return service.generateThumbnailInStream(width, height, imageConverted, smartCropping, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @@ -1187,8 +1119,8 @@ public ImageAnalysis call(ServiceResponse response) { * @return the observable to the ImageAnalysis object */ public Observable> analyzeImageInStreamWithServiceResponseAsync(byte[] image, AnalyzeImageInStreamOptionalParameter analyzeImageInStreamOptionalParameter) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (image == null) { throw new IllegalArgumentException("Parameter image is required and cannot be null."); @@ -1206,19 +1138,19 @@ public Observable> analyzeImageInStreamWithServic * @param image An image stream. * @param visualFeatures A string indicating what visual feature types to return. Multiple values should be comma-separated. Valid visual feature types include:Categories - categorizes image content according to a taxonomy defined in documentation. Tags - tags the image with a detailed list of words related to the image content. Description - describes the image content with a complete English sentence. Faces - detects if faces are present. If present, generate coordinates, gender and age. ImageType - detects if image is clipart or a line drawing. Color - determines the accent color, dominant color, and whether an image is black&white.Adult - detects if the image is pornographic in nature (depicts nudity or a sex act). Sexually suggestive content is also detected. * @param details A string indicating which domain-specific details to return. Multiple values should be comma-separated. Valid visual feature types include:Celebrities - identifies celebrities if detected in the image. Possible values include: 'Celebrities', 'Landmarks' - * @param language The desired language for output generation. If this parameter is not specified, the default value is &quot;en&quot;.Supported languages:en - English, Default.ja - Japanese pt - Portuguese zh - Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh' + * @param language The desired language for output generation. If this parameter is not specified, the default value is &quot;en&quot;.Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', 'ja', 'pt', 'zh' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ImageAnalysis object */ public Observable> analyzeImageInStreamWithServiceResponseAsync(byte[] image, List visualFeatures, String details, String language) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (image == null) { throw new IllegalArgumentException("Parameter image is required and cannot be null."); } Validator.validate(visualFeatures); - String parameterizedHost = Joiner.on(", ").join("{AzureRegion}", this.client.azureRegion()); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); String visualFeaturesConverted = this.client.serializerAdapter().serializeList(visualFeatures, CollectionFormat.CSV); RequestBody imageConverted = RequestBody.create(MediaType.parse("application/octet-stream"), image); return service.analyzeImageInStream(visualFeaturesConverted, details, language, imageConverted, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) @@ -1308,7 +1240,7 @@ public ImageAnalysis call(ServiceResponse response) { /** * This interface is used for getting text operation result. The URL to this interface should be retrieved from 'Operation-Location' field returned from Recognize Text interface. * - * @param operationId Id of the text operation returned in the response of the 'Recognize Handwritten Text' + * @param operationId Id of the text operation returned in the response of the 'Recognize Text' * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ComputerVisionErrorException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @@ -1321,7 +1253,7 @@ public TextOperationResult getTextOperationResult(String operationId) { /** * This interface is used for getting text operation result. The URL to this interface should be retrieved from 'Operation-Location' field returned from Recognize Text interface. * - * @param operationId Id of the text operation returned in the response of the 'Recognize Handwritten Text' + * @param operationId Id of the text operation returned in the response of the 'Recognize Text' * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object @@ -1333,7 +1265,7 @@ public ServiceFuture getTextOperationResultAsync(String ope /** * This interface is used for getting text operation result. The URL to this interface should be retrieved from 'Operation-Location' field returned from Recognize Text interface. * - * @param operationId Id of the text operation returned in the response of the 'Recognize Handwritten Text' + * @param operationId Id of the text operation returned in the response of the 'Recognize Text' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the TextOperationResult object */ @@ -1349,18 +1281,18 @@ public TextOperationResult call(ServiceResponse response) { /** * This interface is used for getting text operation result. The URL to this interface should be retrieved from 'Operation-Location' field returned from Recognize Text interface. * - * @param operationId Id of the text operation returned in the response of the 'Recognize Handwritten Text' + * @param operationId Id of the text operation returned in the response of the 'Recognize Text' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the TextOperationResult object */ public Observable> getTextOperationResultWithServiceResponseAsync(String operationId) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (operationId == null) { throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); } - String parameterizedHost = Joiner.on(", ").join("{AzureRegion}", this.client.azureRegion()); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); return service.getTextOperationResult(operationId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -1382,43 +1314,42 @@ private ServiceResponse getTextOperationResultDelegate(Resp .build(response); } - /** - * Recognize Text operation. When you use the Recognize Text interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get Handwritten Text Operation Result operation. + * Recognize Text operation. When you use the Recognize Text interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get Recognize Text Operation Result operation. * + * @param mode Type of text to recognize. Possible values include: 'Handwritten', 'Printed' * @param url Publicly reachable URL of an image - * @param recognizeTextOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ComputerVisionErrorException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ - public void recognizeText(String url, RecognizeTextOptionalParameter recognizeTextOptionalParameter) { - recognizeTextWithServiceResponseAsync(url, recognizeTextOptionalParameter).toBlocking().single().body(); + public void recognizeText(String url, TextRecognitionMode mode) { + recognizeTextWithServiceResponseAsync(url, mode).toBlocking().single().body(); } /** - * Recognize Text operation. When you use the Recognize Text interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get Handwritten Text Operation Result operation. + * Recognize Text operation. When you use the Recognize Text interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get Recognize Text Operation Result operation. * + * @param mode Type of text to recognize. Possible values include: 'Handwritten', 'Printed' * @param url Publicly reachable URL of an image - * @param recognizeTextOptionalParameter 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 recognizeTextAsync(String url, RecognizeTextOptionalParameter recognizeTextOptionalParameter, final ServiceCallback serviceCallback) { - return ServiceFuture.fromHeaderResponse(recognizeTextWithServiceResponseAsync(url, recognizeTextOptionalParameter), serviceCallback); + public ServiceFuture recognizeTextAsync(String url, TextRecognitionMode mode, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(recognizeTextWithServiceResponseAsync(url, mode), serviceCallback); } /** - * Recognize Text operation. When you use the Recognize Text interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get Handwritten Text Operation Result operation. + * Recognize Text operation. When you use the Recognize Text interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get Recognize Text Operation Result operation. * + * @param mode Type of text to recognize. Possible values include: 'Handwritten', 'Printed' * @param url Publicly reachable URL of an image - * @param recognizeTextOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponseWithHeaders} object if successful. */ - public Observable recognizeTextAsync(String url, RecognizeTextOptionalParameter recognizeTextOptionalParameter) { - return recognizeTextWithServiceResponseAsync(url, recognizeTextOptionalParameter).map(new Func1, Void>() { + public Observable recognizeTextAsync(String url, TextRecognitionMode mode) { + return recognizeTextWithServiceResponseAsync(url, mode).map(new Func1, Void>() { @Override public Void call(ServiceResponseWithHeaders response) { return response.body(); @@ -1427,44 +1358,27 @@ public Void call(ServiceResponseWithHeaders response } /** - * Recognize Text operation. When you use the Recognize Text interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get Handwritten Text Operation Result operation. + * Recognize Text operation. When you use the Recognize Text interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get Recognize Text Operation Result operation. * + * @param mode Type of text to recognize. Possible values include: 'Handwritten', 'Printed' * @param url Publicly reachable URL of an image - * @param recognizeTextOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponseWithHeaders} object if successful. */ - public Observable> recognizeTextWithServiceResponseAsync(String url, RecognizeTextOptionalParameter recognizeTextOptionalParameter) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); - } - if (url == null) { - throw new IllegalArgumentException("Parameter url is required and cannot be null."); + public Observable> recognizeTextWithServiceResponseAsync(String url, TextRecognitionMode mode) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } - final Boolean detectHandwriting = recognizeTextOptionalParameter != null ? recognizeTextOptionalParameter.detectHandwriting() : null; - - return recognizeTextWithServiceResponseAsync(url, detectHandwriting); - } - - /** - * Recognize Text operation. When you use the Recognize Text interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get Handwritten Text Operation Result operation. - * - * @param url Publicly reachable URL of an image - * @param detectHandwriting If 'true' is specified, handwriting recognition is performed. If this parameter is set to 'false' or is not specified, printed text recognition is performed. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponseWithHeaders} object if successful. - */ - public Observable> recognizeTextWithServiceResponseAsync(String url, Boolean detectHandwriting) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); + if (mode == null) { + throw new IllegalArgumentException("Parameter mode 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("{AzureRegion}", this.client.azureRegion()); - return service.recognizeText(detectHandwriting, this.client.acceptLanguage(), imageUrl, parameterizedHost, this.client.userAgent()) + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.recognizeText(mode, this.client.acceptLanguage(), imageUrl, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -1485,55 +1399,6 @@ private ServiceResponseWithHeaders recognizeTextDele .buildWithHeaders(response, RecognizeTextHeaders.class); } - @Override - public ComputerVisionRecognizeTextParameters recognizeText() { - return new ComputerVisionRecognizeTextParameters(this); - } - - /** - * Internal class implementing ComputerVisionRecognizeTextDefinition. - */ - class ComputerVisionRecognizeTextParameters implements ComputerVisionRecognizeTextDefinition { - private ComputerVisionImpl parent; - private String url; - private Boolean detectHandwriting; - - /** - * Constructor. - * @param parent the parent object. - */ - ComputerVisionRecognizeTextParameters(ComputerVisionImpl parent) { - this.parent = parent; - } - - @Override - public ComputerVisionRecognizeTextParameters withUrl(String url) { - this.url = url; - return this; - } - - @Override - public ComputerVisionRecognizeTextParameters withDetectHandwriting(Boolean detectHandwriting) { - this.detectHandwriting = detectHandwriting; - return this; - } - - @Override - public void execute() { - recognizeTextWithServiceResponseAsync(url, detectHandwriting).toBlocking().single().body(); - } - - @Override - public Observable executeAsync() { - return recognizeTextWithServiceResponseAsync(url, detectHandwriting).map(new Func1, Void>() { - @Override - public Void call(ServiceResponseWithHeaders response) { - return response.body(); - } - }); - } - } - /** * This operation recognizes content within an image by applying a domain-specific model. The list of domain-specific models that are supported by the Computer Vision API can be retrieved using the /models GET request. Currently, the API only provides a single domain-specific model: celebrities. Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. A successful response will be returned in JSON. If the request failed, the response will contain an error code and a message to help understand what went wrong. @@ -1592,8 +1457,8 @@ public DomainModelResults call(ServiceResponse response) { * @return the observable to the DomainModelResults object */ public Observable> analyzeImageByDomainWithServiceResponseAsync(String model, String url, AnalyzeImageByDomainOptionalParameter analyzeImageByDomainOptionalParameter) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (model == null) { throw new IllegalArgumentException("Parameter model is required and cannot be null."); @@ -1611,13 +1476,13 @@ public Observable> analyzeImageByDomainWithS * * @param model The domain-specific content to recognize. * @param url Publicly reachable URL of an image - * @param language The desired language for output generation. If this parameter is not specified, the default value is &quot;en&quot;.Supported languages:en - English, Default.ja - Japanese pt - Portuguese zh - Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh' + * @param language The desired language for output generation. If this parameter is not specified, the default value is &quot;en&quot;.Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', 'ja', 'pt', 'zh' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DomainModelResults object */ public Observable> analyzeImageByDomainWithServiceResponseAsync(String model, String url, String language) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (model == null) { throw new IllegalArgumentException("Parameter model is required and cannot be null."); @@ -1627,7 +1492,7 @@ public Observable> analyzeImageByDomainWithS } ImageUrl imageUrl = new ImageUrl(); imageUrl.withUrl(url); - String parameterizedHost = Joiner.on(", ").join("{AzureRegion}", this.client.azureRegion()); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); return service.analyzeImageByDomain(model, language, this.client.acceptLanguage(), imageUrl, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -1759,8 +1624,8 @@ public TagResult call(ServiceResponse response) { * @return the observable to the TagResult object */ public Observable> tagImageWithServiceResponseAsync(String url, TagImageOptionalParameter tagImageOptionalParameter) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (url == null) { throw new IllegalArgumentException("Parameter url is required and cannot be null."); @@ -1774,20 +1639,20 @@ public Observable> tagImageWithServiceResponseAsync(S * This operation generates a list of words, or tags, that are relevant to the content of the supplied image. The Computer Vision API can return tags based on objects, living beings, scenery or actions found in images. Unlike categories, tags are not organized according to a hierarchical classification system, but correspond to image content. Tags may contain hints to avoid ambiguity or provide context, for example the tag 'cello' may be accompanied by the hint 'musical instrument'. All tags are in English. * * @param url Publicly reachable URL of an image - * @param language The desired language for output generation. If this parameter is not specified, the default value is &quot;en&quot;.Supported languages:en - English, Default.ja - Japanese pt - Portuguese zh - Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh' + * @param language The desired language for output generation. If this parameter is not specified, the default value is &quot;en&quot;.Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', 'ja', 'pt', 'zh' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the TagResult object */ public Observable> tagImageWithServiceResponseAsync(String url, String language) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() 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("{AzureRegion}", this.client.azureRegion()); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); return service.tagImage(language, this.client.acceptLanguage(), imageUrl, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -1912,8 +1777,8 @@ public ImageDescription call(ServiceResponse response) { * @return the observable to the ImageDescription object */ public Observable> describeImageWithServiceResponseAsync(String url, DescribeImageOptionalParameter describeImageOptionalParameter) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (url == null) { throw new IllegalArgumentException("Parameter url is required and cannot be null."); @@ -1929,20 +1794,20 @@ public Observable> describeImageWithServiceRes * * @param url Publicly reachable URL of an image * @param maxCandidates Maximum number of candidate descriptions to be returned. The default is 1. - * @param language The desired language for output generation. If this parameter is not specified, the default value is &quot;en&quot;.Supported languages:en - English, Default.ja - Japanese pt - Portuguese zh - Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh' + * @param language The desired language for output generation. If this parameter is not specified, the default value is &quot;en&quot;.Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', 'ja', 'pt', 'zh' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ImageDescription object */ public Observable> describeImageWithServiceResponseAsync(String url, String maxCandidates, String language) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() 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("{AzureRegion}", this.client.azureRegion()); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); return service.describeImage(maxCandidates, language, this.client.acceptLanguage(), imageUrl, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -2078,8 +1943,8 @@ public OcrResult call(ServiceResponse response) { * @return the observable to the OcrResult object */ public Observable> recognizePrintedTextWithServiceResponseAsync(boolean detectOrientation, String url, RecognizePrintedTextOptionalParameter recognizePrintedTextOptionalParameter) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (url == null) { throw new IllegalArgumentException("Parameter url is required and cannot be null."); @@ -2099,15 +1964,15 @@ public Observable> recognizePrintedTextWithServiceRes * @return the observable to the OcrResult object */ public Observable> recognizePrintedTextWithServiceResponseAsync(boolean detectOrientation, String url, OcrLanguages language) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() 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("{AzureRegion}", this.client.azureRegion()); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); return service.recognizePrintedText(detectOrientation, language, this.client.acceptLanguage(), imageUrl, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -2247,8 +2112,8 @@ public InputStream call(ServiceResponse response) { * @return the observable to the InputStream object */ public Observable> generateThumbnailWithServiceResponseAsync(int width, int height, String url, GenerateThumbnailOptionalParameter generateThumbnailOptionalParameter) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (url == null) { throw new IllegalArgumentException("Parameter url is required and cannot be null."); @@ -2269,15 +2134,15 @@ public Observable> generateThumbnailWithServiceResp * @return the observable to the InputStream object */ public Observable> generateThumbnailWithServiceResponseAsync(int width, int height, String url, Boolean smartCropping) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() 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("{AzureRegion}", this.client.azureRegion()); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); return service.generateThumbnail(width, height, smartCropping, this.client.acceptLanguage(), imageUrl, parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -2416,8 +2281,8 @@ public ImageAnalysis call(ServiceResponse response) { * @return the observable to the ImageAnalysis object */ public Observable> analyzeImageWithServiceResponseAsync(String url, AnalyzeImageOptionalParameter analyzeImageOptionalParameter) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (url == null) { throw new IllegalArgumentException("Parameter url is required and cannot be null."); @@ -2435,13 +2300,13 @@ public Observable> analyzeImageWithServiceRespons * @param url Publicly reachable URL of an image * @param visualFeatures A string indicating what visual feature types to return. Multiple values should be comma-separated. Valid visual feature types include:Categories - categorizes image content according to a taxonomy defined in documentation. Tags - tags the image with a detailed list of words related to the image content. Description - describes the image content with a complete English sentence. Faces - detects if faces are present. If present, generate coordinates, gender and age. ImageType - detects if image is clipart or a line drawing. Color - determines the accent color, dominant color, and whether an image is black&white.Adult - detects if the image is pornographic in nature (depicts nudity or a sex act). Sexually suggestive content is also detected. * @param details A string indicating which domain-specific details to return. Multiple values should be comma-separated. Valid visual feature types include:Celebrities - identifies celebrities if detected in the image. - * @param language The desired language for output generation. If this parameter is not specified, the default value is &quot;en&quot;.Supported languages:en - English, Default.ja - Japanese pt - Portuguese zh - Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh' + * @param language The desired language for output generation. If this parameter is not specified, the default value is &quot;en&quot;.Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', 'ja', 'pt', 'zh' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ImageAnalysis object */ public Observable> analyzeImageWithServiceResponseAsync(String url, List visualFeatures, List
details, String language) { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (url == null) { throw new IllegalArgumentException("Parameter url is required and cannot be null."); @@ -2450,7 +2315,7 @@ public Observable> analyzeImageWithServiceRespons Validator.validate(details); ImageUrl imageUrl = new ImageUrl(); imageUrl.withUrl(url); - String parameterizedHost = Joiner.on(", ").join("{AzureRegion}", this.client.azureRegion()); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); String visualFeaturesConverted = this.client.serializerAdapter().serializeList(visualFeatures, CollectionFormat.CSV); String detailsConverted = this.client.serializerAdapter().serializeList(details, CollectionFormat.CSV); return service.analyzeImage(visualFeaturesConverted, detailsConverted, language, this.client.acceptLanguage(), imageUrl, parameterizedHost, this.client.userAgent()) @@ -2582,10 +2447,10 @@ public ListModelsResult call(ServiceResponse response) { * @return the observable to the ListModelsResult object */ public Observable> listModelsWithServiceResponseAsync() { - if (this.client.azureRegion() == null) { - throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null."); + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } - String parameterizedHost = Joiner.on(", ").join("{AzureRegion}", this.client.azureRegion()); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); return service.listModels(this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/package-info.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/package-info.java index 70eaef23dc65..a0fdb3318f4b 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/package-info.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/package-info.java @@ -5,7 +5,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * This package contains the implementation classes for ComputerVisionAPI. + * This package contains the implementation classes for ComputerVisionClient. * The Computer Vision API provides state-of-the-art algorithms to process images and return information. For example, it can be used to determine if an image contains mature content, or it can be used to find all the faces in an image. It also has other features like estimating dominant and accent colors, categorizing the content of images, and describing an image with complete English sentences. Additionally, it can also intelligently generate images thumbnails for displaying large images effectively. */ package com.microsoft.azure.cognitiveservices.vision.computervision.implementation; diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/AnalyzeImageByDomainInStreamOptionalParameter.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/AnalyzeImageByDomainInStreamOptionalParameter.java index 9847e2211cf1..2cafd3e4c7fb 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/AnalyzeImageByDomainInStreamOptionalParameter.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/AnalyzeImageByDomainInStreamOptionalParameter.java @@ -16,8 +16,9 @@ public class AnalyzeImageByDomainInStreamOptionalParameter { /** * The desired language for output generation. If this parameter is not * specified, the default value is &quot;en&quot;.Supported - * languages:en - English, Default.ja - Japanese pt - Portuguese zh - - * Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh'. + * languages:en - English, Default. es - Spanish, ja - Japanese, pt - + * Portuguese, zh - Simplified Chinese. Possible values include: 'en', + * 'es', 'ja', 'pt', 'zh'. */ private String language; diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/AnalyzeImageByDomainOptionalParameter.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/AnalyzeImageByDomainOptionalParameter.java index 90df476de561..afcd63f11b62 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/AnalyzeImageByDomainOptionalParameter.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/AnalyzeImageByDomainOptionalParameter.java @@ -16,8 +16,9 @@ public class AnalyzeImageByDomainOptionalParameter { /** * The desired language for output generation. If this parameter is not * specified, the default value is &quot;en&quot;.Supported - * languages:en - English, Default.ja - Japanese pt - Portuguese zh - - * Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh'. + * languages:en - English, Default. es - Spanish, ja - Japanese, pt - + * Portuguese, zh - Simplified Chinese. Possible values include: 'en', + * 'es', 'ja', 'pt', 'zh'. */ private String language; diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/AnalyzeImageInStreamOptionalParameter.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/AnalyzeImageInStreamOptionalParameter.java index 84768234a700..38bddc954426 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/AnalyzeImageInStreamOptionalParameter.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/AnalyzeImageInStreamOptionalParameter.java @@ -40,8 +40,9 @@ public class AnalyzeImageInStreamOptionalParameter { /** * The desired language for output generation. If this parameter is not * specified, the default value is &quot;en&quot;.Supported - * languages:en - English, Default.ja - Japanese pt - Portuguese zh - - * Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh'. + * languages:en - English, Default. es - Spanish, ja - Japanese, pt - + * Portuguese, zh - Simplified Chinese. Possible values include: 'en', + * 'es', 'ja', 'pt', 'zh'. */ private String language; diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/AnalyzeImageOptionalParameter.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/AnalyzeImageOptionalParameter.java index af8c23c736b7..5a5143962255 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/AnalyzeImageOptionalParameter.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/AnalyzeImageOptionalParameter.java @@ -39,8 +39,9 @@ public class AnalyzeImageOptionalParameter { /** * The desired language for output generation. If this parameter is not * specified, the default value is &quot;en&quot;.Supported - * languages:en - English, Default.ja - Japanese pt - Portuguese zh - - * Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh'. + * languages:en - English, Default. es - Spanish, ja - Japanese, pt - + * Portuguese, zh - Simplified Chinese. Possible values include: 'en', + * 'es', 'ja', 'pt', 'zh'. */ private String language; diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/AzureRegions.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/AzureRegions.java deleted file mode 100644 index 5700d0161fc8..000000000000 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/AzureRegions.java +++ /dev/null @@ -1,83 +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.computervision.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for AzureRegions. - */ -public enum AzureRegions { - /** Enum value westus. */ - WESTUS("westus"), - - /** Enum value westeurope. */ - WESTEUROPE("westeurope"), - - /** Enum value southeastasia. */ - SOUTHEASTASIA("southeastasia"), - - /** Enum value eastus2. */ - EASTUS2("eastus2"), - - /** Enum value westcentralus. */ - WESTCENTRALUS("westcentralus"), - - /** Enum value westus2. */ - WESTUS2("westus2"), - - /** Enum value eastus. */ - EASTUS("eastus"), - - /** Enum value southcentralus. */ - SOUTHCENTRALUS("southcentralus"), - - /** Enum value northeurope. */ - NORTHEUROPE("northeurope"), - - /** Enum value eastasia. */ - EASTASIA("eastasia"), - - /** Enum value australiaeast. */ - AUSTRALIAEAST("australiaeast"), - - /** Enum value brazilsouth. */ - BRAZILSOUTH("brazilsouth"); - - /** The actual serialized value for a AzureRegions instance. */ - private String value; - - AzureRegions(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a AzureRegions instance. - * - * @param value the serialized value to parse. - * @return the parsed AzureRegions object, or null if unable to parse. - */ - @JsonCreator - public static AzureRegions fromString(String value) { - AzureRegions[] items = AzureRegions.values(); - for (AzureRegions item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/Category.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/Category.java index dd592c4ccfdb..818eb79c30e4 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/Category.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/Category.java @@ -24,7 +24,7 @@ public class Category { * Scoring of the category. */ @JsonProperty(value = "score") - private Double score; + private double score; /** * The detail property. @@ -57,7 +57,7 @@ public Category withName(String name) { * * @return the score value */ - public Double score() { + public double score() { return this.score; } @@ -67,7 +67,7 @@ public Double score() { * @param score the score value to set * @return the Category object itself. */ - public Category withScore(Double score) { + public Category withScore(double score) { this.score = score; return this; } diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/CategoryDetail.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/CategoryDetail.java index 22e683f3b919..632b39319c57 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/CategoryDetail.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/CategoryDetail.java @@ -21,6 +21,12 @@ public class CategoryDetail { @JsonProperty(value = "celebrities") private List celebrities; + /** + * An array of landmarks if any identified. + */ + @JsonProperty(value = "landmarks") + private List landmarks; + /** * Get the celebrities value. * @@ -41,4 +47,24 @@ public CategoryDetail withCelebrities(List celebrities) { return this; } + /** + * Get the landmarks value. + * + * @return the landmarks value + */ + public List landmarks() { + return this.landmarks; + } + + /** + * Set the landmarks value. + * + * @param landmarks the landmarks value to set + * @return the CategoryDetail object itself. + */ + public CategoryDetail withLandmarks(List landmarks) { + this.landmarks = landmarks; + return this; + } + } diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/CelebritiesModel.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/CelebritiesModel.java index 3cc852a62222..f4c5bc6e2de4 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/CelebritiesModel.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/CelebritiesModel.java @@ -24,7 +24,7 @@ public class CelebritiesModel { * Level of confidence ranging from 0 to 1. */ @JsonProperty(value = "confidence") - private Double confidence; + private double confidence; /** * The faceRectangle property. @@ -57,7 +57,7 @@ public CelebritiesModel withName(String name) { * * @return the confidence value */ - public Double confidence() { + public double confidence() { return this.confidence; } @@ -67,7 +67,7 @@ public Double confidence() { * @param confidence the confidence value to set * @return the CelebritiesModel object itself. */ - public CelebritiesModel withConfidence(Double confidence) { + public CelebritiesModel withConfidence(double confidence) { this.confidence = confidence; return this; } diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/DescribeImageInStreamOptionalParameter.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/DescribeImageInStreamOptionalParameter.java index 8607446ead9f..722b44083a00 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/DescribeImageInStreamOptionalParameter.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/DescribeImageInStreamOptionalParameter.java @@ -22,8 +22,9 @@ public class DescribeImageInStreamOptionalParameter { /** * The desired language for output generation. If this parameter is not * specified, the default value is &quot;en&quot;.Supported - * languages:en - English, Default.ja - Japanese pt - Portuguese zh - - * Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh'. + * languages:en - English, Default. es - Spanish, ja - Japanese, pt - + * Portuguese, zh - Simplified Chinese. Possible values include: 'en', + * 'es', 'ja', 'pt', 'zh'. */ private String language; diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/DescribeImageOptionalParameter.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/DescribeImageOptionalParameter.java index cf9e39e82649..7af6bab47b80 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/DescribeImageOptionalParameter.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/DescribeImageOptionalParameter.java @@ -22,8 +22,9 @@ public class DescribeImageOptionalParameter { /** * The desired language for output generation. If this parameter is not * specified, the default value is &quot;en&quot;.Supported - * languages:en - English, Default.ja - Japanese pt - Portuguese zh - - * Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh'. + * languages:en - English, Default. es - Spanish, ja - Japanese, pt - + * Portuguese, zh - Simplified Chinese. Possible values include: 'en', + * 'es', 'ja', 'pt', 'zh'. */ private String language; diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/DomainModels.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/DomainModels.java deleted file mode 100644 index 2aeb2b427bb6..000000000000 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/DomainModels.java +++ /dev/null @@ -1,53 +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.computervision.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for DomainModels. - */ -public enum DomainModels { - /** Enum value Celebrities. */ - CELEBRITIES("Celebrities"), - - /** Enum value Landmarks. */ - LANDMARKS("Landmarks"); - - /** The actual serialized value for a DomainModels instance. */ - private String value; - - DomainModels(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a DomainModels instance. - * - * @param value the serialized value to parse. - * @return the parsed DomainModels object, or null if unable to parse. - */ - @JsonCreator - public static DomainModels fromString(String value) { - DomainModels[] items = DomainModels.values(); - for (DomainModels item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/FaceDescription.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/FaceDescription.java index e6cf2bd66be0..a40fe6a32aa8 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/FaceDescription.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/FaceDescription.java @@ -18,7 +18,7 @@ public class FaceDescription { * Possible age of the face. */ @JsonProperty(value = "age") - private Integer age; + private int age; /** * Possible gender of the face. Possible values include: 'Male', 'Female'. @@ -37,7 +37,7 @@ public class FaceDescription { * * @return the age value */ - public Integer age() { + public int age() { return this.age; } @@ -47,7 +47,7 @@ public Integer age() { * @param age the age value to set * @return the FaceDescription object itself. */ - public FaceDescription withAge(Integer age) { + public FaceDescription withAge(int age) { this.age = age; return this; } diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/FaceRectangle.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/FaceRectangle.java index 3fd6560193c5..5d84d960d4bd 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/FaceRectangle.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/FaceRectangle.java @@ -18,32 +18,32 @@ public class FaceRectangle { * X-coordinate of the top left point of the face. */ @JsonProperty(value = "left") - private Integer left; + private int left; /** * Y-coordinate of the top left point of the face. */ @JsonProperty(value = "top") - private Integer top; + private int top; /** * Width measured from the top-left point of the face. */ @JsonProperty(value = "width") - private Integer width; + private int width; /** * Height measured from the top-left point of the face. */ @JsonProperty(value = "height") - private Integer height; + private int height; /** * Get the left value. * * @return the left value */ - public Integer left() { + public int left() { return this.left; } @@ -53,7 +53,7 @@ public Integer left() { * @param left the left value to set * @return the FaceRectangle object itself. */ - public FaceRectangle withLeft(Integer left) { + public FaceRectangle withLeft(int left) { this.left = left; return this; } @@ -63,7 +63,7 @@ public FaceRectangle withLeft(Integer left) { * * @return the top value */ - public Integer top() { + public int top() { return this.top; } @@ -73,7 +73,7 @@ public Integer top() { * @param top the top value to set * @return the FaceRectangle object itself. */ - public FaceRectangle withTop(Integer top) { + public FaceRectangle withTop(int top) { this.top = top; return this; } @@ -83,7 +83,7 @@ public FaceRectangle withTop(Integer top) { * * @return the width value */ - public Integer width() { + public int width() { return this.width; } @@ -93,7 +93,7 @@ public Integer width() { * @param width the width value to set * @return the FaceRectangle object itself. */ - public FaceRectangle withWidth(Integer width) { + public FaceRectangle withWidth(int width) { this.width = width; return this; } @@ -103,7 +103,7 @@ public FaceRectangle withWidth(Integer width) { * * @return the height value */ - public Integer height() { + public int height() { return this.height; } @@ -113,7 +113,7 @@ public Integer height() { * @param height the height value to set * @return the FaceRectangle object itself. */ - public FaceRectangle withHeight(Integer height) { + public FaceRectangle withHeight(int height) { this.height = height; return this; } diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/ImageCaption.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/ImageCaption.java index 28c21952f10b..85185d6abe8a 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/ImageCaption.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/ImageCaption.java @@ -24,7 +24,7 @@ public class ImageCaption { * The level of confidence the service has in the caption. */ @JsonProperty(value = "confidence") - private Double confidence; + private double confidence; /** * Get the text value. @@ -51,7 +51,7 @@ public ImageCaption withText(String text) { * * @return the confidence value */ - public Double confidence() { + public double confidence() { return this.confidence; } @@ -61,7 +61,7 @@ public Double confidence() { * @param confidence the confidence value to set * @return the ImageCaption object itself. */ - public ImageCaption withConfidence(Double confidence) { + public ImageCaption withConfidence(double confidence) { this.confidence = confidence; return this; } diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/ImageDescription.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/ImageDescription.java index 9307157aa08c..05175e743cd5 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/ImageDescription.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/ImageDescription.java @@ -33,13 +33,13 @@ public class ImageDescription { /** * Id of the REST API request. */ - @JsonProperty(value = "description.requestId") + @JsonProperty(value = "requestId") private String requestId; /** * The metadata property. */ - @JsonProperty(value = "description.metadata") + @JsonProperty(value = "metadata") private ImageMetadata metadata; /** diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/ImageDescriptionDetails.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/ImageDescriptionDetails.java index 4bb6091bb61b..2c2d97f476f9 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/ImageDescriptionDetails.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/ImageDescriptionDetails.java @@ -28,18 +28,6 @@ public class ImageDescriptionDetails { @JsonProperty(value = "captions") private List captions; - /** - * Id of the REST API request. - */ - @JsonProperty(value = "requestId") - private String requestId; - - /** - * The metadata property. - */ - @JsonProperty(value = "metadata") - private ImageMetadata metadata; - /** * Get the tags value. * @@ -80,44 +68,4 @@ public ImageDescriptionDetails withCaptions(List captions) { return this; } - /** - * Get the requestId value. - * - * @return the requestId value - */ - public String requestId() { - return this.requestId; - } - - /** - * Set the requestId value. - * - * @param requestId the requestId value to set - * @return the ImageDescriptionDetails object itself. - */ - public ImageDescriptionDetails withRequestId(String requestId) { - this.requestId = requestId; - return this; - } - - /** - * Get the metadata value. - * - * @return the metadata value - */ - public ImageMetadata metadata() { - return this.metadata; - } - - /** - * Set the metadata value. - * - * @param metadata the metadata value to set - * @return the ImageDescriptionDetails object itself. - */ - public ImageDescriptionDetails withMetadata(ImageMetadata metadata) { - this.metadata = metadata; - return this; - } - } diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/ImageMetadata.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/ImageMetadata.java index 9c307eb01eb3..f196924a10ad 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/ImageMetadata.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/ImageMetadata.java @@ -18,13 +18,13 @@ public class ImageMetadata { * Image width. */ @JsonProperty(value = "width") - private Integer width; + private int width; /** * Image height. */ @JsonProperty(value = "height") - private Integer height; + private int height; /** * Image format. @@ -37,7 +37,7 @@ public class ImageMetadata { * * @return the width value */ - public Integer width() { + public int width() { return this.width; } @@ -47,7 +47,7 @@ public Integer width() { * @param width the width value to set * @return the ImageMetadata object itself. */ - public ImageMetadata withWidth(Integer width) { + public ImageMetadata withWidth(int width) { this.width = width; return this; } @@ -57,7 +57,7 @@ public ImageMetadata withWidth(Integer width) { * * @return the height value */ - public Integer height() { + public int height() { return this.height; } @@ -67,7 +67,7 @@ public Integer height() { * @param height the height value to set * @return the ImageMetadata object itself. */ - public ImageMetadata withHeight(Integer height) { + public ImageMetadata withHeight(int height) { this.height = height; return this; } diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/ImageTag.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/ImageTag.java index b9b0296c4f2e..d91e80e872bd 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/ImageTag.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/ImageTag.java @@ -24,7 +24,13 @@ public class ImageTag { * The level of confidence the service has in the caption. */ @JsonProperty(value = "confidence") - private Double confidence; + private double confidence; + + /** + * Optional categorization for the tag. + */ + @JsonProperty(value = "hint") + private String hint; /** * Get the name value. @@ -51,7 +57,7 @@ public ImageTag withName(String name) { * * @return the confidence value */ - public Double confidence() { + public double confidence() { return this.confidence; } @@ -61,9 +67,29 @@ public Double confidence() { * @param confidence the confidence value to set * @return the ImageTag object itself. */ - public ImageTag withConfidence(Double confidence) { + public ImageTag withConfidence(double confidence) { this.confidence = confidence; return this; } + /** + * Get the hint value. + * + * @return the hint value + */ + public String hint() { + return this.hint; + } + + /** + * Set the hint value. + * + * @param hint the hint value to set + * @return the ImageTag object itself. + */ + public ImageTag withHint(String hint) { + this.hint = hint; + return this; + } + } diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/ImageType.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/ImageType.java index 284ed776e640..a32ac410135c 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/ImageType.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/ImageType.java @@ -18,20 +18,20 @@ public class ImageType { * Confidence level that the image is a clip art. */ @JsonProperty(value = "clipArtType") - private Double clipArtType; + private double clipArtType; /** * Confidence level that the image is a line drawing. */ @JsonProperty(value = "lineDrawingType") - private Double lineDrawingType; + private double lineDrawingType; /** * Get the clipArtType value. * * @return the clipArtType value */ - public Double clipArtType() { + public double clipArtType() { return this.clipArtType; } @@ -41,7 +41,7 @@ public Double clipArtType() { * @param clipArtType the clipArtType value to set * @return the ImageType object itself. */ - public ImageType withClipArtType(Double clipArtType) { + public ImageType withClipArtType(double clipArtType) { this.clipArtType = clipArtType; return this; } @@ -51,7 +51,7 @@ public ImageType withClipArtType(Double clipArtType) { * * @return the lineDrawingType value */ - public Double lineDrawingType() { + public double lineDrawingType() { return this.lineDrawingType; } @@ -61,7 +61,7 @@ public Double lineDrawingType() { * @param lineDrawingType the lineDrawingType value to set * @return the ImageType object itself. */ - public ImageType withLineDrawingType(Double lineDrawingType) { + public ImageType withLineDrawingType(double lineDrawingType) { this.lineDrawingType = lineDrawingType; return this; } diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/LandmarkResults.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/LandmarkResults.java index c53b039b5399..bc8e1a02c8ae 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/LandmarkResults.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/LandmarkResults.java @@ -19,7 +19,7 @@ public class LandmarkResults { * The landmarks property. */ @JsonProperty(value = "landmarks") - private List landmarks; + private List landmarks; /** * Id of the REST API request. @@ -38,7 +38,7 @@ public class LandmarkResults { * * @return the landmarks value */ - public List landmarks() { + public List landmarks() { return this.landmarks; } @@ -48,7 +48,7 @@ public List landmarks() { * @param landmarks the landmarks value to set * @return the LandmarkResults object itself. */ - public LandmarkResults withLandmarks(List landmarks) { + public LandmarkResults withLandmarks(List landmarks) { this.landmarks = landmarks; return this; } diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/LandmarkResultsLandmarksItem.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/LandmarksModel.java similarity index 76% rename from cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/LandmarkResultsLandmarksItem.java rename to cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/LandmarksModel.java index aa7a381ae501..7b4359151540 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/LandmarkResultsLandmarksItem.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/LandmarksModel.java @@ -13,7 +13,7 @@ /** * A landmark recognized in the image. */ -public class LandmarkResultsLandmarksItem { +public class LandmarksModel { /** * Name of the landmark. */ @@ -24,7 +24,7 @@ public class LandmarkResultsLandmarksItem { * Confidence level for the landmark recognition. */ @JsonProperty(value = "confidence") - private Double confidence; + private double confidence; /** * Get the name value. @@ -39,9 +39,9 @@ public String name() { * Set the name value. * * @param name the name value to set - * @return the LandmarkResultsLandmarksItem object itself. + * @return the LandmarksModel object itself. */ - public LandmarkResultsLandmarksItem withName(String name) { + public LandmarksModel withName(String name) { this.name = name; return this; } @@ -51,7 +51,7 @@ public LandmarkResultsLandmarksItem withName(String name) { * * @return the confidence value */ - public Double confidence() { + public double confidence() { return this.confidence; } @@ -59,9 +59,9 @@ public Double confidence() { * Set the confidence value. * * @param confidence the confidence value to set - * @return the LandmarkResultsLandmarksItem object itself. + * @return the LandmarksModel object itself. */ - public LandmarkResultsLandmarksItem withConfidence(Double confidence) { + public LandmarksModel withConfidence(double confidence) { this.confidence = confidence; return this; } diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/OcrResult.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/OcrResult.java index f414a3e2c8f5..30833ac5c811 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/OcrResult.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/OcrResult.java @@ -34,7 +34,7 @@ public class OcrResult { * recognized correctly. */ @JsonProperty(value = "textAngle") - private Double textAngle; + private double textAngle; /** * Orientation of the text recognized in the image. The value @@ -77,7 +77,7 @@ public OcrResult withLanguage(String language) { * * @return the textAngle value */ - public Double textAngle() { + public double textAngle() { return this.textAngle; } @@ -87,7 +87,7 @@ public Double textAngle() { * @param textAngle the textAngle value to set * @return the OcrResult object itself. */ - public OcrResult withTextAngle(Double textAngle) { + public OcrResult withTextAngle(double textAngle) { this.textAngle = textAngle; return this; } diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/RecognizeTextInStreamOptionalParameter.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/RecognizeTextInStreamOptionalParameter.java deleted file mode 100644 index ec54c8c355f9..000000000000 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/RecognizeTextInStreamOptionalParameter.java +++ /dev/null @@ -1,68 +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.computervision.models; - - -/** - * The RecognizeTextInStreamOptionalParameter model. - */ -public class RecognizeTextInStreamOptionalParameter { - /** - * If 'true' is specified, handwriting recognition is performed. If this - * parameter is set to 'false' or is not specified, printed text - * recognition is performed. - */ - private Boolean detectHandwriting; - - /** - * Gets or sets the preferred language for the response. - */ - private String thisclientacceptLanguage; - - /** - * Get the detectHandwriting value. - * - * @return the detectHandwriting value - */ - public Boolean detectHandwriting() { - return this.detectHandwriting; - } - - /** - * Set the detectHandwriting value. - * - * @param detectHandwriting the detectHandwriting value to set - * @return the RecognizeTextInStreamOptionalParameter object itself. - */ - public RecognizeTextInStreamOptionalParameter withDetectHandwriting(Boolean detectHandwriting) { - this.detectHandwriting = detectHandwriting; - 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 RecognizeTextInStreamOptionalParameter object itself. - */ - public RecognizeTextInStreamOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { - this.thisclientacceptLanguage = thisclientacceptLanguage; - return this; - } - -} diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/RecognizeTextOptionalParameter.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/RecognizeTextOptionalParameter.java deleted file mode 100644 index 9b736181e07d..000000000000 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/RecognizeTextOptionalParameter.java +++ /dev/null @@ -1,68 +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.computervision.models; - - -/** - * The RecognizeTextOptionalParameter model. - */ -public class RecognizeTextOptionalParameter { - /** - * If 'true' is specified, handwriting recognition is performed. If this - * parameter is set to 'false' or is not specified, printed text - * recognition is performed. - */ - private Boolean detectHandwriting; - - /** - * Gets or sets the preferred language for the response. - */ - private String thisclientacceptLanguage; - - /** - * Get the detectHandwriting value. - * - * @return the detectHandwriting value - */ - public Boolean detectHandwriting() { - return this.detectHandwriting; - } - - /** - * Set the detectHandwriting value. - * - * @param detectHandwriting the detectHandwriting value to set - * @return the RecognizeTextOptionalParameter object itself. - */ - public RecognizeTextOptionalParameter withDetectHandwriting(Boolean detectHandwriting) { - this.detectHandwriting = detectHandwriting; - 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 RecognizeTextOptionalParameter object itself. - */ - public RecognizeTextOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { - this.thisclientacceptLanguage = thisclientacceptLanguage; - return this; - } - -} diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/TagImageInStreamOptionalParameter.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/TagImageInStreamOptionalParameter.java index fd70bad3ae8d..bdcfc17c9b0b 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/TagImageInStreamOptionalParameter.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/TagImageInStreamOptionalParameter.java @@ -16,8 +16,9 @@ public class TagImageInStreamOptionalParameter { /** * The desired language for output generation. If this parameter is not * specified, the default value is &quot;en&quot;.Supported - * languages:en - English, Default.ja - Japanese pt - Portuguese zh - - * Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh'. + * languages:en - English, Default. es - Spanish, ja - Japanese, pt - + * Portuguese, zh - Simplified Chinese. Possible values include: 'en', + * 'es', 'ja', 'pt', 'zh'. */ private String language; diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/TagImageOptionalParameter.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/TagImageOptionalParameter.java index aeef34d1236b..7d98f593b24d 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/TagImageOptionalParameter.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/TagImageOptionalParameter.java @@ -16,8 +16,9 @@ public class TagImageOptionalParameter { /** * The desired language for output generation. If this parameter is not * specified, the default value is &quot;en&quot;.Supported - * languages:en - English, Default.ja - Japanese pt - Portuguese zh - - * Simplified Chinese. Possible values include: 'en', 'ja', 'pt', 'zh'. + * languages:en - English, Default. es - Spanish, ja - Japanese, pt - + * Portuguese, zh - Simplified Chinese. Possible values include: 'en', + * 'es', 'ja', 'pt', 'zh'. */ private String language; diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/Language1.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/TextRecognitionMode.java similarity index 55% rename from cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/Language1.java rename to cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/TextRecognitionMode.java index 0497ff77b7d1..8a33c1ee4d69 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/Language1.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/TextRecognitionMode.java @@ -12,32 +12,32 @@ import com.fasterxml.jackson.annotation.JsonValue; /** - * Defines values for Language1. + * Defines values for TextRecognitionMode. */ -public enum Language1 { - /** Enum value en. */ - EN("en"), +public enum TextRecognitionMode { + /** Enum value Handwritten. */ + HANDWRITTEN("Handwritten"), - /** Enum value zh. */ - ZH("zh"); + /** Enum value Printed. */ + PRINTED("Printed"); - /** The actual serialized value for a Language1 instance. */ + /** The actual serialized value for a TextRecognitionMode instance. */ private String value; - Language1(String value) { + TextRecognitionMode(String value) { this.value = value; } /** - * Parses a serialized value to a Language1 instance. + * Parses a serialized value to a TextRecognitionMode instance. * * @param value the serialized value to parse. - * @return the parsed Language1 object, or null if unable to parse. + * @return the parsed TextRecognitionMode object, or null if unable to parse. */ @JsonCreator - public static Language1 fromString(String value) { - Language1[] items = Language1.values(); - for (Language1 item : items) { + public static TextRecognitionMode fromString(String value) { + TextRecognitionMode[] items = TextRecognitionMode.values(); + for (TextRecognitionMode item : items) { if (item.toString().equalsIgnoreCase(value)) { return item; } diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/package-info.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/package-info.java index 5273cb6577c1..d0e708ffcdfe 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/package-info.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/models/package-info.java @@ -5,7 +5,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * This package contains the models classes for ComputerVisionAPI. + * This package contains the models classes for ComputerVisionClient. * The Computer Vision API provides state-of-the-art algorithms to process images and return information. For example, it can be used to determine if an image contains mature content, or it can be used to find all the faces in an image. It also has other features like estimating dominant and accent colors, categorizing the content of images, and describing an image with complete English sentences. Additionally, it can also intelligently generate images thumbnails for displaying large images effectively. */ package com.microsoft.azure.cognitiveservices.vision.computervision.models; diff --git a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/package-info.java b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/package-info.java index c40a580b7e7c..4c4b00b6e86c 100644 --- a/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/package-info.java +++ b/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/package-info.java @@ -5,7 +5,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * This package contains the classes for ComputerVisionAPI. + * This package contains the classes for ComputerVisionClient. * The Computer Vision API provides state-of-the-art algorithms to process images and return information. For example, it can be used to determine if an image contains mature content, or it can be used to find all the faces in an image. It also has other features like estimating dominant and accent colors, categorizing the content of images, and describing an image with complete English sentences. Additionally, it can also intelligently generate images thumbnails for displaying large images effectively. */ package com.microsoft.azure.cognitiveservices.vision.computervision; diff --git a/cognitiveservices/data-plane/vision/contentmoderator/pom.xml b/cognitiveservices/data-plane/vision/contentmoderator/pom.xml index 773fba7e867e..4d970865955f 100755 --- a/cognitiveservices/data-plane/vision/contentmoderator/pom.xml +++ b/cognitiveservices/data-plane/vision/contentmoderator/pom.xml @@ -10,15 +10,15 @@ com.microsoft.azure.cognitiveservices azure-cognitiveservices-parent - 1.0.1 + 1.0.2 ../../pom.xml azure-cognitiveservices-contentmoderator - 1.0.1-beta + 1.0.2-beta jar Microsoft Azure SDK for Cognitive Service Content Moderator This package contains Microsoft Cognitive Service Content Moderator SDK. - https://github.com/Azure/azure-sdk-for-java/azure-cognitiveservices/vision/contentmoderator + https://github.com/Azure/azure-sdk-for-java/cognitiveservices/data-plane/vision/contentmoderator The MIT License (MIT) diff --git a/cognitiveservices/data-plane/vision/customvision/prediction/pom.xml b/cognitiveservices/data-plane/vision/customvision/prediction/pom.xml new file mode 100644 index 000000000000..e208aaa0b909 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/prediction/pom.xml @@ -0,0 +1,91 @@ + + + 4.0.0 + + com.microsoft.azure.cognitiveservices + azure-cognitiveservices-parent + 1.0.2 + ../../../pom.xml + + azure-cognitiveservices-customvision-prediction + 1.0.2-beta + jar + Microsoft Azure SDK for Cognitive Service Custom Vision Prediction + This package contains Microsoft Cognitive Service Custom Vision Prediction SDK. + https://github.com/Azure/azure-sdk-for-java/cognitiveservices/data-plane/vision/customvision/prediction + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + UTF-8 + + + + + microsoft + Microsoft + + + + + ossrh + Sonatype Snapshots + https://oss.sonatype.org/content/repositories/snapshots/ + true + default + + + + + com.microsoft.azure + azure-client-runtime + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
\ No newline at end of file diff --git a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/CustomVisionPredictionManager.java b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/CustomVisionPredictionManager.java new file mode 100644 index 000000000000..532df3c8e1e2 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/CustomVisionPredictionManager.java @@ -0,0 +1,93 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.cognitiveservices.vision.customvision.prediction; + +import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.implementation.PredictionEndpointImpl; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import okhttp3.Interceptor; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; + +import java.io.IOException; + +/** + * Entry point to Azure Cognitive Services Custom Vision Prediction manager. + */ +public class CustomVisionPredictionManager { + /** + * Initializes an instance of Custom Vision Prediction API client. + * + * @param subscriptionKey the Custom Vision Prediction API key + * @return the Computer Vision API client + */ + public static PredictionEndpoint authenticate(String subscriptionKey) { + return authenticate("https://{endpoint}/vision/v2.0/", subscriptionKey); + } + + /** + * Initializes an instance of Custom Vision Prediction API client. + * + * @param baseUrl the base URL of the service + * @param subscriptionKey the Custom Vision Prediction API key + * @return the Custom Vision Prediction API client + */ + public static PredictionEndpoint authenticate(String baseUrl, final String subscriptionKey) { + ServiceClientCredentials serviceClientCredentials = new ServiceClientCredentials() { + @Override + public void applyCredentialsFilter(OkHttpClient.Builder builder) { + builder.addNetworkInterceptor( + new Interceptor() { + @Override + public Response intercept(Chain chain) throws IOException, IOException { + Request request = null; + Request original = chain.request(); + // Request customization: add request headers + Request.Builder requestBuilder = original.newBuilder() + .addHeader("Ocp-Apim-Subscription-Key", subscriptionKey); + request = requestBuilder.build(); + return chain.proceed(request); + } + }); + } + }; + return authenticate(baseUrl, serviceClientCredentials); + } + + /** + * Initializes an instance of Custom Vision Prediction API client. + * + * @param credentials the management credentials for Azure + * @param endpoint Supported Cognitive Services endpoints. + * @return the Computer Vision API client + */ + public static PredictionEndpoint authenticate(ServiceClientCredentials credentials, String endpoint) { + return authenticate("https://{endpoint}/vision/v2.0/", credentials); + } + + /** + * Initializes an instance of Custom Vision Prediction API client. + * + * @param baseUrl the base URL of the service + * @param credentials the management credentials for Azure + * @return the Custom Vision Prediction API client + */ + public static PredictionEndpoint authenticate(String baseUrl, ServiceClientCredentials credentials) { + return new PredictionEndpointImpl(baseUrl, credentials); + } + + /** + * Initializes an instance of Custom Vision Prediction API client. + * + * @param restClient the REST client to connect to Azure. + * @return the Custom Vision Prediction API client + */ + public static PredictionEndpoint authenticate(RestClient restClient) { + return new PredictionEndpointImpl(restClient); + } +} diff --git a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/PredictionEndpoint.java b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/PredictionEndpoint.java new file mode 100644 index 000000000000..af52578febfc --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/PredictionEndpoint.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.cognitiveservices.vision.customvision.prediction; + +import com.microsoft.azure.AzureClient; +import com.microsoft.rest.RestClient; + +/** + * The interface for PredictionEndpoint class. + */ +public interface PredictionEndpoint { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + AzureClient getAzureClient(); + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + String userAgent(); + + /** + * Gets . + * + * @return the apiKey value. + */ + String apiKey(); + + /** + * Sets . + * + * @param apiKey the apiKey value. + * @return the service client itself + */ + PredictionEndpoint withApiKey(String apiKey); + + /** + * Gets Gets or sets the preferred language for the response.. + * + * @return the acceptLanguage value. + */ + String acceptLanguage(); + + /** + * Sets Gets or sets the preferred language for the response.. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + PredictionEndpoint withAcceptLanguage(String acceptLanguage); + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @return the longRunningOperationRetryTimeout value. + */ + int longRunningOperationRetryTimeout(); + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + PredictionEndpoint 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.. + * + * @return the generateClientRequestId value. + */ + boolean generateClientRequestId(); + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + PredictionEndpoint withGenerateClientRequestId(boolean generateClientRequestId); + + /** + * Gets the Predictions object to access its operations. + * @return the Predictions object. + */ + Predictions predictions(); + +} diff --git a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/Predictions.java b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/Predictions.java new file mode 100644 index 000000000000..75bf2eefb553 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/Predictions.java @@ -0,0 +1,451 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.cognitiveservices.vision.customvision.prediction; + +import com.microsoft.azure.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.ImagePrediction; +import java.util.UUID; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Predictions. + */ +public interface Predictions { + /** + * Predict 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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + @Deprecated + ImagePrediction predictImageWithNoStore(UUID projectId, byte[] imageData, PredictImageWithNoStoreOptionalParameter predictImageWithNoStoreOptionalParameter); + + /** + * Predict 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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + @Deprecated + Observable predictImageWithNoStoreAsync(UUID projectId, byte[] imageData, PredictImageWithNoStoreOptionalParameter predictImageWithNoStoreOptionalParameter); + + /** + * Predict an image without saving the result. + * + * @return the first stage of the predictImageWithNoStore call + */ + PredictionsPredictImageWithNoStoreDefinitionStages.WithProjectId predictImageWithNoStore(); + + /** + * Grouping of predictImageWithNoStore definition stages. + */ + interface PredictionsPredictImageWithNoStoreDefinitionStages { + /** + * 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 { + /** + * + * + * @return next definition stage + */ + PredictionsPredictImageWithNoStoreDefinitionStages.WithExecute withImageData(byte[] imageData); + } + + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + 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. + * + * @return next definition stage + */ + PredictionsPredictImageWithNoStoreDefinitionStages.WithExecute withIterationId(UUID iterationId); + + /** + * Optional. Specifies the name of application using the endpoint. + * + * @return next definition stage + */ + PredictionsPredictImageWithNoStoreDefinitionStages.WithExecute withApplication(String application); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends PredictionsPredictImageWithNoStoreDefinitionStages.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 predictImageWithNoStore definition. + */ + interface PredictionsPredictImageWithNoStoreDefinition extends + PredictionsPredictImageWithNoStoreDefinitionStages.WithProjectId, + PredictionsPredictImageWithNoStoreDefinitionStages.WithImageData, + PredictionsPredictImageWithNoStoreDefinitionStages.WithExecute { + } + + /** + * Predict 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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + @Deprecated + ImagePrediction predictImageUrlWithNoStore(UUID projectId, PredictImageUrlWithNoStoreOptionalParameter predictImageUrlWithNoStoreOptionalParameter); + + /** + * Predict 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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + @Deprecated + Observable predictImageUrlWithNoStoreAsync(UUID projectId, PredictImageUrlWithNoStoreOptionalParameter predictImageUrlWithNoStoreOptionalParameter); + + /** + * Predict an image url without saving the result. + * + * @return the first stage of the predictImageUrlWithNoStore call + */ + PredictionsPredictImageUrlWithNoStoreDefinitionStages.WithProjectId predictImageUrlWithNoStore(); + + /** + * Grouping of predictImageUrlWithNoStore definition stages. + */ + interface PredictionsPredictImageUrlWithNoStoreDefinitionStages { + /** + * The stage of the definition to be specify projectId. + */ + interface WithProjectId { + /** + * The project id. + * + * @return next definition stage + */ + PredictionsPredictImageUrlWithNoStoreDefinitionStages.WithExecute withProjectId(UUID projectId); + } + + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + 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. + * + * @return next definition stage + */ + PredictionsPredictImageUrlWithNoStoreDefinitionStages.WithExecute withIterationId(UUID iterationId); + + /** + * Optional. Specifies the name of application using the endpoint. + * + * @return next definition stage + */ + PredictionsPredictImageUrlWithNoStoreDefinitionStages.WithExecute withApplication(String application); + + /** + * + * + * @return next definition stage + */ + PredictionsPredictImageUrlWithNoStoreDefinitionStages.WithExecute withUrl(String url); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends PredictionsPredictImageUrlWithNoStoreDefinitionStages.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 predictImageUrlWithNoStore definition. + */ + interface PredictionsPredictImageUrlWithNoStoreDefinition extends + PredictionsPredictImageUrlWithNoStoreDefinitionStages.WithProjectId, + PredictionsPredictImageUrlWithNoStoreDefinitionStages.WithExecute { + } + + /** + * Predict 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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + @Deprecated + ImagePrediction predictImage(UUID projectId, byte[] imageData, PredictImageOptionalParameter predictImageOptionalParameter); + + /** + * Predict 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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + @Deprecated + Observable predictImageAsync(UUID projectId, byte[] imageData, PredictImageOptionalParameter predictImageOptionalParameter); + + /** + * Predict an image and saves the result. + * + * @return the first stage of the predictImage call + */ + PredictionsPredictImageDefinitionStages.WithProjectId predictImage(); + + /** + * Grouping of predictImage definition stages. + */ + interface PredictionsPredictImageDefinitionStages { + /** + * 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 { + /** + * + * + * @return next definition stage + */ + PredictionsPredictImageDefinitionStages.WithExecute withImageData(byte[] imageData); + } + + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + 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. + * + * @return next definition stage + */ + PredictionsPredictImageDefinitionStages.WithExecute withIterationId(UUID iterationId); + + /** + * Optional. Specifies the name of application using the endpoint. + * + * @return next definition stage + */ + PredictionsPredictImageDefinitionStages.WithExecute withApplication(String application); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends PredictionsPredictImageDefinitionStages.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 predictImage definition. + */ + interface PredictionsPredictImageDefinition extends + PredictionsPredictImageDefinitionStages.WithProjectId, + PredictionsPredictImageDefinitionStages.WithImageData, + PredictionsPredictImageDefinitionStages.WithExecute { + } + + /** + * Predict 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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + @Deprecated + ImagePrediction predictImageUrl(UUID projectId, PredictImageUrlOptionalParameter predictImageUrlOptionalParameter); + + /** + * Predict 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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + @Deprecated + Observable predictImageUrlAsync(UUID projectId, PredictImageUrlOptionalParameter predictImageUrlOptionalParameter); + + /** + * Predict an image url and saves the result. + * + * @return the first stage of the predictImageUrl call + */ + PredictionsPredictImageUrlDefinitionStages.WithProjectId predictImageUrl(); + + /** + * Grouping of predictImageUrl definition stages. + */ + interface PredictionsPredictImageUrlDefinitionStages { + /** + * The stage of the definition to be specify projectId. + */ + interface WithProjectId { + /** + * The project id. + * + * @return next definition stage + */ + PredictionsPredictImageUrlDefinitionStages.WithExecute withProjectId(UUID projectId); + } + + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + 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. + * + * @return next definition stage + */ + PredictionsPredictImageUrlDefinitionStages.WithExecute withIterationId(UUID iterationId); + + /** + * Optional. Specifies the name of application using the endpoint. + * + * @return next definition stage + */ + PredictionsPredictImageUrlDefinitionStages.WithExecute withApplication(String application); + + /** + * + * + * @return next definition stage + */ + PredictionsPredictImageUrlDefinitionStages.WithExecute withUrl(String url); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends PredictionsPredictImageUrlDefinitionStages.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 predictImageUrl definition. + */ + interface PredictionsPredictImageUrlDefinition extends + PredictionsPredictImageUrlDefinitionStages.WithProjectId, + PredictionsPredictImageUrlDefinitionStages.WithExecute { + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/PredictionEndpointImpl.java b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/PredictionEndpointImpl.java new file mode 100644 index 000000000000..bef91917e5e5 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/PredictionEndpointImpl.java @@ -0,0 +1,185 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.cognitiveservices.vision.customvision.prediction.implementation; + +import com.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.Predictions; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the PredictionEndpointImpl class. + */ +public class PredictionEndpointImpl extends AzureServiceClient implements PredictionEndpoint { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The API key. */ + private String apiKey; + + /** + * Gets the API key. + * + * @return the apiKey value. + */ + public String apiKey() { + return this.apiKey; + } + + /** + * Sets the API key. + * + * @param apiKey the apiKey value. + * @return the service client itself + */ + public PredictionEndpointImpl withApiKey(String apiKey) { + this.apiKey = apiKey; + return this; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public PredictionEndpointImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public PredictionEndpointImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public PredictionEndpointImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The Predictions object to access its operations. + */ + private Predictions predictions; + + /** + * Gets the Predictions object to access its operations. + * @return the Predictions object. + */ + public Predictions predictions() { + return this.predictions; + } + + /** + * Initializes an instance of PredictionEndpoint client. + * + * @param credentials the management credentials for Azure + */ + public PredictionEndpointImpl(ServiceClientCredentials credentials) { + this("https://southcentralus.api.cognitive.microsoft.com/customvision/v2.0/Prediction", credentials); + } + + /** + * Initializes an instance of PredictionEndpoint client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public PredictionEndpointImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of PredictionEndpoint client. + * + * @param restClient the REST client to connect to Azure. + */ + public PredictionEndpointImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.predictions = new PredictionsImpl(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "PredictionEndpoint", "2.0"); + } +} diff --git a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/PredictionsImpl.java b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/PredictionsImpl.java new file mode 100644 index 000000000000..cd0b38cef52e --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/PredictionsImpl.java @@ -0,0 +1,785 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.cognitiveservices.vision.customvision.prediction.implementation; + +import com.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 okhttp3.MediaType; +import okhttp3.RequestBody; +import retrofit2.Retrofit; +import com.microsoft.azure.cognitiveservices.vision.customvision.prediction.Predictions; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +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.IOException; +import java.util.UUID; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Multipart; +import retrofit2.http.Part; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Predictions. + */ +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; + + /** + * Initializes an instance of PredictionsImpl. + * + * @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) { + this.service = retrofit.create(PredictionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Predictions to be + * used by Retrofit to perform actually REST calls. + */ + 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); + + @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); + + @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); + + @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); + + } + + + /** + * Predict 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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + public ImagePrediction predictImageWithNoStore(UUID projectId, byte[] imageData, PredictImageWithNoStoreOptionalParameter predictImageWithNoStoreOptionalParameter) { + return predictImageWithNoStoreWithServiceResponseAsync(projectId, imageData, predictImageWithNoStoreOptionalParameter).toBlocking().single().body(); + } + + /** + * Predict 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 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); + } + + /** + * Predict 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 + * @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>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Predict 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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable> predictImageWithNoStoreWithServiceResponseAsync(UUID projectId, byte[] imageData, PredictImageWithNoStoreOptionalParameter predictImageWithNoStoreOptionalParameter) { + 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 UUID iterationId = predictImageWithNoStoreOptionalParameter != null ? predictImageWithNoStoreOptionalParameter.iterationId() : null; + final String application = predictImageWithNoStoreOptionalParameter != null ? predictImageWithNoStoreOptionalParameter.application() : null; + + return predictImageWithNoStoreWithServiceResponseAsync(projectId, imageData, iterationId, application); + } + + /** + * Predict 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 + * @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) { + 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."); + } + 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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = predictImageWithNoStoreDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse predictImageWithNoStoreDelegate(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); + } + + @Override + public PredictionsPredictImageWithNoStoreParameters predictImageWithNoStore() { + return new PredictionsPredictImageWithNoStoreParameters(this); + } + + /** + * Internal class implementing PredictionsPredictImageWithNoStoreDefinition. + */ + class PredictionsPredictImageWithNoStoreParameters implements PredictionsPredictImageWithNoStoreDefinition { + private PredictionsImpl parent; + private UUID projectId; + private byte[] imageData; + private UUID iterationId; + private String application; + + /** + * Constructor. + * @param parent the parent object. + */ + PredictionsPredictImageWithNoStoreParameters(PredictionsImpl parent) { + this.parent = parent; + } + + @Override + public PredictionsPredictImageWithNoStoreParameters withProjectId(UUID projectId) { + this.projectId = projectId; + return this; + } + + @Override + public PredictionsPredictImageWithNoStoreParameters withImageData(byte[] imageData) { + this.imageData = imageData; + return this; + } + + @Override + public PredictionsPredictImageWithNoStoreParameters withIterationId(UUID iterationId) { + this.iterationId = iterationId; + return this; + } + + @Override + public PredictionsPredictImageWithNoStoreParameters withApplication(String application) { + this.application = application; + return this; + } + + @Override + public ImagePrediction execute() { + return predictImageWithNoStoreWithServiceResponseAsync(projectId, imageData, iterationId, application).toBlocking().single().body(); + } + + @Override + public Observable executeAsync() { + return predictImageWithNoStoreWithServiceResponseAsync(projectId, imageData, iterationId, application).map(new Func1, ImagePrediction>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + } + + + /** + * Predict 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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + public ImagePrediction predictImageUrlWithNoStore(UUID projectId, PredictImageUrlWithNoStoreOptionalParameter predictImageUrlWithNoStoreOptionalParameter) { + return predictImageUrlWithNoStoreWithServiceResponseAsync(projectId, predictImageUrlWithNoStoreOptionalParameter).toBlocking().single().body(); + } + + /** + * Predict 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 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); + } + + /** + * Predict 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 + * @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>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Predict 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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable> predictImageUrlWithNoStoreWithServiceResponseAsync(UUID projectId, PredictImageUrlWithNoStoreOptionalParameter predictImageUrlWithNoStoreOptionalParameter) { + 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 = predictImageUrlWithNoStoreOptionalParameter != null ? predictImageUrlWithNoStoreOptionalParameter.iterationId() : null; + final String application = predictImageUrlWithNoStoreOptionalParameter != null ? predictImageUrlWithNoStoreOptionalParameter.application() : null; + final String url = predictImageUrlWithNoStoreOptionalParameter != null ? predictImageUrlWithNoStoreOptionalParameter.url() : null; + + return predictImageUrlWithNoStoreWithServiceResponseAsync(projectId, iterationId, application, url); + } + + /** + * Predict 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 + * @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) { + 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."); + } + ImageUrl imageUrl = new ImageUrl(); + imageUrl.withUrl(url); + return service.predictImageUrlWithNoStore(projectId, iterationId, application, this.client.apiKey(), this.client.acceptLanguage(), imageUrl, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = predictImageUrlWithNoStoreDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse predictImageUrlWithNoStoreDelegate(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); + } + + @Override + public PredictionsPredictImageUrlWithNoStoreParameters predictImageUrlWithNoStore() { + return new PredictionsPredictImageUrlWithNoStoreParameters(this); + } + + /** + * Internal class implementing PredictionsPredictImageUrlWithNoStoreDefinition. + */ + class PredictionsPredictImageUrlWithNoStoreParameters implements PredictionsPredictImageUrlWithNoStoreDefinition { + private PredictionsImpl parent; + private UUID projectId; + private UUID iterationId; + private String application; + private String url; + + /** + * Constructor. + * @param parent the parent object. + */ + PredictionsPredictImageUrlWithNoStoreParameters(PredictionsImpl parent) { + this.parent = parent; + } + + @Override + public PredictionsPredictImageUrlWithNoStoreParameters withProjectId(UUID projectId) { + this.projectId = projectId; + return this; + } + + @Override + public PredictionsPredictImageUrlWithNoStoreParameters withIterationId(UUID iterationId) { + this.iterationId = iterationId; + return this; + } + + @Override + public PredictionsPredictImageUrlWithNoStoreParameters withApplication(String application) { + this.application = application; + return this; + } + + @Override + public PredictionsPredictImageUrlWithNoStoreParameters withUrl(String url) { + this.url = url; + return this; + } + + @Override + public ImagePrediction execute() { + return predictImageUrlWithNoStoreWithServiceResponseAsync(projectId, iterationId, application, url).toBlocking().single().body(); + } + + @Override + public Observable executeAsync() { + return predictImageUrlWithNoStoreWithServiceResponseAsync(projectId, iterationId, application, url).map(new Func1, ImagePrediction>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + } + + + /** + * Predict 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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + public ImagePrediction predictImage(UUID projectId, byte[] imageData, PredictImageOptionalParameter predictImageOptionalParameter) { + return predictImageWithServiceResponseAsync(projectId, imageData, predictImageOptionalParameter).toBlocking().single().body(); + } + + /** + * Predict 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 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); + } + + /** + * Predict 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 + * @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>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Predict 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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable> predictImageWithServiceResponseAsync(UUID projectId, byte[] imageData, PredictImageOptionalParameter predictImageOptionalParameter) { + 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 UUID iterationId = predictImageOptionalParameter != null ? predictImageOptionalParameter.iterationId() : null; + final String application = predictImageOptionalParameter != null ? predictImageOptionalParameter.application() : null; + + return predictImageWithServiceResponseAsync(projectId, imageData, iterationId, application); + } + + /** + * Predict 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 + * @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) { + 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."); + } + 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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = predictImageDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse predictImageDelegate(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); + } + + @Override + public PredictionsPredictImageParameters predictImage() { + return new PredictionsPredictImageParameters(this); + } + + /** + * Internal class implementing PredictionsPredictImageDefinition. + */ + class PredictionsPredictImageParameters implements PredictionsPredictImageDefinition { + private PredictionsImpl parent; + private UUID projectId; + private byte[] imageData; + private UUID iterationId; + private String application; + + /** + * Constructor. + * @param parent the parent object. + */ + PredictionsPredictImageParameters(PredictionsImpl parent) { + this.parent = parent; + } + + @Override + public PredictionsPredictImageParameters withProjectId(UUID projectId) { + this.projectId = projectId; + return this; + } + + @Override + public PredictionsPredictImageParameters withImageData(byte[] imageData) { + this.imageData = imageData; + return this; + } + + @Override + public PredictionsPredictImageParameters withIterationId(UUID iterationId) { + this.iterationId = iterationId; + return this; + } + + @Override + public PredictionsPredictImageParameters withApplication(String application) { + this.application = application; + return this; + } + + @Override + public ImagePrediction execute() { + return predictImageWithServiceResponseAsync(projectId, imageData, iterationId, application).toBlocking().single().body(); + } + + @Override + public Observable executeAsync() { + return predictImageWithServiceResponseAsync(projectId, imageData, iterationId, application).map(new Func1, ImagePrediction>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + } + + + /** + * Predict 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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + public ImagePrediction predictImageUrl(UUID projectId, PredictImageUrlOptionalParameter predictImageUrlOptionalParameter) { + return predictImageUrlWithServiceResponseAsync(projectId, predictImageUrlOptionalParameter).toBlocking().single().body(); + } + + /** + * Predict 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 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); + } + + /** + * Predict 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 + * @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>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Predict 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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable> predictImageUrlWithServiceResponseAsync(UUID projectId, PredictImageUrlOptionalParameter predictImageUrlOptionalParameter) { + 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 = predictImageUrlOptionalParameter != null ? predictImageUrlOptionalParameter.iterationId() : null; + final String application = predictImageUrlOptionalParameter != null ? predictImageUrlOptionalParameter.application() : null; + final String url = predictImageUrlOptionalParameter != null ? predictImageUrlOptionalParameter.url() : null; + + return predictImageUrlWithServiceResponseAsync(projectId, iterationId, application, url); + } + + /** + * Predict 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 + * @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) { + 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."); + } + ImageUrl imageUrl = new ImageUrl(); + imageUrl.withUrl(url); + return service.predictImageUrl(projectId, iterationId, application, this.client.apiKey(), this.client.acceptLanguage(), imageUrl, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = predictImageUrlDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse predictImageUrlDelegate(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); + } + + @Override + public PredictionsPredictImageUrlParameters predictImageUrl() { + return new PredictionsPredictImageUrlParameters(this); + } + + /** + * Internal class implementing PredictionsPredictImageUrlDefinition. + */ + class PredictionsPredictImageUrlParameters implements PredictionsPredictImageUrlDefinition { + private PredictionsImpl parent; + private UUID projectId; + private UUID iterationId; + private String application; + private String url; + + /** + * Constructor. + * @param parent the parent object. + */ + PredictionsPredictImageUrlParameters(PredictionsImpl parent) { + this.parent = parent; + } + + @Override + public PredictionsPredictImageUrlParameters withProjectId(UUID projectId) { + this.projectId = projectId; + return this; + } + + @Override + public PredictionsPredictImageUrlParameters withIterationId(UUID iterationId) { + this.iterationId = iterationId; + return this; + } + + @Override + public PredictionsPredictImageUrlParameters withApplication(String application) { + this.application = application; + return this; + } + + @Override + public PredictionsPredictImageUrlParameters withUrl(String url) { + this.url = url; + return this; + } + + @Override + public ImagePrediction execute() { + return predictImageUrlWithServiceResponseAsync(projectId, iterationId, application, url).toBlocking().single().body(); + } + + @Override + public Observable executeAsync() { + return predictImageUrlWithServiceResponseAsync(projectId, iterationId, application, url).map(new Func1, ImagePrediction>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/package-info.java b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/package-info.java new file mode 100644 index 000000000000..b57774622496 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/package-info.java @@ -0,0 +1,10 @@ +// 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. + +/** + * This package contains the implementation classes for PredictionEndpoint. + */ +package com.microsoft.azure.cognitiveservices.vision.customvision.prediction.implementation; diff --git a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/BoundingBox.java b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/BoundingBox.java new file mode 100644 index 000000000000..48cce04f1dfa --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/BoundingBox.java @@ -0,0 +1,121 @@ +/** + * 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 BoundingBox model. + */ +public class BoundingBox { + /** + * The left property. + */ + @JsonProperty(value = "left") + private double left; + + /** + * The top property. + */ + @JsonProperty(value = "top") + private double top; + + /** + * The width property. + */ + @JsonProperty(value = "width") + private double width; + + /** + * The height property. + */ + @JsonProperty(value = "height") + private double height; + + /** + * Get the left value. + * + * @return the left value + */ + public double left() { + return this.left; + } + + /** + * Set the left value. + * + * @param left the left value to set + * @return the BoundingBox object itself. + */ + public BoundingBox withLeft(double left) { + this.left = left; + return this; + } + + /** + * Get the top value. + * + * @return the top value + */ + public double top() { + return this.top; + } + + /** + * Set the top value. + * + * @param top the top value to set + * @return the BoundingBox object itself. + */ + public BoundingBox withTop(double top) { + this.top = top; + return this; + } + + /** + * Get the width value. + * + * @return the width value + */ + public double width() { + return this.width; + } + + /** + * Set the width value. + * + * @param width the width value to set + * @return the BoundingBox object itself. + */ + public BoundingBox withWidth(double width) { + this.width = width; + return this; + } + + /** + * Get the height value. + * + * @return the height value + */ + public double height() { + return this.height; + } + + /** + * Set the height value. + * + * @param height the height value to set + * @return the BoundingBox object itself. + */ + public BoundingBox withHeight(double height) { + this.height = height; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ImagePrediction.java b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ImagePrediction.java new file mode 100644 index 000000000000..728d0f28c449 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ImagePrediction.java @@ -0,0 +1,95 @@ +/** + * 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; +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ImagePrediction model. + */ +public class ImagePrediction { + /** + * The id property. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private UUID id; + + /** + * The project property. + */ + @JsonProperty(value = "project", access = JsonProperty.Access.WRITE_ONLY) + private UUID project; + + /** + * The iteration property. + */ + @JsonProperty(value = "iteration", access = JsonProperty.Access.WRITE_ONLY) + private UUID iteration; + + /** + * The created property. + */ + @JsonProperty(value = "created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The predictions property. + */ + @JsonProperty(value = "predictions", access = JsonProperty.Access.WRITE_ONLY) + private List predictions; + + /** + * Get the id value. + * + * @return the id value + */ + public UUID id() { + return this.id; + } + + /** + * Get the project value. + * + * @return the project value + */ + public UUID project() { + return this.project; + } + + /** + * Get the iteration value. + * + * @return the iteration value + */ + public UUID iteration() { + return this.iteration; + } + + /** + * Get the created value. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the predictions value. + * + * @return the predictions value + */ + public List predictions() { + return this.predictions; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ImageUrl.java b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ImageUrl.java new file mode 100644 index 000000000000..079b6e21446e --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/ImageUrl.java @@ -0,0 +1,43 @@ +/** + * 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 ImageUrl model. + */ +public class ImageUrl { + /** + * The url property. + */ + @JsonProperty(value = "url") + private String url; + + /** + * 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 ImageUrl object itself. + */ + public ImageUrl withUrl(String url) { + this.url = url; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/PredictImageOptionalParameter.java b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/PredictImageOptionalParameter.java new file mode 100644 index 000000000000..168100eb079f --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/PredictImageOptionalParameter.java @@ -0,0 +1,94 @@ +/** + * 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 PredictImageOptionalParameter 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; + + /** + * 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 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. + * + * @return the application value + */ + public String application() { + return this.application; + } + + /** + * Set the application value. + * + * @param application the application value to set + * @return the PredictImageOptionalParameter object itself. + */ + public PredictImageOptionalParameter 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 PredictImageOptionalParameter object itself. + */ + public PredictImageOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/PredictImageUrlOptionalParameter.java b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/PredictImageUrlOptionalParameter.java new file mode 100644 index 000000000000..f43803123183 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/PredictImageUrlOptionalParameter.java @@ -0,0 +1,119 @@ +/** + * 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/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/PredictImageUrlWithNoStoreOptionalParameter.java b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/PredictImageUrlWithNoStoreOptionalParameter.java new file mode 100644 index 000000000000..9a9bf26f8407 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/PredictImageUrlWithNoStoreOptionalParameter.java @@ -0,0 +1,119 @@ +/** + * 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/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/PredictImageWithNoStoreOptionalParameter.java b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/PredictImageWithNoStoreOptionalParameter.java new file mode 100644 index 000000000000..e5235494089b --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/PredictImageWithNoStoreOptionalParameter.java @@ -0,0 +1,94 @@ +/** + * 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 PredictImageWithNoStoreOptionalParameter 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; + + /** + * 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 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. + * + * @return the application value + */ + public String application() { + return this.application; + } + + /** + * Set the application value. + * + * @param application the application value to set + * @return the PredictImageWithNoStoreOptionalParameter object itself. + */ + public PredictImageWithNoStoreOptionalParameter 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 PredictImageWithNoStoreOptionalParameter object itself. + */ + public PredictImageWithNoStoreOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/Prediction.java b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/Prediction.java new file mode 100644 index 000000000000..1735949fc348 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/Prediction.java @@ -0,0 +1,78 @@ +/** + * 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; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Prediction model. + */ +public class Prediction { + /** + * The probability property. + */ + @JsonProperty(value = "probability", access = JsonProperty.Access.WRITE_ONLY) + private double probability; + + /** + * The tagId property. + */ + @JsonProperty(value = "tagId", access = JsonProperty.Access.WRITE_ONLY) + private UUID tagId; + + /** + * The tagName property. + */ + @JsonProperty(value = "tagName", access = JsonProperty.Access.WRITE_ONLY) + private String tagName; + + /** + * The boundingBox property. + */ + @JsonProperty(value = "boundingBox", access = JsonProperty.Access.WRITE_ONLY) + private BoundingBox boundingBox; + + /** + * Get the probability value. + * + * @return the probability value + */ + public double probability() { + return this.probability; + } + + /** + * Get the tagId value. + * + * @return the tagId value + */ + public UUID tagId() { + return this.tagId; + } + + /** + * Get the tagName value. + * + * @return the tagName value + */ + public String tagName() { + return this.tagName; + } + + /** + * Get the boundingBox value. + * + * @return the boundingBox value + */ + public BoundingBox boundingBox() { + return this.boundingBox; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/package-info.java b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/package-info.java new file mode 100644 index 000000000000..3a76c984fb2a --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/models/package-info.java @@ -0,0 +1,10 @@ +// 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. + +/** + * This package contains the models classes for PredictionEndpoint. + */ +package com.microsoft.azure.cognitiveservices.vision.customvision.prediction.models; diff --git a/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/package-info.java b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/package-info.java new file mode 100644 index 000000000000..b44683ce86ed --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/package-info.java @@ -0,0 +1,10 @@ +// 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. + +/** + * This package contains the classes for PredictionEndpoint. + */ +package com.microsoft.azure.cognitiveservices.vision.customvision.prediction; diff --git a/cognitiveservices/data-plane/vision/customvision/training/pom.xml b/cognitiveservices/data-plane/vision/customvision/training/pom.xml new file mode 100644 index 000000000000..9330c16a23f7 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/pom.xml @@ -0,0 +1,91 @@ + + + 4.0.0 + + com.microsoft.azure.cognitiveservices + azure-cognitiveservices-parent + 1.0.2 + ../../../pom.xml + + azure-cognitiveservices-customvision-training + 1.0.2-beta + jar + Microsoft Azure SDK for Cognitive Service Custom Vision Training + This package contains Microsoft Cognitive Service Custom Vision Training SDK. + https://github.com/Azure/azure-sdk-for-java/cognitiveservices/data-plane/vision/customvision/training + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + UTF-8 + + + + + microsoft + Microsoft + + + + + ossrh + Sonatype Snapshots + https://oss.sonatype.org/content/repositories/snapshots/ + true + default + + + + + com.microsoft.azure + azure-client-runtime + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
\ No newline at end of file diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/TrainingApi.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/TrainingApi.java new file mode 100644 index 000000000000..9e411daf1695 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/TrainingApi.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.cognitiveservices.vision.customvision.training; + +import com.microsoft.azure.AzureClient; +import com.microsoft.rest.RestClient; + +/** + * The interface for TrainingApi class. + */ +public interface TrainingApi { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + AzureClient getAzureClient(); + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + String userAgent(); + + /** + * Gets . + * + * @return the apiKey value. + */ + String apiKey(); + + /** + * Sets . + * + * @param apiKey the apiKey value. + * @return the service client itself + */ + TrainingApi withApiKey(String apiKey); + + /** + * Gets Gets or sets the preferred language for the response.. + * + * @return the acceptLanguage value. + */ + String acceptLanguage(); + + /** + * Sets Gets or sets the preferred language for the response.. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + TrainingApi withAcceptLanguage(String acceptLanguage); + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @return the longRunningOperationRetryTimeout value. + */ + int longRunningOperationRetryTimeout(); + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + TrainingApi 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.. + * + * @return the generateClientRequestId value. + */ + boolean generateClientRequestId(); + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + TrainingApi withGenerateClientRequestId(boolean generateClientRequestId); + + /** + * Gets the Trainings object to access its operations. + * @return the Trainings object. + */ + Trainings trainings(); + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/Trainings.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/Trainings.java new file mode 100644 index 000000000000..0e05ac114c5a --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/Trainings.java @@ -0,0 +1,2523 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.cognitiveservices.vision.customvision.training; + +import com.microsoft.azure.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.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.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.Image; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageCreateSummary; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageFileCreateBatch; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageIdCreateBatch; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImagePerformance; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImagePrediction; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageRegionCreateEntry; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageRegionCreateSummary; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageRegionProposal; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageTagCreateEntry; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageTagCreateSummary; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageUrlCreateBatch; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.Iteration; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.IterationPerformance; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.PredictionQueryResult; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.PredictionQueryToken; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.Project; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.Tag; +import java.util.List; +import java.util.UUID; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Trainings. + */ +public interface Trainings { + /** + * Create a tag for the project. + * + * @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 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); + + /** + * Create a tag for the project. + * + * @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 + */ + @Deprecated + Observable createTagAsync(UUID projectId, String name, CreateTagOptionalParameter createTagOptionalParameter); + + /** + * Create a tag for the project. + * + * @return the first stage of the createTag call + */ + TrainingsCreateTagDefinitionStages.WithProjectId createTag(); + + /** + * Grouping of createTag definition stages. + */ + interface TrainingsCreateTagDefinitionStages { + /** + * The stage of the definition to be specify projectId. + */ + interface WithProjectId { + /** + * The project id. + * + * @return next definition stage + */ + WithName withProjectId(UUID projectId); + } + /** + * The stage of the definition to be specify name. + */ + interface WithName { + /** + * The tag name. + * + * @return next definition stage + */ + TrainingsCreateTagDefinitionStages.WithExecute withName(String name); + } + + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + interface WithAllOptions { + /** + * Optional description for the tag. + * + * @return next definition stage + */ + TrainingsCreateTagDefinitionStages.WithExecute withDescription(String description); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends TrainingsCreateTagDefinitionStages.WithAllOptions { + /** + * Execute the request. + * + * @return the Tag object if successful. + */ + Tag execute(); + + /** + * Execute the request asynchronously. + * + * @return the observable to the Tag object + */ + Observable executeAsync(); + } + } + + /** + * The entirety of createTag definition. + */ + interface TrainingsCreateTagDefinition extends + TrainingsCreateTagDefinitionStages.WithProjectId, + TrainingsCreateTagDefinitionStages.WithName, + TrainingsCreateTagDefinitionStages.WithExecute { + } + + /** + * Get the tags for a given project and iteration. + * + * @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 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); + + /** + * Get the tags for a given project and iteration. + * + * @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 + */ + @Deprecated + Observable> getTagsAsync(UUID projectId, GetTagsOptionalParameter getTagsOptionalParameter); + + /** + * Get the tags for a given project and iteration. + * + * @return the first stage of the getTags call + */ + TrainingsGetTagsDefinitionStages.WithProjectId getTags(); + + /** + * Grouping of getTags definition stages. + */ + interface TrainingsGetTagsDefinitionStages { + /** + * The stage of the definition to be specify projectId. + */ + interface WithProjectId { + /** + * The project id. + * + * @return next definition stage + */ + TrainingsGetTagsDefinitionStages.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 + */ + TrainingsGetTagsDefinitionStages.WithExecute withIterationId(UUID iterationId); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends TrainingsGetTagsDefinitionStages.WithAllOptions { + /** + * Execute the request. + * + * @return the List<Tag> object if successful. + */ + List execute(); + + /** + * Execute the request asynchronously. + * + * @return the observable to the List<Tag> object + */ + Observable> executeAsync(); + } + } + + /** + * The entirety of getTags definition. + */ + interface TrainingsGetTagsDefinition extends + TrainingsGetTagsDefinitionStages.WithProjectId, + TrainingsGetTagsDefinitionStages.WithExecute { + } + + + /** + * Update a tag. + * + * @param projectId The project id. + * @param tagId The id of the target tag. + * @param updatedTag The updated tag model. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Tag object if successful. + */ + Tag updateTag(UUID projectId, UUID tagId, Tag updatedTag); + + /** + * Update a tag. + * + * @param projectId The project id. + * @param tagId The id of the target tag. + * @param updatedTag The updated tag model. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Tag object + */ + Observable updateTagAsync(UUID projectId, UUID tagId, Tag updatedTag); + + + + /** + * Delete a tag from the project. + * + * @param projectId The project id. + * @param tagId Id of the tag to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void deleteTag(UUID projectId, UUID tagId); + + /** + * Delete a tag from the project. + * + * @param projectId The project id. + * @param tagId Id of the tag to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return a representation of the deferred computation of this call if successful. + */ + Observable deleteTagAsync(UUID projectId, UUID tagId); + + + /** + * Get information about a specific tag. + * + * @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 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); + + /** + * Get information about a specific tag. + * + * @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 + */ + @Deprecated + Observable getTagAsync(UUID projectId, UUID tagId, GetTagOptionalParameter getTagOptionalParameter); + + /** + * Get information about a specific tag. + * + * @return the first stage of the getTag call + */ + TrainingsGetTagDefinitionStages.WithProjectId getTag(); + + /** + * Grouping of getTag definition stages. + */ + interface TrainingsGetTagDefinitionStages { + /** + * The stage of the definition to be specify projectId. + */ + interface WithProjectId { + /** + * The project this tag belongs to. + * + * @return next definition stage + */ + WithTagId withProjectId(UUID projectId); + } + /** + * The stage of the definition to be specify tagId. + */ + interface WithTagId { + /** + * The tag id. + * + * @return next definition stage + */ + TrainingsGetTagDefinitionStages.WithExecute withTagId(UUID tagId); + } + + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + interface WithAllOptions { + /** + * The iteration to retrieve this tag from. Optional, defaults to current training set. + * + * @return next definition stage + */ + TrainingsGetTagDefinitionStages.WithExecute withIterationId(UUID iterationId); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends TrainingsGetTagDefinitionStages.WithAllOptions { + /** + * Execute the request. + * + * @return the Tag object if successful. + */ + Tag execute(); + + /** + * Execute the request asynchronously. + * + * @return the observable to the Tag object + */ + Observable executeAsync(); + } + } + + /** + * The entirety of getTag definition. + */ + interface TrainingsGetTagDefinition extends + TrainingsGetTagDefinitionStages.WithProjectId, + TrainingsGetTagDefinitionStages.WithTagId, + TrainingsGetTagDefinitionStages.WithExecute { + } + + /** + * 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 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 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); + + /** + * 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 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); + + /** + * Export a trained iteration. + * + * @return the first stage of the exportIteration call + */ + TrainingsExportIterationDefinitionStages.WithProjectId exportIteration(); + + /** + * Grouping of exportIteration definition stages. + */ + interface TrainingsExportIterationDefinitionStages { + /** + * 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. + * + * @return next definition stage + */ + WithPlatform withIterationId(UUID iterationId); + } + /** + * The stage of the definition to be specify platform. + */ + interface WithPlatform { + /** + * The target platform (coreml or tensorflow). Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', + * 'ONNX'. + * + * @return next definition stage + */ + TrainingsExportIterationDefinitionStages.WithExecute withPlatform(String platform); + } + + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + interface WithAllOptions { + /** + * The flavor of the target platform (Windows, Linux, ARM, or GPU). Possible values include: 'Linux', + * 'Windows'. + * + * @return next definition stage + */ + TrainingsExportIterationDefinitionStages.WithExecute withFlavor(String flavor); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends TrainingsExportIterationDefinitionStages.WithAllOptions { + /** + * Execute the request. + * + * @return the Export object if successful. + */ + Export execute(); + + /** + * Execute the request asynchronously. + * + * @return the observable to the Export object + */ + Observable executeAsync(); + } + } + + /** + * The entirety of exportIteration definition. + */ + interface TrainingsExportIterationDefinition extends + TrainingsExportIterationDefinitionStages.WithProjectId, + TrainingsExportIterationDefinitionStages.WithIterationId, + TrainingsExportIterationDefinitionStages.WithPlatform, + TrainingsExportIterationDefinitionStages.WithExecute { + } + + + /** + * Get the list of exports for a specific iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Export> object if successful. + */ + List getExports(UUID projectId, UUID iterationId); + + /** + * Get the list of exports for a specific iteration. + * + * @param projectId The project id. + * @param iterationId The iteration id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Export> object + */ + 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. + * + * @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 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); + + /** + * 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 + */ + @Deprecated + 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 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 + */ + TrainingsGetImagePerformanceCountDefinitionStages.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 to count. Defaults to all tags when null. + * + * @return next definition stage + */ + TrainingsGetImagePerformanceCountDefinitionStages.WithExecute withTagIds(List tagIds); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends TrainingsGetImagePerformanceCountDefinitionStages.WithAllOptions { + /** + * Execute the request. + * + * @return the int object if successful. + */ + int execute(); + + /** + * Execute the request asynchronously. + * + * @return the observable to the int object + */ + Observable executeAsync(); + } + } + + /** + * The entirety of getImagePerformanceCount definition. + */ + interface TrainingsGetImagePerformanceCountDefinition extends + TrainingsGetImagePerformanceCountDefinitionStages.WithProjectId, + TrainingsGetImagePerformanceCountDefinitionStages.WithIterationId, + TrainingsGetImagePerformanceCountDefinitionStages.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. + * + * @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 RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ImagePerformance> object if successful. + */ + @Deprecated + List getImagePerformances(UUID projectId, UUID iterationId, GetImagePerformancesOptionalParameter getImagePerformancesOptionalParameter); + + /** + * 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 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 List<ImagePerformance> object + */ + @Deprecated + Observable> getImagePerformancesAsync(UUID projectId, UUID iterationId, GetImagePerformancesOptionalParameter getImagePerformancesOptionalParameter); + + /** + * 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. + * + * @return the first stage of the getImagePerformances call + */ + TrainingsGetImagePerformancesDefinitionStages.WithProjectId getImagePerformances(); + + /** + * Grouping of getImagePerformances definition stages. + */ + 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); + + /** + * Maximum number of images to return. Defaults to 50, limited to 256. + * + * @return next definition stage + */ + TrainingsGetImagePerformancesDefinitionStages.WithExecute withTake(Integer take); + + /** + * 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(); + + /** + * Execute the request asynchronously. + * + * @return the observable to the List<ImagePerformance> object + */ + Observable> executeAsync(); + } + } + + /** + * The entirety of getImagePerformances definition. + */ + interface TrainingsGetImagePerformancesDefinition extends + TrainingsGetImagePerformancesDefinitionStages.WithProjectId, + TrainingsGetImagePerformancesDefinitionStages.WithIterationId, + TrainingsGetImagePerformancesDefinitionStages.WithExecute { + } + + /** + * 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 RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IterationPerformance object if successful. + */ + @Deprecated + IterationPerformance getIterationPerformance(UUID projectId, UUID iterationId, GetIterationPerformanceOptionalParameter getIterationPerformanceOptionalParameter); + + /** + * 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 IterationPerformance object + */ + @Deprecated + Observable getIterationPerformanceAsync(UUID projectId, UUID iterationId, GetIterationPerformanceOptionalParameter getIterationPerformanceOptionalParameter); + + /** + * Get detailed performance information about an iteration. + * + * @return the first stage of the getIterationPerformance call + */ + TrainingsGetIterationPerformanceDefinitionStages.WithProjectId getIterationPerformance(); + + /** + * Grouping of getIterationPerformance definition stages. + */ + interface TrainingsGetIterationPerformanceDefinitionStages { + /** + * The stage of the definition to be specify projectId. + */ + interface WithProjectId { + /** + * The id of the project the iteration belongs to. + * + * @return next definition stage + */ + WithIterationId withProjectId(UUID projectId); + } + /** + * The stage of the definition to be specify iterationId. + */ + interface WithIterationId { + /** + * The id of the iteration to get. + * + * @return next definition stage + */ + TrainingsGetIterationPerformanceDefinitionStages.WithExecute withIterationId(UUID iterationId); + } + + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + 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. + * + * @return next definition stage + */ + TrainingsGetIterationPerformanceDefinitionStages.WithExecute withOverlapThreshold(Double overlapThreshold); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends TrainingsGetIterationPerformanceDefinitionStages.WithAllOptions { + /** + * Execute the request. + * + * @return the IterationPerformance object if successful. + */ + IterationPerformance execute(); + + /** + * Execute the request asynchronously. + * + * @return the observable to the IterationPerformance object + */ + Observable executeAsync(); + } + } + + /** + * The entirety of getIterationPerformance definition. + */ + interface TrainingsGetIterationPerformanceDefinition extends + TrainingsGetIterationPerformanceDefinitionStages.WithProjectId, + TrainingsGetIterationPerformanceDefinitionStages.WithIterationId, + TrainingsGetIterationPerformanceDefinitionStages.WithExecute { + } + + + /** + * Update a specific iteration. + * + * @param projectId Project id. + * @param iterationId Iteration id. + * @param updatedIteration The updated iteration model. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Iteration object if successful. + */ + Iteration updateIteration(UUID projectId, UUID iterationId, Iteration updatedIteration); + + /** + * Update a specific iteration. + * + * @param projectId Project id. + * @param iterationId Iteration id. + * @param updatedIteration The updated iteration model. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Iteration object + */ + Observable updateIterationAsync(UUID projectId, UUID iterationId, Iteration updatedIteration); + + + + /** + * 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. + * + * @param projectId The id of the project to update. + * @param updatedProject The updated project model. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Project object if successful. + */ + Project updateProject(UUID projectId, Project updatedProject); + + /** + * Update a specific project. + * + * @param projectId The id of the project to update. + * @param updatedProject The updated project model. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Project object + */ + Observable updateProjectAsync(UUID projectId, Project updatedProject); + + + + /** + * Delete a specific project. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void deleteProject(UUID projectId); + + /** + * Delete a specific project. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return a representation of the deferred computation of this call if successful. + */ + 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Project object if successful. + */ + Project getProject(UUID projectId); + + /** + * Get a specific project. + * + * @param projectId The id of the project to get. + * @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 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. + */ + @Deprecated + 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 + */ + @Deprecated + 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 name. + */ + interface WithName { + /** + * Name of the project. + * + * @return next definition stage + */ + TrainingsCreateProjectDefinitionStages.WithExecute withName(String name); + } + + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + interface WithAllOptions { + /** + * The description of the project. + * + * @return next definition stage + */ + TrainingsCreateProjectDefinitionStages.WithExecute withDescription(String description); + + /** + * The id of the domain to use for this project. Defaults to General. + * + * @return next definition stage + */ + TrainingsCreateProjectDefinitionStages.WithExecute withDomainId(UUID domainId); + + /** + * The type of classifier to create for this project. Possible values include: 'Multiclass', 'Multilabel'. + * + * @return next definition stage + */ + TrainingsCreateProjectDefinitionStages.WithExecute withClassificationType(String classificationType); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends TrainingsCreateProjectDefinitionStages.WithAllOptions { + /** + * Execute the request. + * + * @return the Project object if successful. + */ + Project execute(); + + /** + * Execute the request asynchronously. + * + * @return the observable to the Project object + */ + Observable executeAsync(); + } + } + + /** + * The entirety of createProject definition. + */ + interface TrainingsCreateProjectDefinition extends + TrainingsCreateProjectDefinitionStages.WithName, + TrainingsCreateProjectDefinitionStages.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. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Iteration object if successful. + */ + Iteration trainProject(UUID projectId); + + /** + * Queues project for training. + * + * @param projectId The project id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Iteration object + */ + Observable trainProjectAsync(UUID projectId); + + + /** + * Quick test an image. + * + * @param projectId The project id. + * @param imageData the InputStream value. + * @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 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 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); + + /** + * Quick test an image. + * + * @return the first stage of the quickTestImage call + */ + TrainingsQuickTestImageDefinitionStages.WithProjectId quickTestImage(); + + /** + * Grouping of quickTestImage definition stages. + */ + interface TrainingsQuickTestImageDefinitionStages { + /** + * 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 { + /** + * + * + * @return next definition stage + */ + TrainingsQuickTestImageDefinitionStages.WithExecute withImageData(byte[] imageData); + } + + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + 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. + * + * @return next definition stage + */ + TrainingsQuickTestImageDefinitionStages.WithExecute withIterationId(UUID iterationId); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends TrainingsQuickTestImageDefinitionStages.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 quickTestImage definition. + */ + interface TrainingsQuickTestImageDefinition extends + TrainingsQuickTestImageDefinitionStages.WithProjectId, + TrainingsQuickTestImageDefinitionStages.WithImageData, + TrainingsQuickTestImageDefinitionStages.WithExecute { + } + + /** + * Quick test an image url. + * + * @param projectId The project to evaluate against. + * @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 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); + + /** + * Quick test an image url. + * + * @param projectId The project to evaluate against. + * @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); + + /** + * Quick test an image url. + * + * @return the first stage of the quickTestImageUrl call + */ + TrainingsQuickTestImageUrlDefinitionStages.WithProjectId quickTestImageUrl(); + + /** + * Grouping of quickTestImageUrl definition stages. + */ + interface TrainingsQuickTestImageUrlDefinitionStages { + /** + * The stage of the definition to be specify projectId. + */ + interface WithProjectId { + /** + * The project to evaluate against. + * + * @return next definition stage + */ + TrainingsQuickTestImageUrlDefinitionStages.WithExecute withProjectId(UUID projectId); + } + + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + 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. + * + * @return next definition stage + */ + TrainingsQuickTestImageUrlDefinitionStages.WithExecute withIterationId(UUID iterationId); + + /** + * + * + * @return next definition stage + */ + TrainingsQuickTestImageUrlDefinitionStages.WithExecute withUrl(String url); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends TrainingsQuickTestImageUrlDefinitionStages.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 quickTestImageUrl definition. + */ + interface TrainingsQuickTestImageUrlDefinition extends + TrainingsQuickTestImageUrlDefinitionStages.WithProjectId, + 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 RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void deletePrediction(UUID projectId, List ids); + + /** + * Delete a set of predicted images and their associated prediction results. + * + * @param projectId The project id. + * @param ids The prediction ids. Limited to 64. + * @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); + + + + /** + * Get region proposals for an image. Returns empty array if no proposals are found. + * This API will get region proposals for an image along with confidences for the region. It returns + * an empty array if no proposals are found. + * + * @param projectId The project id. + * @param imageId The image id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageRegionProposal object if successful. + */ + ImageRegionProposal getImageRegionProposals(UUID projectId, UUID imageId); + + /** + * Get region proposals for an image. Returns empty array if no proposals are found. + * This API will get region proposals for an image along with confidences for the region. It returns + * an empty array if no proposals are found. + * + * @param projectId The project id. + * @param imageId The image id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageRegionProposal object + */ + Observable getImageRegionProposalsAsync(UUID projectId, UUID imageId); + + + + /** + * Delete a set of image regions. + * + * @param projectId The project id. + * @param regionIds Regions to delete. Limited to 64. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void deleteImageRegions(UUID projectId, List regionIds); + + /** + * Delete a set of image regions. + * + * @param projectId The project id. + * @param regionIds Regions to delete. Limited to 64. + * @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); + + + /** + * 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 RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageRegionCreateSummary object if successful. + */ + @Deprecated + ImageRegionCreateSummary createImageRegions(UUID projectId, CreateImageRegionsOptionalParameter createImageRegionsOptionalParameter); + + /** + * 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 + * @return the observable to the ImageRegionCreateSummary object + */ + @Deprecated + Observable createImageRegionsAsync(UUID projectId, CreateImageRegionsOptionalParameter createImageRegionsOptionalParameter); + + /** + * 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 createImageRegions call + */ + TrainingsCreateImageRegionsDefinitionStages.WithProjectId createImageRegions(); + + /** + * Grouping of createImageRegions definition stages. + */ + interface TrainingsCreateImageRegionsDefinitionStages { + /** + * The stage of the definition to be specify projectId. + */ + interface WithProjectId { + /** + * The project id. + * + * @return next definition stage + */ + TrainingsCreateImageRegionsDefinitionStages.WithExecute withProjectId(UUID projectId); + } + + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + interface WithAllOptions { + /** + * + * + * @return next definition stage + */ + TrainingsCreateImageRegionsDefinitionStages.WithExecute withRegions(List regions); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends TrainingsCreateImageRegionsDefinitionStages.WithAllOptions { + /** + * Execute the request. + * + * @return the ImageRegionCreateSummary object if successful. + */ + ImageRegionCreateSummary execute(); + + /** + * Execute the request asynchronously. + * + * @return the observable to the ImageRegionCreateSummary object + */ + Observable executeAsync(); + } + } + + /** + * The entirety of createImageRegions definition. + */ + interface TrainingsCreateImageRegionsDefinition extends + TrainingsCreateImageRegionsDefinitionStages.WithProjectId, + TrainingsCreateImageRegionsDefinitionStages.WithExecute { + } + + + /** + * 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 + */ + void deleteImageTags(UUID projectId, List imageIds, List tagIds); + + /** + * Remove a set of tags from a set of images. + * + * @param projectId The project id. + * @param imageIds Image ids. Limited to 64 images. + * @param tagIds Tags to be deleted from the specified images. Limted to 20 tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return a representation of the deferred computation of this call if successful. + */ + Observable deleteImageTagsAsync(UUID projectId, List imageIds, List tagIds); + + + /** + * 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 + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageTagCreateSummary object if successful. + */ + @Deprecated + ImageTagCreateSummary createImageTags(UUID projectId, CreateImageTagsOptionalParameter createImageTagsOptionalParameter); + + /** + * 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 + */ + @Deprecated + 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. + */ + interface WithProjectId { + /** + * The project id. + * + * @return next definition stage + */ + TrainingsCreateImageTagsDefinitionStages.WithExecute withProjectId(UUID projectId); + } + + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + interface WithAllOptions { + /** + * + * + * @return next definition stage + */ + TrainingsCreateImageTagsDefinitionStages.WithExecute withTags(List tags); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends TrainingsCreateImageTagsDefinitionStages.WithAllOptions { + /** + * Execute the request. + * + * @return the ImageTagCreateSummary object if successful. + */ + ImageTagCreateSummary execute(); + + /** + * Execute the request asynchronously. + * + * @return the observable to the ImageTagCreateSummary object + */ + Observable executeAsync(); + } + } + + /** + * The entirety of createImageTags definition. + */ + interface TrainingsCreateImageTagsDefinition extends + TrainingsCreateImageTagsDefinitionStages.WithProjectId, + TrainingsCreateImageTagsDefinitionStages.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. + * + * @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 + */ + 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. Limted 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 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 the InputStream value. + * @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 RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageCreateSummary object if successful. + */ + @Deprecated + 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 the InputStream value. + * @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 + */ + @Deprecated + 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 { + /** + * + * + * @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 { + } + + /** + * 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 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 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); + + /** + * 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 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 List<Image> object + */ + @Deprecated + Observable> getImagesByIdsAsync(UUID projectId, GetImagesByIdsOptionalParameter getImagesByIdsOptionalParameter); + + /** + * 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 getImagesByIds call + */ + TrainingsGetImagesByIdsDefinitionStages.WithProjectId getImagesByIds(); + + /** + * Grouping of getImagesByIds definition stages. + */ + interface TrainingsGetImagesByIdsDefinitionStages { + /** + * The stage of the definition to be specify projectId. + */ + interface WithProjectId { + /** + * The project id. + * + * @return next definition stage + */ + TrainingsGetImagesByIdsDefinitionStages.WithExecute withProjectId(UUID projectId); + } + + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + 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 + */ + TrainingsGetImagesByIdsDefinitionStages.WithExecute withIterationId(UUID iterationId); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends TrainingsGetImagesByIdsDefinitionStages.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 getImagesByIds definition. + */ + interface TrainingsGetImagesByIdsDefinition extends + TrainingsGetImagesByIdsDefinitionStages.WithProjectId, + TrainingsGetImagesByIdsDefinitionStages.WithExecute { + } + + /** + * 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 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 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); + + /** + * 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 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 int object + */ + @Deprecated + Observable getUntaggedImageCountAsync(UUID projectId, GetUntaggedImageCountOptionalParameter getUntaggedImageCountOptionalParameter); + + /** + * 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. + * + * @return the first stage of the getUntaggedImageCount call + */ + TrainingsGetUntaggedImageCountDefinitionStages.WithProjectId getUntaggedImageCount(); + + /** + * Grouping of getUntaggedImageCount definition stages. + */ + interface TrainingsGetUntaggedImageCountDefinitionStages { + /** + * The stage of the definition to be specify projectId. + */ + interface WithProjectId { + /** + * The project id. + * + * @return next definition stage + */ + TrainingsGetUntaggedImageCountDefinitionStages.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 + */ + TrainingsGetUntaggedImageCountDefinitionStages.WithExecute withIterationId(UUID iterationId); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends TrainingsGetUntaggedImageCountDefinitionStages.WithAllOptions { + /** + * Execute the request. + * + * @return the int object if successful. + */ + int execute(); + + /** + * Execute the request asynchronously. + * + * @return the observable to the int object + */ + Observable executeAsync(); + } + } + + /** + * The entirety of getUntaggedImageCount definition. + */ + interface TrainingsGetUntaggedImageCountDefinition extends + TrainingsGetUntaggedImageCountDefinitionStages.WithProjectId, + TrainingsGetUntaggedImageCountDefinitionStages.WithExecute { + } + + /** + * 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 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 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); + + /** + * 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 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 int object + */ + @Deprecated + Observable getTaggedImageCountAsync(UUID projectId, GetTaggedImageCountOptionalParameter getTaggedImageCountOptionalParameter); + + /** + * 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. + * + * @return the first stage of the getTaggedImageCount call + */ + TrainingsGetTaggedImageCountDefinitionStages.WithProjectId getTaggedImageCount(); + + /** + * Grouping of getTaggedImageCount definition stages. + */ + interface TrainingsGetTaggedImageCountDefinitionStages { + /** + * The stage of the definition to be specify projectId. + */ + interface WithProjectId { + /** + * The project id. + * + * @return next definition stage + */ + TrainingsGetTaggedImageCountDefinitionStages.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 + */ + TrainingsGetTaggedImageCountDefinitionStages.WithExecute withIterationId(UUID iterationId); + + /** + * A list of tags ids to filter the images to count. Defaults to all tags when null. + * + * @return next definition stage + */ + TrainingsGetTaggedImageCountDefinitionStages.WithExecute withTagIds(List tagIds); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends TrainingsGetTaggedImageCountDefinitionStages.WithAllOptions { + /** + * Execute the request. + * + * @return the int object if successful. + */ + int execute(); + + /** + * Execute the request asynchronously. + * + * @return the observable to the int object + */ + Observable executeAsync(); + } + } + + /** + * The entirety of getTaggedImageCount definition. + */ + interface TrainingsGetTaggedImageCountDefinition extends + TrainingsGetTaggedImageCountDefinitionStages.WithProjectId, + 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 RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Domain object if successful. + */ + Domain getDomain(UUID domainId); + + /** + * Get information about a specific domain. + * + * @param domainId The id of the domain to get information about. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Domain object + */ + Observable getDomainAsync(UUID domainId); + + + + /** + * Get a list of the available domains. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Domain> object if successful. + */ + List getDomains(); + + /** + * Get a list of the available domains. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Domain> object + */ + Observable> getDomainsAsync(); + + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingApiImpl.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingApiImpl.java new file mode 100644 index 000000000000..6f3f10fcb6b8 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingApiImpl.java @@ -0,0 +1,185 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.cognitiveservices.vision.customvision.training.implementation; + +import com.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.Trainings; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the TrainingApiImpl class. + */ +public class TrainingApiImpl extends AzureServiceClient implements TrainingApi { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The API key. */ + private String apiKey; + + /** + * Gets the API key. + * + * @return the apiKey value. + */ + public String apiKey() { + return this.apiKey; + } + + /** + * Sets the API key. + * + * @param apiKey the apiKey value. + * @return the service client itself + */ + public TrainingApiImpl withApiKey(String apiKey) { + this.apiKey = apiKey; + return this; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public TrainingApiImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public TrainingApiImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public TrainingApiImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The Trainings object to access its operations. + */ + private Trainings trainings; + + /** + * Gets the Trainings object to access its operations. + * @return the Trainings object. + */ + public Trainings trainings() { + return this.trainings; + } + + /** + * Initializes an instance of TrainingApi client. + * + * @param credentials the management credentials for Azure + */ + public TrainingApiImpl(ServiceClientCredentials credentials) { + this("https://southcentralus.api.cognitive.microsoft.com/customvision/v2.1/Training", credentials); + } + + /** + * Initializes an instance of TrainingApi client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public TrainingApiImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of TrainingApi client. + * + * @param restClient the REST client to connect to Azure. + */ + public TrainingApiImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.trainings = new TrainingsImpl(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "TrainingApi", "2.1"); + } +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java new file mode 100644 index 000000000000..dc65c44bcee9 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java @@ -0,0 +1,5312 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.cognitiveservices.vision.customvision.training.implementation; + +import com.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.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.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.Image; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageCreateSummary; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageFileCreateBatch; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageIdCreateBatch; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImagePerformance; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImagePrediction; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageRegionCreateBatch; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageRegionCreateEntry; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageRegionCreateSummary; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageRegionProposal; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageTagCreateBatch; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageTagCreateEntry; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageTagCreateSummary; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageUrl; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.ImageUrlCreateBatch; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.Iteration; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.IterationPerformance; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.PredictionQueryResult; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.PredictionQueryToken; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.Project; +import com.microsoft.azure.cognitiveservices.vision.customvision.training.models.Tag; +import com.microsoft.rest.CollectionFormat; +import com.microsoft.rest.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.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Multipart; +import retrofit2.http.Part; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Trainings. + */ +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; + + /** + * Initializes an instance of TrainingsImpl. + * + * @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) { + this.service = retrofit.create(TrainingsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Trainings to be + * used by Retrofit to perform actually REST calls. + */ + 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); + + @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); + + @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); + + @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); + + @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); + + @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); + + @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); + + @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 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 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); + + @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); + + @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); + + @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); + + @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); + + @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); + + @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); + + @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); + + @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); + + @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); + + @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); + + @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); + + @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); + + @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); + + @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); + + @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); + + @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); + + @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); + + @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); + + @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); + + @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); + + @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); + + @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); + + @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); + + } + + + /** + * Create a tag for the project. + * + * @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 RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Tag object if successful. + */ + public Tag createTag(UUID projectId, String name, CreateTagOptionalParameter createTagOptionalParameter) { + return createTagWithServiceResponseAsync(projectId, name, createTagOptionalParameter).toBlocking().single().body(); + } + + /** + * Create a tag for the project. + * + * @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 + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createTagAsync(UUID projectId, String name, CreateTagOptionalParameter createTagOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createTagWithServiceResponseAsync(projectId, name, createTagOptionalParameter), serviceCallback); + } + + /** + * Create a tag for the project. + * + * @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 createTagAsync(UUID projectId, String name, CreateTagOptionalParameter createTagOptionalParameter) { + return createTagWithServiceResponseAsync(projectId, name, createTagOptionalParameter).map(new Func1, Tag>() { + @Override + public Tag call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a tag for the project. + * + * @param projectId The project id + * @param name The tag name + * @param 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 (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); + } + final String description = createTagOptionalParameter != null ? createTagOptionalParameter.description() : null; + + return createTagWithServiceResponseAsync(projectId, name, description); + } + + /** + * Create a tag for the project. + * + * @param projectId The project id + * @param name The tag name + * @param description Optional description for the tag + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Tag object + */ + public Observable> createTagWithServiceResponseAsync(UUID projectId, String name, String description) { + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createTagDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createTagDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + @Override + public TrainingsCreateTagParameters createTag() { + return new TrainingsCreateTagParameters(this); + } + + /** + * Internal class implementing TrainingsCreateTagDefinition. + */ + class TrainingsCreateTagParameters implements TrainingsCreateTagDefinition { + private TrainingsImpl parent; + private UUID projectId; + private String name; + private String description; + + /** + * Constructor. + * @param parent the parent object. + */ + TrainingsCreateTagParameters(TrainingsImpl parent) { + this.parent = parent; + } + + @Override + public TrainingsCreateTagParameters withProjectId(UUID projectId) { + this.projectId = projectId; + return this; + } + + @Override + public TrainingsCreateTagParameters withName(String name) { + this.name = name; + return this; + } + + @Override + public TrainingsCreateTagParameters withDescription(String description) { + this.description = description; + return this; + } + + @Override + public Tag execute() { + return createTagWithServiceResponseAsync(projectId, name, description).toBlocking().single().body(); + } + + @Override + public Observable executeAsync() { + return createTagWithServiceResponseAsync(projectId, name, description).map(new Func1, Tag>() { + @Override + public Tag call(ServiceResponse response) { + return response.body(); + } + }); + } + } + + + /** + * Get the tags for a given project and iteration. + * + * @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 RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Tag> object if successful. + */ + public List getTags(UUID projectId, GetTagsOptionalParameter getTagsOptionalParameter) { + return getTagsWithServiceResponseAsync(projectId, getTagsOptionalParameter).toBlocking().single().body(); + } + + /** + * Get the tags for a given project and iteration. + * + * @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 + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getTagsAsync(UUID projectId, GetTagsOptionalParameter getTagsOptionalParameter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getTagsWithServiceResponseAsync(projectId, getTagsOptionalParameter), serviceCallback); + } + + /** + * Get the tags for a given project and iteration. + * + * @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> getTagsAsync(UUID projectId, GetTagsOptionalParameter getTagsOptionalParameter) { + return getTagsWithServiceResponseAsync(projectId, getTagsOptionalParameter).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the tags for a given project and iteration. + * + * @param projectId The project id + * @param 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 (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 = getTagsOptionalParameter != null ? getTagsOptionalParameter.iterationId() : null; + + return getTagsWithServiceResponseAsync(projectId, iterationId); + } + + /** + * Get the tags for a given project and iteration. + * + * @param projectId The project id + * @param iterationId The iteration id. Defaults to workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Tag> object + */ + public Observable>> getTagsWithServiceResponseAsync(UUID projectId, UUID iterationId) { + 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()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + @Override + public TrainingsGetTagsParameters getTags() { + return new TrainingsGetTagsParameters(this); + } + + /** + * Internal class implementing TrainingsGetTagsDefinition. + */ + class TrainingsGetTagsParameters implements TrainingsGetTagsDefinition { + private TrainingsImpl parent; + private UUID projectId; + private UUID iterationId; + + /** + * Constructor. + * @param parent the parent object. + */ + TrainingsGetTagsParameters(TrainingsImpl parent) { + this.parent = parent; + } + + @Override + public TrainingsGetTagsParameters withProjectId(UUID projectId) { + this.projectId = projectId; + return this; + } + + @Override + public TrainingsGetTagsParameters withIterationId(UUID iterationId) { + this.iterationId = iterationId; + return this; + } + + @Override + public List execute() { + return getTagsWithServiceResponseAsync(projectId, iterationId).toBlocking().single().body(); + } + + @Override + public Observable> executeAsync() { + return getTagsWithServiceResponseAsync(projectId, iterationId).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + } + + /** + * Update a tag. + * + * @param projectId The project id + * @param tagId The id of the target tag + * @param updatedTag The updated tag model + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Tag object if successful. + */ + public Tag updateTag(UUID projectId, UUID tagId, Tag updatedTag) { + return updateTagWithServiceResponseAsync(projectId, tagId, updatedTag).toBlocking().single().body(); + } + + /** + * Update a tag. + * + * @param projectId The project id + * @param tagId The id of the target tag + * @param updatedTag The updated tag model + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagAsync(UUID projectId, UUID tagId, Tag updatedTag, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagWithServiceResponseAsync(projectId, tagId, updatedTag), serviceCallback); + } + + /** + * Update a tag. + * + * @param projectId The project id + * @param tagId The id of the target tag + * @param updatedTag The updated tag model + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Tag object + */ + public Observable updateTagAsync(UUID projectId, UUID tagId, Tag updatedTag) { + return updateTagWithServiceResponseAsync(projectId, tagId, updatedTag).map(new Func1, Tag>() { + @Override + public Tag call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a tag. + * + * @param projectId The project id + * @param tagId The id of the target tag + * @param updatedTag The updated tag model + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Tag object + */ + public Observable> updateTagWithServiceResponseAsync(UUID projectId, UUID tagId, Tag updatedTag) { + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (tagId == null) { + throw new IllegalArgumentException("Parameter tagId is required and cannot be null."); + } + if (updatedTag == null) { + throw new IllegalArgumentException("Parameter updatedTag is required and cannot be null."); + } + if (this.client.apiKey() == null) { + 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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateTagDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateTagDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete a tag from the project. + * + * @param projectId The project id + * @param tagId Id of the tag to be deleted + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteTag(UUID projectId, UUID tagId) { + deleteTagWithServiceResponseAsync(projectId, tagId).toBlocking().single().body(); + } + + /** + * Delete a tag from the project. + * + * @param projectId The project id + * @param tagId Id of the tag to be deleted + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteTagAsync(UUID projectId, UUID tagId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteTagWithServiceResponseAsync(projectId, tagId), serviceCallback); + } + + /** + * Delete a tag from the project. + * + * @param projectId The project id + * @param tagId Id of the tag to be deleted + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteTagAsync(UUID projectId, UUID tagId) { + return deleteTagWithServiceResponseAsync(projectId, tagId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a tag from the project. + * + * @param projectId The project id + * @param tagId Id of the tag to be deleted + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteTagWithServiceResponseAsync(UUID projectId, UUID tagId) { + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (tagId == null) { + throw new IllegalArgumentException("Parameter tagId is required and cannot be null."); + } + if (this.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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteTagDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteTagDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + + /** + * Get information about a specific tag. + * + * @param projectId The project this tag belongs to + * @param tagId The tag id + * @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 RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Tag object if successful. + */ + public Tag getTag(UUID projectId, UUID tagId, GetTagOptionalParameter getTagOptionalParameter) { + return getTagWithServiceResponseAsync(projectId, tagId, getTagOptionalParameter).toBlocking().single().body(); + } + + /** + * Get information about a specific tag. + * + * @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 + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getTagAsync(UUID projectId, UUID tagId, GetTagOptionalParameter getTagOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getTagWithServiceResponseAsync(projectId, tagId, getTagOptionalParameter), serviceCallback); + } + + /** + * Get information about a specific tag. + * + * @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 getTagAsync(UUID projectId, UUID tagId, GetTagOptionalParameter getTagOptionalParameter) { + return getTagWithServiceResponseAsync(projectId, tagId, getTagOptionalParameter).map(new Func1, Tag>() { + @Override + public Tag call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get information about a specific tag. + * + * @param projectId The project this tag belongs to + * @param tagId The tag id + * @param 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 (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (tagId == null) { + throw new IllegalArgumentException("Parameter tagId is required and cannot be null."); + } + if (this.client.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); + } + final UUID iterationId = getTagOptionalParameter != null ? getTagOptionalParameter.iterationId() : null; + + return getTagWithServiceResponseAsync(projectId, tagId, iterationId); + } + + /** + * Get information about a specific tag. + * + * @param projectId The project this tag belongs to + * @param tagId The tag id + * @param iterationId The iteration to retrieve this tag from. Optional, defaults to current training set + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Tag object + */ + public Observable> getTagWithServiceResponseAsync(UUID projectId, UUID tagId, UUID iterationId) { + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (tagId == null) { + throw new IllegalArgumentException("Parameter tagId is required and cannot be null."); + } + if (this.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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getTagDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getTagDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + @Override + public TrainingsGetTagParameters getTag() { + return new TrainingsGetTagParameters(this); + } + + /** + * Internal class implementing TrainingsGetTagDefinition. + */ + class TrainingsGetTagParameters implements TrainingsGetTagDefinition { + private TrainingsImpl parent; + private UUID projectId; + private UUID tagId; + private UUID iterationId; + + /** + * Constructor. + * @param parent the parent object. + */ + TrainingsGetTagParameters(TrainingsImpl parent) { + this.parent = parent; + } + + @Override + public TrainingsGetTagParameters withProjectId(UUID projectId) { + this.projectId = projectId; + return this; + } + + @Override + public TrainingsGetTagParameters withTagId(UUID tagId) { + this.tagId = tagId; + return this; + } + + @Override + public TrainingsGetTagParameters withIterationId(UUID iterationId) { + this.iterationId = iterationId; + return this; + } + + @Override + public Tag execute() { + return getTagWithServiceResponseAsync(projectId, tagId, iterationId).toBlocking().single().body(); + } + + @Override + public Observable executeAsync() { + return getTagWithServiceResponseAsync(projectId, tagId, iterationId).map(new Func1, Tag>() { + @Override + public Tag call(ServiceResponse response) { + return response.body(); + } + }); + } + } + + + /** + * Export a trained iteration. + * + * @param projectId The project id + * @param iterationId The iteration id + * @param platform The target platform (coreml or tensorflow). Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX' + * @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 RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Export object if successful. + */ + public Export exportIteration(UUID projectId, UUID iterationId, String platform, ExportIterationOptionalParameter exportIterationOptionalParameter) { + return exportIterationWithServiceResponseAsync(projectId, iterationId, platform, exportIterationOptionalParameter).toBlocking().single().body(); + } + + /** + * 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 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 + * @return the {@link ServiceFuture} object + */ + public ServiceFuture exportIterationAsync(UUID projectId, UUID iterationId, String platform, ExportIterationOptionalParameter exportIterationOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(exportIterationWithServiceResponseAsync(projectId, iterationId, platform, exportIterationOptionalParameter), serviceCallback); + } + + /** + * 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 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 exportIterationAsync(UUID projectId, UUID iterationId, String platform, ExportIterationOptionalParameter exportIterationOptionalParameter) { + return exportIterationWithServiceResponseAsync(projectId, iterationId, platform, exportIterationOptionalParameter).map(new Func1, Export>() { + @Override + public Export call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Export a trained iteration. + * + * @param projectId The project id + * @param iterationId The iteration id + * @param platform The target platform (coreml or tensorflow). Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX' + * @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 (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (iterationId == null) { + throw new IllegalArgumentException("Parameter iterationId is required and cannot be null."); + } + if (platform == null) { + throw new IllegalArgumentException("Parameter platform is required and cannot be null."); + } + if (this.client.apiKey() == null) { + throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); + } + final String flavor = exportIterationOptionalParameter != null ? exportIterationOptionalParameter.flavor() : null; + + return exportIterationWithServiceResponseAsync(projectId, iterationId, platform, flavor); + } + + /** + * 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' + * @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 (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (iterationId == null) { + throw new IllegalArgumentException("Parameter iterationId is required and cannot be null."); + } + if (platform == null) { + throw new IllegalArgumentException("Parameter platform is required and cannot be null."); + } + if (this.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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = exportIterationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse exportIterationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + @Override + public TrainingsExportIterationParameters exportIteration() { + return new TrainingsExportIterationParameters(this); + } + + /** + * Internal class implementing TrainingsExportIterationDefinition. + */ + class TrainingsExportIterationParameters implements TrainingsExportIterationDefinition { + private TrainingsImpl parent; + private UUID projectId; + private UUID iterationId; + private String platform; + private String flavor; + + /** + * Constructor. + * @param parent the parent object. + */ + TrainingsExportIterationParameters(TrainingsImpl parent) { + this.parent = parent; + } + + @Override + public TrainingsExportIterationParameters withProjectId(UUID projectId) { + this.projectId = projectId; + return this; + } + + @Override + public TrainingsExportIterationParameters withIterationId(UUID iterationId) { + this.iterationId = iterationId; + return this; + } + + @Override + public TrainingsExportIterationParameters withPlatform(String platform) { + this.platform = platform; + return this; + } + + @Override + public TrainingsExportIterationParameters withFlavor(String flavor) { + this.flavor = flavor; + return this; + } + + @Override + public Export execute() { + return exportIterationWithServiceResponseAsync(projectId, iterationId, platform, flavor).toBlocking().single().body(); + } + + @Override + public Observable executeAsync() { + return exportIterationWithServiceResponseAsync(projectId, iterationId, platform, flavor).map(new Func1, Export>() { + @Override + public Export call(ServiceResponse response) { + return response.body(); + } + }); + } + } + + /** + * Get the list of exports for a specific iteration. + * + * @param projectId The project id + * @param iterationId The iteration id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Export> object if successful. + */ + public List getExports(UUID projectId, UUID iterationId) { + return getExportsWithServiceResponseAsync(projectId, iterationId).toBlocking().single().body(); + } + + /** + * Get the list of exports for a specific iteration. + * + * @param projectId The project id + * @param iterationId The iteration id + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getExportsAsync(UUID projectId, UUID iterationId, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getExportsWithServiceResponseAsync(projectId, iterationId), serviceCallback); + } + + /** + * Get the list of exports for a specific iteration. + * + * @param projectId The project id + * @param iterationId The iteration id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Export> object + */ + public Observable> getExportsAsync(UUID projectId, UUID iterationId) { + return getExportsWithServiceResponseAsync(projectId, iterationId).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the list of exports for a specific iteration. + * + * @param projectId The project id + * @param iterationId The iteration id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Export> object + */ + public Observable>> getExportsWithServiceResponseAsync(UUID projectId, UUID iterationId) { + if (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.getExports(projectId, iterationId, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getExportsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getExportsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + + /** + * Gets the number of images tagged with the provided {tagIds} that have prediction results from + training for the provided iteration {iterationId}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id + * @param iterationId The iteration id. Defaults to workspace + * @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 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(); + } + + /** + * 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 + * @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); + } + + /** + * 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 Integer object + */ + public Observable getImagePerformanceCountAsync(UUID projectId, UUID iterationId, GetImagePerformanceCountOptionalParameter getImagePerformanceCountOptionalParameter) { + return getImagePerformanceCountWithServiceResponseAsync(projectId, iterationId, getImagePerformanceCountOptionalParameter).map(new Func1, Integer>() { + @Override + public Integer call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the number of images tagged with the provided {tagIds} that have prediction results from + training for the provided iteration {iterationId}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id + * @param iterationId The iteration id. Defaults to workspace + * @param 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 Integer object + */ + public Observable> getImagePerformanceCountWithServiceResponseAsync(UUID projectId, UUID iterationId, GetImagePerformanceCountOptionalParameter getImagePerformanceCountOptionalParameter) { + 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 List tagIds = getImagePerformanceCountOptionalParameter != null ? getImagePerformanceCountOptionalParameter.tagIds() : null; + + return getImagePerformanceCountWithServiceResponseAsync(projectId, iterationId, tagIds); + } + + /** + * Gets the number of images tagged with the provided {tagIds} that have prediction results from + training for the provided iteration {iterationId}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id + * @param iterationId The iteration id. Defaults to workspace + * @param tagIds A list of tags ids to filter the images to count. Defaults to all tags when null. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Integer object + */ + public Observable> getImagePerformanceCountWithServiceResponseAsync(UUID projectId, UUID iterationId, List tagIds) { + 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."); + } + 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>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getImagePerformanceCountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getImagePerformanceCountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + @Override + public TrainingsGetImagePerformanceCountParameters getImagePerformanceCount() { + return new TrainingsGetImagePerformanceCountParameters(this); + } + + /** + * 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 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 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(); + } + + /** + * 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 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> getImagePerformancesAsync(UUID projectId, UUID iterationId, GetImagePerformancesOptionalParameter getImagePerformancesOptionalParameter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getImagePerformancesWithServiceResponseAsync(projectId, iterationId, getImagePerformancesOptionalParameter), serviceCallback); + } + + /** + * Get image with its prediction for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id + * @param iterationId The iteration id. Defaults to workspace + * @param 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 List<ImagePerformance> object + */ + public Observable> getImagePerformancesAsync(UUID projectId, UUID iterationId, GetImagePerformancesOptionalParameter getImagePerformancesOptionalParameter) { + return getImagePerformancesWithServiceResponseAsync(projectId, iterationId, getImagePerformancesOptionalParameter).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get image with its prediction for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id + * @param iterationId The iteration id. Defaults to workspace + * @param 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 List<ImagePerformance> object + */ + 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."); + } + 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."); + } + 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."); + } + 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>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getImagePerformancesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getImagePerformancesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.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. + * + * @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 RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IterationPerformance object if successful. + */ + public IterationPerformance getIterationPerformance(UUID projectId, UUID iterationId, GetIterationPerformanceOptionalParameter getIterationPerformanceOptionalParameter) { + return getIterationPerformanceWithServiceResponseAsync(projectId, iterationId, getIterationPerformanceOptionalParameter).toBlocking().single().body(); + } + + /** + * Get detailed performance information about an iteration. + * + * @param projectId The id of the project the iteration belongs to + * @param iterationId The id of the iteration to get + * @param 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 getIterationPerformanceAsync(UUID projectId, UUID iterationId, GetIterationPerformanceOptionalParameter getIterationPerformanceOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getIterationPerformanceWithServiceResponseAsync(projectId, iterationId, getIterationPerformanceOptionalParameter), serviceCallback); + } + + /** + * Get detailed performance information about an iteration. + * + * @param projectId The id of the project the iteration belongs to + * @param iterationId The id of the iteration to get + * @param 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 + */ + public Observable getIterationPerformanceAsync(UUID projectId, UUID iterationId, GetIterationPerformanceOptionalParameter getIterationPerformanceOptionalParameter) { + return getIterationPerformanceWithServiceResponseAsync(projectId, iterationId, getIterationPerformanceOptionalParameter).map(new Func1, IterationPerformance>() { + @Override + public IterationPerformance call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get detailed performance information about an iteration. + * + * @param projectId The id of the project the iteration belongs to + * @param iterationId The id of the iteration to get + * @param 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 + */ + public Observable> getIterationPerformanceWithServiceResponseAsync(UUID projectId, UUID iterationId, GetIterationPerformanceOptionalParameter getIterationPerformanceOptionalParameter) { + 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 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 (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.getIterationPerformance(projectId, iterationId, threshold, overlapThreshold, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getIterationPerformanceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getIterationPerformanceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + @Override + public TrainingsGetIterationPerformanceParameters getIterationPerformance() { + return new TrainingsGetIterationPerformanceParameters(this); + } + + /** + * 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(); + } + }); + } + } + + /** + * Update a specific iteration. + * + * @param projectId Project id + * @param iterationId Iteration id + * @param updatedIteration The updated iteration model + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Iteration object if successful. + */ + public Iteration updateIteration(UUID projectId, UUID iterationId, Iteration updatedIteration) { + return updateIterationWithServiceResponseAsync(projectId, iterationId, updatedIteration).toBlocking().single().body(); + } + + /** + * Update a specific iteration. + * + * @param projectId Project id + * @param iterationId Iteration id + * @param updatedIteration The updated iteration model + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateIterationAsync(UUID projectId, UUID iterationId, Iteration updatedIteration, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateIterationWithServiceResponseAsync(projectId, iterationId, updatedIteration), serviceCallback); + } + + /** + * Update a specific iteration. + * + * @param projectId Project id + * @param iterationId Iteration id + * @param updatedIteration The updated iteration model + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Iteration object + */ + public Observable updateIterationAsync(UUID projectId, UUID iterationId, Iteration updatedIteration) { + return updateIterationWithServiceResponseAsync(projectId, iterationId, updatedIteration).map(new Func1, Iteration>() { + @Override + public Iteration call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a specific iteration. + * + * @param projectId Project id + * @param iterationId Iteration id + * @param updatedIteration The updated iteration model + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Iteration object + */ + public Observable> updateIterationWithServiceResponseAsync(UUID projectId, UUID iterationId, Iteration updatedIteration) { + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (iterationId == null) { + throw new IllegalArgumentException("Parameter iterationId is required and cannot be null."); + } + if (updatedIteration == null) { + throw new IllegalArgumentException("Parameter updatedIteration is required and cannot be null."); + } + if (this.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>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateIterationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateIterationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete a specific iteration of a project. + * + * @param projectId The project id + * @param iterationId The iteration id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteIteration(UUID projectId, UUID iterationId) { + deleteIterationWithServiceResponseAsync(projectId, iterationId).toBlocking().single().body(); + } + + /** + * Delete a specific iteration of a project. + * + * @param projectId The project id + * @param iterationId The iteration id + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteIterationAsync(UUID projectId, UUID iterationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteIterationWithServiceResponseAsync(projectId, iterationId), serviceCallback); + } + + /** + * Delete a specific iteration of a project. + * + * @param projectId The project id + * @param iterationId The iteration id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteIterationAsync(UUID projectId, UUID iterationId) { + return deleteIterationWithServiceResponseAsync(projectId, iterationId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a specific iteration of a project. + * + * @param projectId The project id + * @param iterationId The iteration id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteIterationWithServiceResponseAsync(UUID projectId, UUID iterationId) { + if (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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteIterationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteIterationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a specific iteration. + * + * @param projectId The id of the project the iteration belongs to + * @param iterationId The id of the iteration to get + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Iteration object if successful. + */ + public Iteration getIteration(UUID projectId, UUID iterationId) { + return getIterationWithServiceResponseAsync(projectId, iterationId).toBlocking().single().body(); + } + + /** + * Get a specific iteration. + * + * @param projectId The id of the project the iteration belongs to + * @param iterationId The id of the iteration to get + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getIterationAsync(UUID projectId, UUID iterationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getIterationWithServiceResponseAsync(projectId, iterationId), serviceCallback); + } + + /** + * Get a specific iteration. + * + * @param projectId The id of the project the iteration belongs to + * @param iterationId The id of the iteration to get + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Iteration object + */ + public Observable getIterationAsync(UUID projectId, UUID iterationId) { + return getIterationWithServiceResponseAsync(projectId, iterationId).map(new Func1, Iteration>() { + @Override + public Iteration call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a specific iteration. + * + * @param projectId The id of the project the iteration belongs to + * @param iterationId The id of the iteration to get + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Iteration object + */ + public Observable> getIterationWithServiceResponseAsync(UUID projectId, UUID iterationId) { + if (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>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getIterationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getIterationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get iterations for the project. + * + * @param projectId The project id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Iteration> object if successful. + */ + public List getIterations(UUID projectId) { + return getIterationsWithServiceResponseAsync(projectId).toBlocking().single().body(); + } + + /** + * Get iterations for the project. + * + * @param projectId The project id + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getIterationsAsync(UUID projectId, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getIterationsWithServiceResponseAsync(projectId), serviceCallback); + } + + /** + * Get iterations for the project. + * + * @param projectId The project id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Iteration> object + */ + public Observable> getIterationsAsync(UUID projectId) { + return getIterationsWithServiceResponseAsync(projectId).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get iterations for the project. + * + * @param projectId The project id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Iteration> object + */ + public Observable>> getIterationsWithServiceResponseAsync(UUID projectId) { + if (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.getIterations(projectId, this.client.apiKey(), this.client.acceptLanguage(), 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update a specific project. + * + * @param projectId The id of the project to update + * @param updatedProject The updated project model + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Project object if successful. + */ + public Project updateProject(UUID projectId, Project updatedProject) { + return updateProjectWithServiceResponseAsync(projectId, updatedProject).toBlocking().single().body(); + } + + /** + * Update a specific project. + * + * @param projectId The id of the project to update + * @param updatedProject The updated project model + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateProjectAsync(UUID projectId, Project updatedProject, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateProjectWithServiceResponseAsync(projectId, updatedProject), serviceCallback); + } + + /** + * Update a specific project. + * + * @param projectId The id of the project to update + * @param updatedProject The updated project model + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Project object + */ + public Observable updateProjectAsync(UUID projectId, Project updatedProject) { + return updateProjectWithServiceResponseAsync(projectId, updatedProject).map(new Func1, Project>() { + @Override + public Project call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a specific project. + * + * @param projectId The id of the project to update + * @param updatedProject The updated project model + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Project object + */ + public Observable> updateProjectWithServiceResponseAsync(UUID projectId, Project updatedProject) { + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (updatedProject == null) { + throw new IllegalArgumentException("Parameter updatedProject is required and cannot be null."); + } + if (this.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>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateProjectDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateProjectDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete a specific project. + * + * @param projectId The project id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteProject(UUID projectId) { + deleteProjectWithServiceResponseAsync(projectId).toBlocking().single().body(); + } + + /** + * Delete a specific project. + * + * @param projectId The project id + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteProjectAsync(UUID projectId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteProjectWithServiceResponseAsync(projectId), serviceCallback); + } + + /** + * Delete a specific project. + * + * @param projectId The project id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteProjectAsync(UUID projectId) { + return deleteProjectWithServiceResponseAsync(projectId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a specific project. + * + * @param projectId The project id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteProjectWithServiceResponseAsync(UUID projectId) { + if (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.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); + } + + /** + * Get a specific project. + * + * @param projectId The id of the project to get + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Project object + */ + public Observable getProjectAsync(UUID projectId) { + return getProjectWithServiceResponseAsync(projectId).map(new Func1, Project>() { + @Override + public Project call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a specific project. + * + * @param projectId The id of the project to get + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Project object + */ + public Observable> getProjectWithServiceResponseAsync(UUID projectId) { + if (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.getProject(projectId, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getProjectDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getProjectDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Project object if successful. + */ + public Project createProject(String name, CreateProjectOptionalParameter createProjectOptionalParameter) { + return createProjectWithServiceResponseAsync(name, createProjectOptionalParameter).toBlocking().single().body(); + } + + /** + * Create a project. + * + * @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 createProjectAsync(String name, CreateProjectOptionalParameter createProjectOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createProjectWithServiceResponseAsync(name, createProjectOptionalParameter), serviceCallback); + } + + /** + * 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 + */ + public Observable createProjectAsync(String name, CreateProjectOptionalParameter createProjectOptionalParameter) { + return createProjectWithServiceResponseAsync(name, createProjectOptionalParameter).map(new Func1, Project>() { + @Override + public Project call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + */ + public Observable> createProjectWithServiceResponseAsync(String name, CreateProjectOptionalParameter createProjectOptionalParameter) { + 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."); + } + final String description = createProjectOptionalParameter != null ? createProjectOptionalParameter.description() : null; + final UUID domainId = createProjectOptionalParameter != null ? createProjectOptionalParameter.domainId() : null; + final String classificationType = createProjectOptionalParameter != null ? createProjectOptionalParameter.classificationType() : null; + + return createProjectWithServiceResponseAsync(name, description, domainId, classificationType); + } + + /** + * Create a project. + * + * @param name Name of the project + * @param description The description of the project + * @param domainId The id of the domain to use for this project. Defaults to General + * @param classificationType The type of classifier to create for this project. Possible values include: 'Multiclass', 'Multilabel' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Project object + */ + 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."); + } + 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>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createProjectDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createProjectDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + @Override + public TrainingsCreateProjectParameters createProject() { + return new TrainingsCreateProjectParameters(this); + } + + /** + * Internal class implementing TrainingsCreateProjectDefinition. + */ + class TrainingsCreateProjectParameters implements TrainingsCreateProjectDefinition { + private TrainingsImpl parent; + private String name; + private String description; + private UUID domainId; + private String classificationType; + + /** + * 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 Project execute() { + return createProjectWithServiceResponseAsync(name, description, domainId, classificationType).toBlocking().single().body(); + } + + @Override + public Observable executeAsync() { + return createProjectWithServiceResponseAsync(name, description, domainId, classificationType).map(new Func1, Project>() { + @Override + public Project call(ServiceResponse response) { + return response.body(); + } + }); + } + } + + /** + * Get your projects. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Project> object if successful. + */ + public List getProjects() { + return getProjectsWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get your projects. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getProjectsAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getProjectsWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get your projects. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Project> object + */ + public Observable> getProjectsAsync() { + return getProjectsWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get your projects. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Project> object + */ + public Observable>> getProjectsWithServiceResponseAsync() { + if (this.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>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getProjectsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getProjectsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Queues project for training. + * + * @param projectId The project id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Iteration object if successful. + */ + public Iteration trainProject(UUID projectId) { + return trainProjectWithServiceResponseAsync(projectId).toBlocking().single().body(); + } + + /** + * Queues project for training. + * + * @param projectId The project id + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture trainProjectAsync(UUID projectId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(trainProjectWithServiceResponseAsync(projectId), serviceCallback); + } + + /** + * Queues project for training. + * + * @param projectId The project id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Iteration object + */ + public Observable trainProjectAsync(UUID projectId) { + return trainProjectWithServiceResponseAsync(projectId).map(new Func1, Iteration>() { + @Override + public Iteration call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Queues project for training. + * + * @param projectId The project id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Iteration object + */ + public Observable> trainProjectWithServiceResponseAsync(UUID projectId) { + if (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.trainProject(projectId, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = trainProjectDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse trainProjectDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + + /** + * Quick test an image. + * + * @param projectId The project id + * @param imageData the InputStream value + * @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 RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagePrediction object if successful. + */ + public ImagePrediction quickTestImage(UUID projectId, byte[] imageData, QuickTestImageOptionalParameter quickTestImageOptionalParameter) { + return quickTestImageWithServiceResponseAsync(projectId, imageData, quickTestImageOptionalParameter).toBlocking().single().body(); + } + + /** + * Quick test an image. + * + * @param projectId The project id + * @param imageData the InputStream value + * @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 + * @return the {@link ServiceFuture} object + */ + public ServiceFuture quickTestImageAsync(UUID projectId, byte[] imageData, QuickTestImageOptionalParameter quickTestImageOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(quickTestImageWithServiceResponseAsync(projectId, imageData, quickTestImageOptionalParameter), serviceCallback); + } + + /** + * Quick test an image. + * + * @param projectId The project id + * @param imageData the InputStream value + * @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 quickTestImageAsync(UUID projectId, byte[] imageData, QuickTestImageOptionalParameter quickTestImageOptionalParameter) { + return quickTestImageWithServiceResponseAsync(projectId, imageData, quickTestImageOptionalParameter).map(new Func1, ImagePrediction>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Quick test an image. + * + * @param projectId The project id + * @param imageData the InputStream value + * @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 (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 UUID iterationId = quickTestImageOptionalParameter != null ? quickTestImageOptionalParameter.iterationId() : null; + + return quickTestImageWithServiceResponseAsync(projectId, imageData, iterationId); + } + + /** + * Quick test an image. + * + * @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. + * @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 (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."); + } + 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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = quickTestImageDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse quickTestImageDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + @Override + public TrainingsQuickTestImageParameters quickTestImage() { + return new TrainingsQuickTestImageParameters(this); + } + + /** + * Internal class implementing TrainingsQuickTestImageDefinition. + */ + class TrainingsQuickTestImageParameters implements TrainingsQuickTestImageDefinition { + private TrainingsImpl parent; + private UUID projectId; + private byte[] imageData; + private UUID iterationId; + + /** + * Constructor. + * @param parent the parent object. + */ + TrainingsQuickTestImageParameters(TrainingsImpl parent) { + this.parent = parent; + } + + @Override + public TrainingsQuickTestImageParameters withProjectId(UUID projectId) { + this.projectId = projectId; + return this; + } + + @Override + public TrainingsQuickTestImageParameters withImageData(byte[] imageData) { + this.imageData = imageData; + return this; + } + + @Override + public TrainingsQuickTestImageParameters withIterationId(UUID iterationId) { + this.iterationId = iterationId; + return this; + } + + @Override + public ImagePrediction execute() { + return quickTestImageWithServiceResponseAsync(projectId, imageData, iterationId).toBlocking().single().body(); + } + + @Override + public Observable executeAsync() { + return quickTestImageWithServiceResponseAsync(projectId, imageData, iterationId).map(new Func1, ImagePrediction>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + } + + + /** + * Quick test an image url. + * + * @param projectId The project to evaluate against + * @param 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 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(); + } + + /** + * Quick test an image url. + * + * @param projectId The project to evaluate against + * @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); + } + + /** + * Quick test an image url. + * + * @param projectId The project to evaluate against + * @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>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Quick test an image url. + * + * @param projectId The project to evaluate against + * @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) { + 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 = quickTestImageUrlOptionalParameter != null ? quickTestImageUrlOptionalParameter.iterationId() : null; + final String url = quickTestImageUrlOptionalParameter != null ? quickTestImageUrlOptionalParameter.url() : null; + + return quickTestImageUrlWithServiceResponseAsync(projectId, iterationId, url); + } + + /** + * Quick test an image url. + * + * @param projectId The project to evaluate against + * @param iterationId Optional. Specifies the id of a particular iteration to evaluate against. + The default iteration for the project will be used when not specified. + * @param url the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagePrediction object + */ + public Observable> quickTestImageUrlWithServiceResponseAsync(UUID projectId, UUID iterationId, String url) { + 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."); + } + ImageUrl imageUrl = new ImageUrl(); + imageUrl.withUrl(url); + return service.quickTestImageUrl(projectId, iterationId, this.client.apiKey(), this.client.acceptLanguage(), imageUrl, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = quickTestImageUrlDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse quickTestImageUrlDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + @Override + public TrainingsQuickTestImageUrlParameters quickTestImageUrl() { + return new TrainingsQuickTestImageUrlParameters(this); + } + + /** + * Internal class implementing TrainingsQuickTestImageUrlDefinition. + */ + class TrainingsQuickTestImageUrlParameters implements TrainingsQuickTestImageUrlDefinition { + private TrainingsImpl parent; + private UUID projectId; + private UUID iterationId; + private String url; + + /** + * Constructor. + * @param parent the parent object. + */ + TrainingsQuickTestImageUrlParameters(TrainingsImpl parent) { + this.parent = parent; + } + + @Override + public TrainingsQuickTestImageUrlParameters withProjectId(UUID projectId) { + this.projectId = projectId; + return this; + } + + @Override + public TrainingsQuickTestImageUrlParameters withIterationId(UUID iterationId) { + this.iterationId = iterationId; + return this; + } + + @Override + public TrainingsQuickTestImageUrlParameters withUrl(String url) { + this.url = url; + return this; + } + + @Override + public ImagePrediction execute() { + return quickTestImageUrlWithServiceResponseAsync(projectId, iterationId, url).toBlocking().single().body(); + } + + @Override + public Observable executeAsync() { + return quickTestImageUrlWithServiceResponseAsync(projectId, iterationId, url).map(new Func1, ImagePrediction>() { + @Override + public ImagePrediction call(ServiceResponse response) { + return response.body(); + } + }); + } + } + + /** + * Get images that were sent to your prediction endpoint. + * + * @param projectId The project id + * @param query Parameters used to query the predictions. Limited to combining 2 tags + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PredictionQueryResult object if successful. + */ + public PredictionQueryResult queryPredictions(UUID projectId, PredictionQueryToken query) { + return queryPredictionsWithServiceResponseAsync(projectId, query).toBlocking().single().body(); + } + + /** + * Get images that were sent to your prediction endpoint. + * + * @param projectId The project id + * @param query Parameters used to query the predictions. Limited to combining 2 tags + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture queryPredictionsAsync(UUID projectId, PredictionQueryToken query, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(queryPredictionsWithServiceResponseAsync(projectId, query), serviceCallback); + } + + /** + * Get images that were sent to your prediction endpoint. + * + * @param projectId The project id + * @param query Parameters used to query the predictions. Limited to combining 2 tags + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PredictionQueryResult object + */ + public Observable queryPredictionsAsync(UUID projectId, PredictionQueryToken query) { + return queryPredictionsWithServiceResponseAsync(projectId, query).map(new Func1, PredictionQueryResult>() { + @Override + public PredictionQueryResult call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get images that were sent to your prediction endpoint. + * + * @param projectId The project id + * @param query Parameters used to query the predictions. Limited to combining 2 tags + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PredictionQueryResult object + */ + public Observable> queryPredictionsWithServiceResponseAsync(UUID projectId, PredictionQueryToken query) { + if (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."); + } + Validator.validate(query); + return service.queryPredictions(projectId, query, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = queryPredictionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse queryPredictionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete a set of predicted images and their associated prediction results. + * + * @param projectId The project id + * @param ids The prediction ids. Limited to 64 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deletePrediction(UUID projectId, List ids) { + deletePredictionWithServiceResponseAsync(projectId, ids).toBlocking().single().body(); + } + + /** + * Delete a set of predicted images and their associated prediction results. + * + * @param projectId The project id + * @param ids The prediction ids. Limited to 64 + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deletePredictionAsync(UUID projectId, List ids, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deletePredictionWithServiceResponseAsync(projectId, ids), serviceCallback); + } + + /** + * Delete a set of predicted images and their associated prediction results. + * + * @param projectId The project id + * @param ids The prediction ids. Limited to 64 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deletePredictionAsync(UUID projectId, List ids) { + return deletePredictionWithServiceResponseAsync(projectId, ids).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a set of predicted images and their associated prediction results. + * + * @param projectId The project id + * @param ids The prediction ids. Limited to 64 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deletePredictionWithServiceResponseAsync(UUID projectId, List ids) { + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (ids == null) { + throw new IllegalArgumentException("Parameter ids is required and cannot be null."); + } + if (this.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>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deletePredictionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deletePredictionDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get region proposals for an image. Returns empty array if no proposals are found. + * This API will get region proposals for an image along with confidences for the region. It returns an empty array if no proposals are found. + * + * @param projectId The project id + * @param imageId The image id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageRegionProposal object if successful. + */ + public ImageRegionProposal getImageRegionProposals(UUID projectId, UUID imageId) { + return getImageRegionProposalsWithServiceResponseAsync(projectId, imageId).toBlocking().single().body(); + } + + /** + * Get region proposals for an image. Returns empty array if no proposals are found. + * This API will get region proposals for an image along with confidences for the region. It returns an empty array if no proposals are found. + * + * @param projectId The project id + * @param imageId The image id + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getImageRegionProposalsAsync(UUID projectId, UUID imageId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getImageRegionProposalsWithServiceResponseAsync(projectId, imageId), serviceCallback); + } + + /** + * Get region proposals for an image. Returns empty array if no proposals are found. + * This API will get region proposals for an image along with confidences for the region. It returns an empty array if no proposals are found. + * + * @param projectId The project id + * @param imageId The image id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageRegionProposal object + */ + public Observable getImageRegionProposalsAsync(UUID projectId, UUID imageId) { + return getImageRegionProposalsWithServiceResponseAsync(projectId, imageId).map(new Func1, ImageRegionProposal>() { + @Override + public ImageRegionProposal call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get region proposals for an image. Returns empty array if no proposals are found. + * This API will get region proposals for an image along with confidences for the region. It returns an empty array if no proposals are found. + * + * @param projectId The project id + * @param imageId The image id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageRegionProposal object + */ + public Observable> getImageRegionProposalsWithServiceResponseAsync(UUID projectId, UUID imageId) { + if (projectId == null) { + throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); + } + if (imageId == null) { + throw new IllegalArgumentException("Parameter imageId is required and cannot be null."); + } + if (this.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>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getImageRegionProposalsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getImageRegionProposalsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete a set of image regions. + * + * @param projectId The project id + * @param regionIds Regions to delete. Limited to 64 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteImageRegions(UUID projectId, List regionIds) { + deleteImageRegionsWithServiceResponseAsync(projectId, regionIds).toBlocking().single().body(); + } + + /** + * Delete a set of image regions. + * + * @param projectId The project id + * @param regionIds Regions to delete. Limited to 64 + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteImageRegionsAsync(UUID projectId, List regionIds, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteImageRegionsWithServiceResponseAsync(projectId, regionIds), serviceCallback); + } + + /** + * Delete a set of image regions. + * + * @param projectId The project id + * @param regionIds Regions to delete. Limited to 64 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteImageRegionsAsync(UUID projectId, List regionIds) { + return deleteImageRegionsWithServiceResponseAsync(projectId, regionIds).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a set of image regions. + * + * @param projectId The project id + * @param regionIds Regions to delete. Limited to 64 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteImageRegionsWithServiceResponseAsync(UUID projectId, List regionIds) { + if (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 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>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteImageRegionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteImageRegionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + + /** + * Create a set of image regions. + * This API accepts a batch of image regions, and optionally tags, to update existing images with region information. + There is a limit of 64 entries in the batch. + * + * @param projectId The project id + * @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 RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageRegionCreateSummary object if successful. + */ + public ImageRegionCreateSummary createImageRegions(UUID projectId, CreateImageRegionsOptionalParameter createImageRegionsOptionalParameter) { + return createImageRegionsWithServiceResponseAsync(projectId, createImageRegionsOptionalParameter).toBlocking().single().body(); + } + + /** + * Create a set of image regions. + * This API accepts a batch of image regions, and optionally tags, to update existing images with region information. + There is a limit of 64 entries in the batch. + * + * @param projectId The project id + * @param 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 createImageRegionsAsync(UUID projectId, CreateImageRegionsOptionalParameter createImageRegionsOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createImageRegionsWithServiceResponseAsync(projectId, createImageRegionsOptionalParameter), serviceCallback); + } + + /** + * Create a set of image regions. + * This API accepts a batch of image regions, and optionally tags, to update existing images with region information. + There is a limit of 64 entries in the batch. + * + * @param projectId The project id + * @param 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 ImageRegionCreateSummary object + */ + public Observable createImageRegionsAsync(UUID projectId, CreateImageRegionsOptionalParameter createImageRegionsOptionalParameter) { + return createImageRegionsWithServiceResponseAsync(projectId, createImageRegionsOptionalParameter).map(new Func1, ImageRegionCreateSummary>() { + @Override + public ImageRegionCreateSummary call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a set of image regions. + * This API accepts a batch of image regions, and optionally tags, to update existing images with region information. + There is a limit of 64 entries in the batch. + * + * @param projectId The project id + * @param 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 ImageRegionCreateSummary 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."); + } + 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 (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>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createImageRegionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createImageRegionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + @Override + public TrainingsCreateImageRegionsParameters createImageRegions() { + return new TrainingsCreateImageRegionsParameters(this); + } + + /** + * Internal class implementing TrainingsCreateImageRegionsDefinition. + */ + 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); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteImageTagsAsync(UUID projectId, List imageIds, List tagIds) { + return deleteImageTagsWithServiceResponseAsync(projectId, imageIds, tagIds).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Remove a set of tags from a set of images. + * + * @param projectId The project id + * @param imageIds Image ids. Limited to 64 images + * @param tagIds Tags to be deleted from the specified images. Limted to 20 tags + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteImageTagsWithServiceResponseAsync(UUID projectId, List imageIds, List tagIds) { + if (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 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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteImageTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteImageTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + + /** + * 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 + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageTagCreateSummary object if successful. + */ + public ImageTagCreateSummary createImageTags(UUID projectId, CreateImageTagsOptionalParameter createImageTagsOptionalParameter) { + return createImageTagsWithServiceResponseAsync(projectId, createImageTagsOptionalParameter).toBlocking().single().body(); + } + + /** + * 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 + * @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); + } + + /** + * 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 + */ + public Observable createImageTagsAsync(UUID projectId, CreateImageTagsOptionalParameter createImageTagsOptionalParameter) { + return createImageTagsWithServiceResponseAsync(projectId, createImageTagsOptionalParameter).map(new Func1, ImageTagCreateSummary>() { + @Override + public ImageTagCreateSummary call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Associate a set of images with a set of tags. + * + * @param projectId The project id + * @param 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 + */ + public Observable> createImageTagsWithServiceResponseAsync(UUID projectId, CreateImageTagsOptionalParameter createImageTagsOptionalParameter) { + 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 tags = createImageTagsOptionalParameter != null ? createImageTagsOptionalParameter.tags() : null; + + return createImageTagsWithServiceResponseAsync(projectId, tags); + } + + /** + * Associate a set of images with a set of tags. + * + * @param projectId The project id + * @param tags the List<ImageTagCreateEntry> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageTagCreateSummary object + */ + public Observable> createImageTagsWithServiceResponseAsync(UUID projectId, List tags) { + 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(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>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createImageTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createImageTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + @Override + public TrainingsCreateImageTagsParameters createImageTags() { + return new TrainingsCreateImageTagsParameters(this); + } + + /** + * Internal class implementing TrainingsCreateImageTagsDefinition. + */ + class TrainingsCreateImageTagsParameters implements TrainingsCreateImageTagsDefinition { + private TrainingsImpl parent; + private UUID projectId; + private List tags; + + /** + * Constructor. + * @param parent the parent object. + */ + TrainingsCreateImageTagsParameters(TrainingsImpl parent) { + this.parent = parent; + } + + @Override + public TrainingsCreateImageTagsParameters withProjectId(UUID projectId) { + this.projectId = projectId; + return this; + } + + @Override + public TrainingsCreateImageTagsParameters withTags(List tags) { + this.tags = tags; + return this; + } + + @Override + public ImageTagCreateSummary execute() { + return createImageTagsWithServiceResponseAsync(projectId, tags).toBlocking().single().body(); + } + + @Override + public Observable executeAsync() { + return createImageTagsWithServiceResponseAsync(projectId, tags).map(new Func1, ImageTagCreateSummary>() { + @Override + public ImageTagCreateSummary call(ServiceResponse response) { + return response.body(); + } + }); + } + } + + /** + * Add the specified predicted images to the set of training images. + * This API creates a batch of images from predicted images specified. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id + * @param batch Image and tag ids. 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. + */ + public ImageCreateSummary createImagesFromPredictions(UUID projectId, ImageIdCreateBatch batch) { + return createImagesFromPredictionsWithServiceResponseAsync(projectId, batch).toBlocking().single().body(); + } + + /** + * Add the specified predicted images to the set of training images. + * This API creates a batch of images from predicted images specified. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id + * @param batch Image and tag ids. Limted to 64 images and 20 tags per batch + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createImagesFromPredictionsAsync(UUID projectId, ImageIdCreateBatch batch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createImagesFromPredictionsWithServiceResponseAsync(projectId, batch), serviceCallback); + } + + /** + * Add the specified predicted images to the set of training images. + * This API creates a batch of images from predicted images specified. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id + * @param batch Image and tag ids. Limted to 64 images and 20 tags per batch + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageCreateSummary object + */ + public Observable createImagesFromPredictionsAsync(UUID projectId, ImageIdCreateBatch batch) { + return createImagesFromPredictionsWithServiceResponseAsync(projectId, batch).map(new Func1, ImageCreateSummary>() { + @Override + public ImageCreateSummary call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Add the specified predicted images to the set of training images. + * This API creates a batch of images from predicted images specified. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id + * @param batch Image and tag ids. Limted to 64 images and 20 tags per batch + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageCreateSummary object + */ + public Observable> createImagesFromPredictionsWithServiceResponseAsync(UUID projectId, ImageIdCreateBatch batch) { + if (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(batch); + return service.createImagesFromPredictions(projectId, batch, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createImagesFromPredictionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createImagesFromPredictionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Add the provided images urls to the set of training images. + * This API accepts a batch of urls, and optionally tags, to create images. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id + * @param batch Image urls and tag ids. Limited to 64 images and 20 tags per batch + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageCreateSummary object if successful. + */ + public ImageCreateSummary createImagesFromUrls(UUID projectId, ImageUrlCreateBatch batch) { + return createImagesFromUrlsWithServiceResponseAsync(projectId, batch).toBlocking().single().body(); + } + + /** + * Add the provided images urls to the set of training images. + * This API accepts a batch of urls, and optionally tags, to create images. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id + * @param batch Image urls and tag ids. Limited to 64 images and 20 tags per batch + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createImagesFromUrlsAsync(UUID projectId, ImageUrlCreateBatch batch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createImagesFromUrlsWithServiceResponseAsync(projectId, batch), serviceCallback); + } + + /** + * Add the provided images urls to the set of training images. + * This API accepts a batch of urls, and optionally tags, to create images. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id + * @param batch Image urls and tag ids. Limited to 64 images and 20 tags per batch + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageCreateSummary object + */ + public Observable createImagesFromUrlsAsync(UUID projectId, ImageUrlCreateBatch batch) { + return createImagesFromUrlsWithServiceResponseAsync(projectId, batch).map(new Func1, ImageCreateSummary>() { + @Override + public ImageCreateSummary call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Add the provided images urls to the set of training images. + * This API accepts a batch of urls, and optionally tags, to create images. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id + * @param batch Image urls and tag ids. Limited to 64 images and 20 tags per batch + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageCreateSummary object + */ + public Observable> createImagesFromUrlsWithServiceResponseAsync(UUID projectId, ImageUrlCreateBatch batch) { + if (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(batch); + return service.createImagesFromUrls(projectId, batch, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createImagesFromUrlsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createImagesFromUrlsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.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. + * + * @param projectId The project id + * @param batch The batch of image files to add. Limited to 64 images and 20 tags per batch + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageCreateSummary object if successful. + */ + public ImageCreateSummary createImagesFromFiles(UUID projectId, ImageFileCreateBatch batch) { + return createImagesFromFilesWithServiceResponseAsync(projectId, batch).toBlocking().single().body(); + } + + /** + * Add the provided batch of images to the set of training images. + * This API accepts a batch of files, and optionally tags, to create images. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id + * @param batch The batch of image files to add. Limited to 64 images and 20 tags per batch + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createImagesFromFilesAsync(UUID projectId, ImageFileCreateBatch batch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createImagesFromFilesWithServiceResponseAsync(projectId, batch), serviceCallback); + } + + /** + * Add the provided batch of images to the set of training images. + * This API accepts a batch of files, and optionally tags, to create images. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id + * @param batch The batch of image files to add. Limited to 64 images and 20 tags per batch + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageCreateSummary object + */ + public Observable createImagesFromFilesAsync(UUID projectId, ImageFileCreateBatch batch) { + return createImagesFromFilesWithServiceResponseAsync(projectId, batch).map(new Func1, ImageCreateSummary>() { + @Override + public ImageCreateSummary call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Add the provided batch of images to the set of training images. + * This API accepts a batch of files, and optionally tags, to create images. There is a limit of 64 images and 20 tags. + * + * @param projectId The project id + * @param batch The batch of image files to add. Limited to 64 images and 20 tags per batch + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageCreateSummary object + */ + public Observable> createImagesFromFilesWithServiceResponseAsync(UUID projectId, ImageFileCreateBatch batch) { + if (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(batch); + return service.createImagesFromFiles(projectId, batch, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createImagesFromFilesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createImagesFromFilesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete images from the set of training images. + * + * @param projectId The project id + * @param imageIds Ids of the images to be deleted. 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(); + } + + /** + * 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 + */ + public ServiceFuture deleteImagesAsync(UUID projectId, List imageIds, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteImagesWithServiceResponseAsync(projectId, imageIds), serviceCallback); + } + + /** + * Delete images from the set of training images. + * + * @param projectId The project id + * @param imageIds Ids of the images to be deleted. 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(); + } + }); + } + + /** + * 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."); + } + if (imageIds == null) { + throw new IllegalArgumentException("Parameter imageIds 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.deleteImages(projectId, imageIdsConverted, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteImagesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteImagesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.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. + * + * @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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageCreateSummary object if successful. + */ + public ImageCreateSummary createImagesFromData(UUID projectId, byte[] imageData, CreateImagesFromDataOptionalParameter createImagesFromDataOptionalParameter) { + return createImagesFromDataWithServiceResponseAsync(projectId, imageData, createImagesFromDataOptionalParameter).toBlocking().single().body(); + } + + /** + * Add the provided images to the set of training images. + * This API accepts body content as multipart/form-data and application/octet-stream. When using multipart + multiple image files can be sent at once, with a maximum of 64 files. + * + * @param projectId The project id + * @param imageData the InputStream value + * @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 createImagesFromDataAsync(UUID projectId, byte[] imageData, CreateImagesFromDataOptionalParameter createImagesFromDataOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createImagesFromDataWithServiceResponseAsync(projectId, imageData, createImagesFromDataOptionalParameter), serviceCallback); + } + + /** + * Add the provided images to the set of training images. + * This API accepts body content as multipart/form-data and application/octet-stream. When using multipart + multiple image files can be sent at once, with a maximum of 64 files. + * + * @param projectId The project id + * @param imageData the InputStream value + * @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 + */ + public Observable createImagesFromDataAsync(UUID projectId, byte[] imageData, CreateImagesFromDataOptionalParameter createImagesFromDataOptionalParameter) { + return createImagesFromDataWithServiceResponseAsync(projectId, imageData, createImagesFromDataOptionalParameter).map(new Func1, ImageCreateSummary>() { + @Override + public ImageCreateSummary call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Add the provided images to the set of training images. + * This API accepts body content as multipart/form-data and application/octet-stream. When using multipart + multiple image files can be sent at once, with a maximum of 64 files. + * + * @param projectId The project id + * @param imageData the InputStream value + * @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 + */ + public Observable> createImagesFromDataWithServiceResponseAsync(UUID projectId, byte[] imageData, CreateImagesFromDataOptionalParameter createImagesFromDataOptionalParameter) { + 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; + + return createImagesFromDataWithServiceResponseAsync(projectId, imageData, tagIds); + } + + /** + * Add the provided images to the set of training images. + * This API accepts body content as multipart/form-data and application/octet-stream. When using multipart + multiple image files can be sent at once, with a maximum of 64 files. + * + * @param projectId The project id + * @param imageData the InputStream value + * @param tagIds The tags ids with which to tag each image. Limited to 20 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageCreateSummary object + */ + public Observable> createImagesFromDataWithServiceResponseAsync(UUID projectId, byte[] imageData, List tagIds) { + if (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 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>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createImagesFromDataDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createImagesFromDataDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + @Override + public TrainingsCreateImagesFromDataParameters createImagesFromData() { + return new TrainingsCreateImagesFromDataParameters(this); + } + + /** + * Internal class implementing TrainingsCreateImagesFromDataDefinition. + */ + class TrainingsCreateImagesFromDataParameters implements TrainingsCreateImagesFromDataDefinition { + private TrainingsImpl parent; + private UUID projectId; + private byte[] imageData; + private List tagIds; + + /** + * Constructor. + * @param parent the parent object. + */ + TrainingsCreateImagesFromDataParameters(TrainingsImpl parent) { + this.parent = parent; + } + + @Override + public TrainingsCreateImagesFromDataParameters withProjectId(UUID projectId) { + this.projectId = projectId; + return this; + } + + @Override + public TrainingsCreateImagesFromDataParameters withImageData(byte[] imageData) { + this.imageData = imageData; + return this; + } + + @Override + 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 createImagesFromDataWithServiceResponseAsync(projectId, imageData, tagIds).map(new Func1, ImageCreateSummary>() { + @Override + public ImageCreateSummary call(ServiceResponse response) { + return response.body(); + } + }); + } + } + + + /** + * Get images by id for a given project iteration. + * This API will return a set of Images for the specified tags and optionally iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id + * @param 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 RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Image> object if successful. + */ + public List getImagesByIds(UUID projectId, GetImagesByIdsOptionalParameter getImagesByIdsOptionalParameter) { + return getImagesByIdsWithServiceResponseAsync(projectId, getImagesByIdsOptionalParameter).toBlocking().single().body(); + } + + /** + * Get images by id for a given project iteration. + * This API will return a set of Images for the specified tags and optionally iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id + * @param 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> getImagesByIdsAsync(UUID projectId, GetImagesByIdsOptionalParameter getImagesByIdsOptionalParameter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getImagesByIdsWithServiceResponseAsync(projectId, getImagesByIdsOptionalParameter), serviceCallback); + } + + /** + * Get images by id for a given project iteration. + * This API will return a set of Images for the specified tags and optionally iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id + * @param 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 List<Image> object + */ + public Observable> getImagesByIdsAsync(UUID projectId, GetImagesByIdsOptionalParameter getImagesByIdsOptionalParameter) { + return getImagesByIdsWithServiceResponseAsync(projectId, getImagesByIdsOptionalParameter).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get images by id for a given project iteration. + * This API will return a set of Images for the specified tags and optionally iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id + * @param 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 List<Image> object + */ + public Observable>> getImagesByIdsWithServiceResponseAsync(UUID projectId, GetImagesByIdsOptionalParameter getImagesByIdsOptionalParameter) { + 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; + + 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 (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>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getImagesByIdsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getImagesByIdsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + @Override + public TrainingsGetImagesByIdsParameters getImagesByIds() { + return new TrainingsGetImagesByIdsParameters(this); + } + + /** + * Internal class implementing TrainingsGetImagesByIdsDefinition. + */ + class TrainingsGetImagesByIdsParameters implements TrainingsGetImagesByIdsDefinition { + private TrainingsImpl parent; + private UUID projectId; + private List imageIds; + private UUID iterationId; + + /** + * Constructor. + * @param parent the parent object. + */ + TrainingsGetImagesByIdsParameters(TrainingsImpl parent) { + this.parent = parent; + } + + @Override + public TrainingsGetImagesByIdsParameters 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; + return this; + } + + @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 List call(ServiceResponse> response) { + return response.body(); + } + }); + } + } + + + /** + * Gets the number of untagged images. + * This API returns the images which have no tags for a given project and optionally an iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id + * @param 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 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(); + } + + /** + * 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 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 getUntaggedImageCountAsync(UUID projectId, GetUntaggedImageCountOptionalParameter getUntaggedImageCountOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getUntaggedImageCountWithServiceResponseAsync(projectId, getUntaggedImageCountOptionalParameter), serviceCallback); + } + + /** + * Gets the number of untagged images. + * This API returns the images which have no tags for a given project and optionally an iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id + * @param 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 Integer object + */ + public Observable getUntaggedImageCountAsync(UUID projectId, GetUntaggedImageCountOptionalParameter getUntaggedImageCountOptionalParameter) { + return getUntaggedImageCountWithServiceResponseAsync(projectId, getUntaggedImageCountOptionalParameter).map(new Func1, Integer>() { + @Override + public Integer call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the number of untagged images. + * This API returns the images which have no tags for a given project and optionally an iteration. If no iteration is specified the + current workspace is used. + * + * @param projectId The project id + * @param 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 Integer object + */ + public Observable> getUntaggedImageCountWithServiceResponseAsync(UUID projectId, GetUntaggedImageCountOptionalParameter getUntaggedImageCountOptionalParameter) { + 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 = 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 (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>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getUntaggedImageCountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getUntaggedImageCountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.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. + * + * @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 RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the int object if successful. + */ + public int getTaggedImageCount(UUID projectId, GetTaggedImageCountOptionalParameter getTaggedImageCountOptionalParameter) { + return getTaggedImageCountWithServiceResponseAsync(projectId, getTaggedImageCountOptionalParameter).toBlocking().single().body(); + } + + /** + * Gets the number of images tagged with the provided {tagIds}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id + * @param 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 getTaggedImageCountAsync(UUID projectId, GetTaggedImageCountOptionalParameter getTaggedImageCountOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getTaggedImageCountWithServiceResponseAsync(projectId, getTaggedImageCountOptionalParameter), serviceCallback); + } + + /** + * Gets the number of images tagged with the provided {tagIds}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id + * @param 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 Integer object + */ + public Observable getTaggedImageCountAsync(UUID projectId, GetTaggedImageCountOptionalParameter getTaggedImageCountOptionalParameter) { + return getTaggedImageCountWithServiceResponseAsync(projectId, getTaggedImageCountOptionalParameter).map(new Func1, Integer>() { + @Override + public Integer call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the number of images tagged with the provided {tagIds}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id + * @param 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 Integer object + */ + public Observable> getTaggedImageCountWithServiceResponseAsync(UUID projectId, GetTaggedImageCountOptionalParameter getTaggedImageCountOptionalParameter) { + 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; + + return getTaggedImageCountWithServiceResponseAsync(projectId, iterationId, tagIds); + } + + /** + * Gets the number of images tagged with the provided {tagIds}. + * The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id + * @param iterationId The iteration id. Defaults to workspace + * @param tagIds A list of tags ids to filter the images to count. Defaults to all tags when null. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Integer object + */ + public Observable> getTaggedImageCountWithServiceResponseAsync(UUID projectId, UUID iterationId, List tagIds) { + 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>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getTaggedImageCountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getTaggedImageCountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + @Override + public TrainingsGetTaggedImageCountParameters getTaggedImageCount() { + return new TrainingsGetTaggedImageCountParameters(this); + } + + /** + * Internal class implementing TrainingsGetTaggedImageCountDefinition. + */ + class TrainingsGetTaggedImageCountParameters implements TrainingsGetTaggedImageCountDefinition { + private TrainingsImpl parent; + private UUID projectId; + private UUID iterationId; + private List tagIds; + + /** + * Constructor. + * @param parent the parent object. + */ + TrainingsGetTaggedImageCountParameters(TrainingsImpl parent) { + this.parent = parent; + } + + @Override + public TrainingsGetTaggedImageCountParameters 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; + return this; + } + + @Override + public int execute() { + return getTaggedImageCountWithServiceResponseAsync(projectId, iterationId, tagIds).toBlocking().single().body(); + } + + @Override + public Observable executeAsync() { + return getTaggedImageCountWithServiceResponseAsync(projectId, iterationId, tagIds).map(new Func1, Integer>() { + @Override + 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. + * + * @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. + */ + public List getUntaggedImages(UUID projectId, GetUntaggedImagesOptionalParameter getUntaggedImagesOptionalParameter) { + return getUntaggedImagesWithServiceResponseAsync(projectId, getUntaggedImagesOptionalParameter).toBlocking().single().body(); + } + + /** + * Get untagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + * + * @param projectId The project id + * @param 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> getUntaggedImagesAsync(UUID projectId, GetUntaggedImagesOptionalParameter getUntaggedImagesOptionalParameter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getUntaggedImagesWithServiceResponseAsync(projectId, getUntaggedImagesOptionalParameter), serviceCallback); + } + + /** + * Get untagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + * + * @param projectId The project id + * @param 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 + */ + public Observable> getUntaggedImagesAsync(UUID projectId, GetUntaggedImagesOptionalParameter getUntaggedImagesOptionalParameter) { + return getUntaggedImagesWithServiceResponseAsync(projectId, getUntaggedImagesOptionalParameter).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get untagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + * + * @param projectId The project id + * @param 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 + */ + public Observable>> getUntaggedImagesWithServiceResponseAsync(UUID projectId, GetUntaggedImagesOptionalParameter getUntaggedImagesOptionalParameter) { + 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; + + 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 (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>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getUntaggedImagesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getUntaggedImagesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + @Override + public TrainingsGetUntaggedImagesParameters getUntaggedImages() { + return new TrainingsGetUntaggedImagesParameters(this); + } + + /** + * Internal class implementing TrainingsGetUntaggedImagesDefinition. + */ + class TrainingsGetUntaggedImagesParameters implements TrainingsGetUntaggedImagesDefinition { + 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) { + this.parent = parent; + } + + @Override + public TrainingsGetUntaggedImagesParameters withProjectId(UUID projectId) { + this.projectId = projectId; + return this; + } + + @Override + public TrainingsGetUntaggedImagesParameters 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(); + } + + @Override + public Observable> executeAsync() { + return getUntaggedImagesWithServiceResponseAsync(projectId, iterationId, orderBy, take, skip).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + } + + + /** + * Get tagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id + * @param 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. + */ + public List getTaggedImages(UUID projectId, GetTaggedImagesOptionalParameter getTaggedImagesOptionalParameter) { + return getTaggedImagesWithServiceResponseAsync(projectId, getTaggedImagesOptionalParameter).toBlocking().single().body(); + } + + /** + * Get tagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id + * @param 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> getTaggedImagesAsync(UUID projectId, GetTaggedImagesOptionalParameter getTaggedImagesOptionalParameter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getTaggedImagesWithServiceResponseAsync(projectId, getTaggedImagesOptionalParameter), serviceCallback); + } + + /** + * Get tagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id + * @param 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 + */ + public Observable> getTaggedImagesAsync(UUID projectId, GetTaggedImagesOptionalParameter getTaggedImagesOptionalParameter) { + return getTaggedImagesWithServiceResponseAsync(projectId, getTaggedImagesOptionalParameter).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get tagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id + * @param 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 + */ + public Observable>> getTaggedImagesWithServiceResponseAsync(UUID projectId, GetTaggedImagesOptionalParameter getTaggedImagesOptionalParameter) { + 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; + + return getTaggedImagesWithServiceResponseAsync(projectId, iterationId, tagIds, orderBy, take, skip); + } + + /** + * Get tagged images for a given project iteration. + * This API supports batching and range selection. By default it will only return first 50 images matching images. + Use the {take} and {skip} parameters to control how many images to return in a given batch. + The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and + "Cat" tags, then only images tagged with Dog and/or Cat will be returned. + * + * @param projectId The project id + * @param iterationId The iteration id. Defaults to workspace + * @param tagIds A list of tags ids to filter the images. Defaults to all tagged images when null. Limited to 20 + * @param orderBy The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest' + * @param take Maximum number of images to return. Defaults to 50, limited to 256 + * @param skip Number of images to skip before beginning the image batch. Defaults to 0 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Image> object + */ + public Observable>> getTaggedImagesWithServiceResponseAsync(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."); + } + 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.getTaggedImages(projectId, iterationId, tagIdsConverted, orderBy, take, skip, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getTaggedImagesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getTaggedImagesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + @Override + public TrainingsGetTaggedImagesParameters getTaggedImages() { + return new TrainingsGetTaggedImagesParameters(this); + } + + /** + * Internal class implementing TrainingsGetTaggedImagesDefinition. + */ + class TrainingsGetTaggedImagesParameters implements TrainingsGetTaggedImagesDefinition { + 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. + */ + TrainingsGetTaggedImagesParameters(TrainingsImpl parent) { + this.parent = parent; + } + + @Override + public TrainingsGetTaggedImagesParameters withProjectId(UUID projectId) { + this.projectId = projectId; + return this; + } + + @Override + public TrainingsGetTaggedImagesParameters withIterationId(UUID iterationId) { + this.iterationId = iterationId; + return this; + } + + @Override + public TrainingsGetTaggedImagesParameters 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(); + } + + @Override + public Observable> executeAsync() { + return getTaggedImagesWithServiceResponseAsync(projectId, iterationId, tagIds, orderBy, take, skip).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + } + + /** + * Get information about a specific domain. + * + * @param domainId The id of the domain to get information about + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Domain object if successful. + */ + public Domain getDomain(UUID domainId) { + return getDomainWithServiceResponseAsync(domainId).toBlocking().single().body(); + } + + /** + * Get information about a specific domain. + * + * @param domainId The id of the domain to get information about + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDomainAsync(UUID domainId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDomainWithServiceResponseAsync(domainId), serviceCallback); + } + + /** + * Get information about a specific domain. + * + * @param domainId The id of the domain to get information about + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Domain object + */ + public Observable getDomainAsync(UUID domainId) { + return getDomainWithServiceResponseAsync(domainId).map(new Func1, Domain>() { + @Override + public Domain call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get information about a specific domain. + * + * @param domainId The id of the domain to get information about + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Domain object + */ + public Observable> getDomainWithServiceResponseAsync(UUID domainId) { + if (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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDomainDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDomainDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of the available domains. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Domain> object if successful. + */ + public List getDomains() { + return getDomainsWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get a list of the available domains. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDomainsAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDomainsWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get a list of the available domains. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Domain> object + */ + public Observable> getDomainsAsync() { + return getDomainsWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of the available domains. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Domain> object + */ + public Observable>> getDomainsWithServiceResponseAsync() { + if (this.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()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDomainsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDomainsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/package-info.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/package-info.java new file mode 100644 index 000000000000..660ca0524a9a --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/package-info.java @@ -0,0 +1,10 @@ +// 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. + +/** + * This package contains the implementation classes for TrainingApi. + */ +package com.microsoft.azure.cognitiveservices.vision.customvision.training.implementation; diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/BoundingBox.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/BoundingBox.java new file mode 100644 index 000000000000..6576f1ce2f8b --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/BoundingBox.java @@ -0,0 +1,121 @@ +/** + * 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 BoundingBox model. + */ +public class BoundingBox { + /** + * The left property. + */ + @JsonProperty(value = "left") + private double left; + + /** + * The top property. + */ + @JsonProperty(value = "top") + private double top; + + /** + * The width property. + */ + @JsonProperty(value = "width") + private double width; + + /** + * The height property. + */ + @JsonProperty(value = "height") + private double height; + + /** + * Get the left value. + * + * @return the left value + */ + public double left() { + return this.left; + } + + /** + * Set the left value. + * + * @param left the left value to set + * @return the BoundingBox object itself. + */ + public BoundingBox withLeft(double left) { + this.left = left; + return this; + } + + /** + * Get the top value. + * + * @return the top value + */ + public double top() { + return this.top; + } + + /** + * Set the top value. + * + * @param top the top value to set + * @return the BoundingBox object itself. + */ + public BoundingBox withTop(double top) { + this.top = top; + return this; + } + + /** + * Get the width value. + * + * @return the width value + */ + public double width() { + return this.width; + } + + /** + * Set the width value. + * + * @param width the width value to set + * @return the BoundingBox object itself. + */ + public BoundingBox withWidth(double width) { + this.width = width; + return this; + } + + /** + * Get the height value. + * + * @return the height value + */ + public double height() { + return this.height; + } + + /** + * Set the height value. + * + * @param height the height value to set + * @return the BoundingBox object itself. + */ + public BoundingBox withHeight(double height) { + this.height = height; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Classifier.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Classifier.java new file mode 100644 index 000000000000..7fe513a3706f --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Classifier.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 Classifier. + */ +public final class Classifier extends ExpandableStringEnum { + /** Static value Multiclass for Classifier. */ + public static final Classifier MULTICLASS = fromString("Multiclass"); + + /** Static value Multilabel for Classifier. */ + public static final Classifier MULTILABEL = fromString("Multilabel"); + + /** + * Creates or finds a Classifier from its string representation. + * @param name a name to look for + * @return the corresponding Classifier + */ + @JsonCreator + public static Classifier fromString(String name) { + return fromString(name, Classifier.class); + } + + /** + * @return known Classifier values + */ + public static Collection values() { + return values(Classifier.class); + } +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateImageRegionsOptionalParameter.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateImageRegionsOptionalParameter.java new file mode 100644 index 000000000000..217c0cf13d15 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateImageRegionsOptionalParameter.java @@ -0,0 +1,67 @@ +/** + * 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.List; + +/** + * The CreateImageRegionsOptionalParameter model. + */ +public class CreateImageRegionsOptionalParameter { + /** + * The regions property. + */ + private List regions; + + /** + * Gets or sets the preferred language for the response. + */ + private String thisclientacceptLanguage; + + /** + * Get the regions value. + * + * @return the regions value + */ + public List regions() { + return this.regions; + } + + /** + * Set the regions value. + * + * @param regions the regions value to set + * @return the CreateImageRegionsOptionalParameter object itself. + */ + public CreateImageRegionsOptionalParameter withRegions(List regions) { + this.regions = regions; + 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 CreateImageRegionsOptionalParameter object itself. + */ + public CreateImageRegionsOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateImageTagsOptionalParameter.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateImageTagsOptionalParameter.java new file mode 100644 index 000000000000..0d799023b94c --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateImageTagsOptionalParameter.java @@ -0,0 +1,67 @@ +/** + * 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.List; + +/** + * The CreateImageTagsOptionalParameter model. + */ +public class CreateImageTagsOptionalParameter { + /** + * The tags property. + */ + private List tags; + + /** + * Gets or sets the preferred language for the response. + */ + private String thisclientacceptLanguage; + + /** + * Get the tags value. + * + * @return the tags value + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the CreateImageTagsOptionalParameter object itself. + */ + public CreateImageTagsOptionalParameter withTags(List tags) { + this.tags = tags; + 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 CreateImageTagsOptionalParameter object itself. + */ + public CreateImageTagsOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateImagesFromDataOptionalParameter.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateImagesFromDataOptionalParameter.java new file mode 100644 index 000000000000..330ca1ae6afb --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateImagesFromDataOptionalParameter.java @@ -0,0 +1,67 @@ +/** + * 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.List; + +/** + * The CreateImagesFromDataOptionalParameter model. + */ +public class CreateImagesFromDataOptionalParameter { + /** + * The tags ids with which to tag each image. Limited to 20. + */ + private List tagIds; + + /** + * Gets or sets the preferred language for the response. + */ + private String thisclientacceptLanguage; + + /** + * Get the tagIds value. + * + * @return the tagIds value + */ + public List tagIds() { + return this.tagIds; + } + + /** + * Set the tagIds value. + * + * @param tagIds the tagIds value to set + * @return the CreateImagesFromDataOptionalParameter object itself. + */ + public CreateImagesFromDataOptionalParameter withTagIds(List tagIds) { + this.tagIds = tagIds; + 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 CreateImagesFromDataOptionalParameter object itself. + */ + public CreateImagesFromDataOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateProjectOptionalParameter.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateProjectOptionalParameter.java new file mode 100644 index 000000000000..50a620f1ddaa --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateProjectOptionalParameter.java @@ -0,0 +1,118 @@ +/** + * 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.UUID; + +/** + * The CreateProjectOptionalParameter model. + */ +public class CreateProjectOptionalParameter { + /** + * The description of the project. + */ + private String description; + + /** + * The id of the domain to use for this project. Defaults to General. + */ + private UUID domainId; + + /** + * The type of classifier to create for this project. Possible values + * include: 'Multiclass', 'Multilabel'. + */ + private String classificationType; + + /** + * Gets or sets the preferred language for the response. + */ + private String thisclientacceptLanguage; + + /** + * Get the description value. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description value. + * + * @param description the description value to set + * @return the CreateProjectOptionalParameter object itself. + */ + public CreateProjectOptionalParameter withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the domainId value. + * + * @return the domainId value + */ + public UUID domainId() { + return this.domainId; + } + + /** + * Set the domainId value. + * + * @param domainId the domainId value to set + * @return the CreateProjectOptionalParameter object itself. + */ + public CreateProjectOptionalParameter withDomainId(UUID domainId) { + this.domainId = domainId; + return this; + } + + /** + * Get the classificationType value. + * + * @return the classificationType value + */ + public String classificationType() { + return this.classificationType; + } + + /** + * Set the classificationType value. + * + * @param classificationType the classificationType value to set + * @return the CreateProjectOptionalParameter object itself. + */ + public CreateProjectOptionalParameter withClassificationType(String classificationType) { + this.classificationType = classificationType; + 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 CreateProjectOptionalParameter object itself. + */ + public CreateProjectOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateTagOptionalParameter.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateTagOptionalParameter.java new file mode 100644 index 000000000000..c1af590bef1f --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/CreateTagOptionalParameter.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.training.models; + + +/** + * The CreateTagOptionalParameter model. + */ +public class CreateTagOptionalParameter { + /** + * Optional description for the tag. + */ + private String description; + + /** + * Gets or sets the preferred language for the response. + */ + private String thisclientacceptLanguage; + + /** + * Get the description value. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description value. + * + * @param description the description value to set + * @return the CreateTagOptionalParameter object itself. + */ + public CreateTagOptionalParameter withDescription(String description) { + this.description = description; + 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 CreateTagOptionalParameter object itself. + */ + public CreateTagOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Domain.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Domain.java new file mode 100644 index 000000000000..aa6d35c493cd --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Domain.java @@ -0,0 +1,93 @@ +/** + * 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.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Domain model. + */ +public class Domain { + /** + * The id property. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private UUID id; + + /** + * The name property. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Possible values include: 'Classification', 'ObjectDetection'. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private DomainType type; + + /** + * The exportable property. + */ + @JsonProperty(value = "exportable", access = JsonProperty.Access.WRITE_ONLY) + private boolean exportable; + + /** + * The enabled property. + */ + @JsonProperty(value = "enabled", access = JsonProperty.Access.WRITE_ONLY) + private boolean enabled; + + /** + * Get the id value. + * + * @return the id value + */ + public UUID id() { + return this.id; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the type value. + * + * @return the type value + */ + public DomainType type() { + return this.type; + } + + /** + * Get the exportable value. + * + * @return the exportable value + */ + public boolean exportable() { + return this.exportable; + } + + /** + * Get the enabled value. + * + * @return the enabled value + */ + public boolean enabled() { + return this.enabled; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/DomainType.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/DomainType.java new file mode 100644 index 000000000000..168af3cbb156 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/DomainType.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 DomainType. + */ +public final class DomainType extends ExpandableStringEnum { + /** Static value Classification for DomainType. */ + public static final DomainType CLASSIFICATION = fromString("Classification"); + + /** Static value ObjectDetection for DomainType. */ + public static final DomainType OBJECT_DETECTION = fromString("ObjectDetection"); + + /** + * Creates or finds a DomainType from its string representation. + * @param name a name to look for + * @return the corresponding DomainType + */ + @JsonCreator + public static DomainType fromString(String name) { + return fromString(name, DomainType.class); + } + + /** + * @return known DomainType values + */ + public static Collection values() { + return values(DomainType.class); + } +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Export.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Export.java new file mode 100644 index 000000000000..c4dc3d42098e --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Export.java @@ -0,0 +1,92 @@ +/** + * 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 Export model. + */ +public class Export { + /** + * Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX'. + */ + @JsonProperty(value = "platform", access = JsonProperty.Access.WRITE_ONLY) + private ExportPlatform platform; + + /** + * Possible values include: 'Exporting', 'Failed', 'Done'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ExportStatusModel status; + + /** + * The downloadUri property. + */ + @JsonProperty(value = "downloadUri", access = JsonProperty.Access.WRITE_ONLY) + private String downloadUri; + + /** + * Possible values include: 'Linux', 'Windows'. + */ + @JsonProperty(value = "flavor", access = JsonProperty.Access.WRITE_ONLY) + private ExportFlavor flavor; + + /** + * The newerVersionAvailable property. + */ + @JsonProperty(value = "newerVersionAvailable", access = JsonProperty.Access.WRITE_ONLY) + private boolean newerVersionAvailable; + + /** + * Get the platform value. + * + * @return the platform value + */ + public ExportPlatform platform() { + return this.platform; + } + + /** + * Get the status value. + * + * @return the status value + */ + public ExportStatusModel status() { + return this.status; + } + + /** + * Get the downloadUri value. + * + * @return the downloadUri value + */ + public String downloadUri() { + return this.downloadUri; + } + + /** + * Get the flavor value. + * + * @return the flavor value + */ + public ExportFlavor flavor() { + return this.flavor; + } + + /** + * Get the newerVersionAvailable value. + * + * @return the newerVersionAvailable value + */ + public boolean newerVersionAvailable() { + return this.newerVersionAvailable; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportFlavor.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportFlavor.java new file mode 100644 index 000000000000..72aeb179147e --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportFlavor.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 ExportFlavor. + */ +public final class ExportFlavor extends ExpandableStringEnum { + /** Static value Linux for ExportFlavor. */ + public static final ExportFlavor LINUX = fromString("Linux"); + + /** Static value Windows for ExportFlavor. */ + public static final ExportFlavor WINDOWS = fromString("Windows"); + + /** + * Creates or finds a ExportFlavor from its string representation. + * @param name a name to look for + * @return the corresponding ExportFlavor + */ + @JsonCreator + public static ExportFlavor fromString(String name) { + return fromString(name, ExportFlavor.class); + } + + /** + * @return known ExportFlavor values + */ + public static Collection values() { + return values(ExportFlavor.class); + } +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportIterationOptionalParameter.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportIterationOptionalParameter.java new file mode 100644 index 000000000000..9afa55cc54bd --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportIterationOptionalParameter.java @@ -0,0 +1,67 @@ +/** + * 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 ExportIterationOptionalParameter model. + */ +public class ExportIterationOptionalParameter { + /** + * The flavor of the target platform (Windows, Linux, ARM, or GPU). + * Possible values include: 'Linux', 'Windows'. + */ + private String flavor; + + /** + * Gets or sets the preferred language for the response. + */ + private String thisclientacceptLanguage; + + /** + * Get the flavor value. + * + * @return the flavor value + */ + public String flavor() { + return this.flavor; + } + + /** + * Set the flavor value. + * + * @param flavor the flavor value to set + * @return the ExportIterationOptionalParameter object itself. + */ + public ExportIterationOptionalParameter withFlavor(String flavor) { + this.flavor = flavor; + 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 ExportIterationOptionalParameter object itself. + */ + public ExportIterationOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportPlatform.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportPlatform.java new file mode 100644 index 000000000000..563148e4ad36 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportPlatform.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.cognitiveservices.vision.customvision.training.models; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ExportPlatform. + */ +public final class ExportPlatform extends ExpandableStringEnum { + /** Static value CoreML for ExportPlatform. */ + public static final ExportPlatform CORE_ML = fromString("CoreML"); + + /** Static value TensorFlow for ExportPlatform. */ + public static final ExportPlatform TENSOR_FLOW = fromString("TensorFlow"); + + /** Static value DockerFile for ExportPlatform. */ + public static final ExportPlatform DOCKER_FILE = fromString("DockerFile"); + + /** Static value ONNX for ExportPlatform. */ + public static final ExportPlatform ONNX = fromString("ONNX"); + + /** + * Creates or finds a ExportPlatform from its string representation. + * @param name a name to look for + * @return the corresponding ExportPlatform + */ + @JsonCreator + public static ExportPlatform fromString(String name) { + return fromString(name, ExportPlatform.class); + } + + /** + * @return known ExportPlatform values + */ + public static Collection values() { + return values(ExportPlatform.class); + } +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportStatusModel.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportStatusModel.java new file mode 100644 index 000000000000..533c5e883c50 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ExportStatusModel.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 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/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetImagePerformanceCountOptionalParameter.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetImagePerformanceCountOptionalParameter.java new file mode 100644 index 000000000000..5d049896a99e --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetImagePerformanceCountOptionalParameter.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.List; + +/** + * The GetImagePerformanceCountOptionalParameter model. + */ +public class GetImagePerformanceCountOptionalParameter { + /** + * A list of tags ids to filter the images to count. Defaults to all tags + * when null. + */ + private List tagIds; + + /** + * Gets or sets the preferred language for the response. + */ + private String thisclientacceptLanguage; + + /** + * Get the tagIds value. + * + * @return the tagIds value + */ + public List tagIds() { + return this.tagIds; + } + + /** + * Set the tagIds value. + * + * @param tagIds the tagIds value to set + * @return the GetImagePerformanceCountOptionalParameter object itself. + */ + public GetImagePerformanceCountOptionalParameter withTagIds(List tagIds) { + this.tagIds = tagIds; + 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 GetImagePerformanceCountOptionalParameter object itself. + */ + public GetImagePerformanceCountOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetImagePerformancesOptionalParameter.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetImagePerformancesOptionalParameter.java new file mode 100644 index 000000000000..0ec8af788ad8 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetImagePerformancesOptionalParameter.java @@ -0,0 +1,145 @@ +/** + * 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.List; + +/** + * The GetImagePerformancesOptionalParameter model. + */ +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; + + /** + * The ordering. Defaults to newest. Possible values include: 'Newest', + * 'Oldest'. + */ + private String orderBy; + + /** + * Maximum number of images to return. Defaults to 50, limited to 256. + */ + private Integer take; + + /** + * Number of images to skip before beginning the image batch. Defaults to + * 0. + */ + private Integer skip; + + /** + * Gets or sets the preferred language for the response. + */ + private String thisclientacceptLanguage; + + /** + * Get the tagIds value. + * + * @return the tagIds value + */ + public List tagIds() { + return this.tagIds; + } + + /** + * Set the tagIds value. + * + * @param tagIds the tagIds value to set + * @return the GetImagePerformancesOptionalParameter object itself. + */ + public GetImagePerformancesOptionalParameter withTagIds(List tagIds) { + this.tagIds = tagIds; + return this; + } + + /** + * Get the orderBy value. + * + * @return the orderBy value + */ + public String orderBy() { + return this.orderBy; + } + + /** + * Set the orderBy value. + * + * @param orderBy the orderBy value to set + * @return the GetImagePerformancesOptionalParameter object itself. + */ + public GetImagePerformancesOptionalParameter withOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + /** + * Get the take value. + * + * @return the take value + */ + public Integer take() { + return this.take; + } + + /** + * Set the take value. + * + * @param take the take value to set + * @return the GetImagePerformancesOptionalParameter object itself. + */ + public GetImagePerformancesOptionalParameter withTake(Integer take) { + this.take = take; + return this; + } + + /** + * Get the skip value. + * + * @return the skip value + */ + public Integer skip() { + return this.skip; + } + + /** + * Set the skip value. + * + * @param skip the skip value to set + * @return the GetImagePerformancesOptionalParameter object itself. + */ + public GetImagePerformancesOptionalParameter withSkip(Integer skip) { + this.skip = skip; + 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 GetImagePerformancesOptionalParameter object itself. + */ + public GetImagePerformancesOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetImagesByIdsOptionalParameter.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetImagesByIdsOptionalParameter.java new file mode 100644 index 000000000000..442d8ebd1965 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetImagesByIdsOptionalParameter.java @@ -0,0 +1,93 @@ +/** + * 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.List; +import java.util.UUID; + +/** + * The GetImagesByIdsOptionalParameter model. + */ +public class GetImagesByIdsOptionalParameter { + /** + * The list of image ids to retrieve. Limited to 256. + */ + private List imageIds; + + /** + * The iteration id. Defaults to workspace. + */ + private UUID iterationId; + + /** + * Gets or sets the preferred language for the response. + */ + private String thisclientacceptLanguage; + + /** + * Get the imageIds value. + * + * @return the imageIds value + */ + public List imageIds() { + return this.imageIds; + } + + /** + * Set the imageIds value. + * + * @param imageIds the imageIds value to set + * @return the GetImagesByIdsOptionalParameter object itself. + */ + public GetImagesByIdsOptionalParameter withImageIds(List imageIds) { + this.imageIds = imageIds; + return this; + } + + /** + * 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 GetImagesByIdsOptionalParameter object itself. + */ + public GetImagesByIdsOptionalParameter withIterationId(UUID iterationId) { + this.iterationId = iterationId; + 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 GetImagesByIdsOptionalParameter object itself. + */ + public GetImagesByIdsOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetIterationPerformanceOptionalParameter.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetIterationPerformanceOptionalParameter.java new file mode 100644 index 000000000000..65b92616df6e --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetIterationPerformanceOptionalParameter.java @@ -0,0 +1,92 @@ +/** + * 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 GetIterationPerformanceOptionalParameter model. + */ +public class GetIterationPerformanceOptionalParameter { + /** + * The threshold used to determine true predictions. + */ + private Double threshold; + + /** + * If applicable, the bounding box overlap threshold used to determine true + * predictions. + */ + private Double overlapThreshold; + + /** + * Gets or sets the preferred language for the response. + */ + private String thisclientacceptLanguage; + + /** + * Get the threshold value. + * + * @return the threshold value + */ + public Double threshold() { + return this.threshold; + } + + /** + * Set the threshold value. + * + * @param threshold the threshold value to set + * @return the GetIterationPerformanceOptionalParameter object itself. + */ + public GetIterationPerformanceOptionalParameter withThreshold(Double threshold) { + this.threshold = threshold; + return this; + } + + /** + * Get the overlapThreshold value. + * + * @return the overlapThreshold value + */ + public Double overlapThreshold() { + return this.overlapThreshold; + } + + /** + * Set the overlapThreshold value. + * + * @param overlapThreshold the overlapThreshold value to set + * @return the GetIterationPerformanceOptionalParameter object itself. + */ + public GetIterationPerformanceOptionalParameter withOverlapThreshold(Double overlapThreshold) { + this.overlapThreshold = overlapThreshold; + 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 GetIterationPerformanceOptionalParameter object itself. + */ + public GetIterationPerformanceOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetTagOptionalParameter.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetTagOptionalParameter.java new file mode 100644 index 000000000000..9046262baea7 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetTagOptionalParameter.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.UUID; + +/** + * The GetTagOptionalParameter model. + */ +public class GetTagOptionalParameter { + /** + * The iteration to retrieve this tag from. Optional, defaults to current + * training set. + */ + private UUID iterationId; + + /** + * 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 GetTagOptionalParameter object itself. + */ + public GetTagOptionalParameter withIterationId(UUID iterationId) { + this.iterationId = iterationId; + 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 GetTagOptionalParameter object itself. + */ + public GetTagOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetTaggedImageCountOptionalParameter.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetTaggedImageCountOptionalParameter.java new file mode 100644 index 000000000000..fe834425ae31 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetTaggedImageCountOptionalParameter.java @@ -0,0 +1,94 @@ +/** + * 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.UUID; +import java.util.List; + +/** + * The GetTaggedImageCountOptionalParameter model. + */ +public class GetTaggedImageCountOptionalParameter { + /** + * The iteration id. Defaults to workspace. + */ + private UUID iterationId; + + /** + * A list of tags ids to filter the images to count. Defaults to all tags + * when null. + */ + private List tagIds; + + /** + * 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 GetTaggedImageCountOptionalParameter object itself. + */ + public GetTaggedImageCountOptionalParameter withIterationId(UUID iterationId) { + this.iterationId = iterationId; + return this; + } + + /** + * Get the tagIds value. + * + * @return the tagIds value + */ + public List tagIds() { + return this.tagIds; + } + + /** + * Set the tagIds value. + * + * @param tagIds the tagIds value to set + * @return the GetTaggedImageCountOptionalParameter object itself. + */ + public GetTaggedImageCountOptionalParameter withTagIds(List tagIds) { + this.tagIds = tagIds; + 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 GetTaggedImageCountOptionalParameter object itself. + */ + public GetTaggedImageCountOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetTaggedImagesOptionalParameter.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetTaggedImagesOptionalParameter.java new file mode 100644 index 000000000000..306b1f337a02 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetTaggedImagesOptionalParameter.java @@ -0,0 +1,171 @@ +/** + * 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.UUID; +import java.util.List; + +/** + * The GetTaggedImagesOptionalParameter model. + */ +public class GetTaggedImagesOptionalParameter { + /** + * The iteration id. Defaults to workspace. + */ + private UUID iterationId; + + /** + * A list of tags ids to filter the images. Defaults to all tagged images + * when null. Limited to 20. + */ + private List tagIds; + + /** + * The ordering. Defaults to newest. Possible values include: 'Newest', + * 'Oldest'. + */ + private String orderBy; + + /** + * Maximum number of images to return. Defaults to 50, limited to 256. + */ + private Integer take; + + /** + * Number of images to skip before beginning the image batch. Defaults to + * 0. + */ + private Integer skip; + + /** + * 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 GetTaggedImagesOptionalParameter object itself. + */ + public GetTaggedImagesOptionalParameter withIterationId(UUID iterationId) { + this.iterationId = iterationId; + return this; + } + + /** + * Get the tagIds value. + * + * @return the tagIds value + */ + public List tagIds() { + return this.tagIds; + } + + /** + * Set the tagIds value. + * + * @param tagIds the tagIds value to set + * @return the GetTaggedImagesOptionalParameter object itself. + */ + public GetTaggedImagesOptionalParameter withTagIds(List tagIds) { + this.tagIds = tagIds; + return this; + } + + /** + * Get the orderBy value. + * + * @return the orderBy value + */ + public String orderBy() { + return this.orderBy; + } + + /** + * Set the orderBy value. + * + * @param orderBy the orderBy value to set + * @return the GetTaggedImagesOptionalParameter object itself. + */ + public GetTaggedImagesOptionalParameter withOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + /** + * Get the take value. + * + * @return the take value + */ + public Integer take() { + return this.take; + } + + /** + * Set the take value. + * + * @param take the take value to set + * @return the GetTaggedImagesOptionalParameter object itself. + */ + public GetTaggedImagesOptionalParameter withTake(Integer take) { + this.take = take; + return this; + } + + /** + * Get the skip value. + * + * @return the skip value + */ + public Integer skip() { + return this.skip; + } + + /** + * Set the skip value. + * + * @param skip the skip value to set + * @return the GetTaggedImagesOptionalParameter object itself. + */ + public GetTaggedImagesOptionalParameter withSkip(Integer skip) { + this.skip = skip; + 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 GetTaggedImagesOptionalParameter object itself. + */ + public GetTaggedImagesOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetTagsOptionalParameter.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetTagsOptionalParameter.java new file mode 100644 index 000000000000..64f4cd56b3d2 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetTagsOptionalParameter.java @@ -0,0 +1,67 @@ +/** + * 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.UUID; + +/** + * The GetTagsOptionalParameter model. + */ +public class GetTagsOptionalParameter { + /** + * The iteration id. Defaults to workspace. + */ + private UUID iterationId; + + /** + * 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 GetTagsOptionalParameter object itself. + */ + public GetTagsOptionalParameter withIterationId(UUID iterationId) { + this.iterationId = iterationId; + 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 GetTagsOptionalParameter object itself. + */ + public GetTagsOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetUntaggedImageCountOptionalParameter.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetUntaggedImageCountOptionalParameter.java new file mode 100644 index 000000000000..8c238aba3cce --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetUntaggedImageCountOptionalParameter.java @@ -0,0 +1,67 @@ +/** + * 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.UUID; + +/** + * The GetUntaggedImageCountOptionalParameter model. + */ +public class GetUntaggedImageCountOptionalParameter { + /** + * The iteration id. Defaults to workspace. + */ + private UUID iterationId; + + /** + * 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 GetUntaggedImageCountOptionalParameter object itself. + */ + public GetUntaggedImageCountOptionalParameter withIterationId(UUID iterationId) { + this.iterationId = iterationId; + 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 GetUntaggedImageCountOptionalParameter object itself. + */ + public GetUntaggedImageCountOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetUntaggedImagesOptionalParameter.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetUntaggedImagesOptionalParameter.java new file mode 100644 index 000000000000..9cd9bbb9f09e --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/GetUntaggedImagesOptionalParameter.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; + +import java.util.UUID; + +/** + * The GetUntaggedImagesOptionalParameter model. + */ +public class GetUntaggedImagesOptionalParameter { + /** + * The iteration id. Defaults to workspace. + */ + private UUID iterationId; + + /** + * The ordering. Defaults to newest. Possible values include: 'Newest', + * 'Oldest'. + */ + private String orderBy; + + /** + * Maximum number of images to return. Defaults to 50, limited to 256. + */ + private Integer take; + + /** + * Number of images to skip before beginning the image batch. Defaults to + * 0. + */ + private Integer skip; + + /** + * 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 GetUntaggedImagesOptionalParameter object itself. + */ + public GetUntaggedImagesOptionalParameter withIterationId(UUID iterationId) { + this.iterationId = iterationId; + return this; + } + + /** + * Get the orderBy value. + * + * @return the orderBy value + */ + public String orderBy() { + return this.orderBy; + } + + /** + * Set the orderBy value. + * + * @param orderBy the orderBy value to set + * @return the GetUntaggedImagesOptionalParameter object itself. + */ + public GetUntaggedImagesOptionalParameter withOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + /** + * Get the take value. + * + * @return the take value + */ + public Integer take() { + return this.take; + } + + /** + * Set the take value. + * + * @param take the take value to set + * @return the GetUntaggedImagesOptionalParameter object itself. + */ + public GetUntaggedImagesOptionalParameter withTake(Integer take) { + this.take = take; + return this; + } + + /** + * Get the skip value. + * + * @return the skip value + */ + public Integer skip() { + return this.skip; + } + + /** + * Set the skip value. + * + * @param skip the skip value to set + * @return the GetUntaggedImagesOptionalParameter object itself. + */ + public GetUntaggedImagesOptionalParameter withSkip(Integer skip) { + this.skip = skip; + 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 GetUntaggedImagesOptionalParameter object itself. + */ + public GetUntaggedImagesOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Image.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Image.java new file mode 100644 index 000000000000..2dd19b767654 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Image.java @@ -0,0 +1,140 @@ +/** + * 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.UUID; +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Image model to be sent as JSON. + */ +public class Image { + /** + * The id property. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private UUID id; + + /** + * The created property. + */ + @JsonProperty(value = "created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The width property. + */ + @JsonProperty(value = "width", access = JsonProperty.Access.WRITE_ONLY) + private int width; + + /** + * The height property. + */ + @JsonProperty(value = "height", access = JsonProperty.Access.WRITE_ONLY) + private int height; + + /** + * The imageUri property. + */ + @JsonProperty(value = "imageUri", access = JsonProperty.Access.WRITE_ONLY) + private String imageUri; + + /** + * The thumbnailUri property. + */ + @JsonProperty(value = "thumbnailUri", access = JsonProperty.Access.WRITE_ONLY) + private String thumbnailUri; + + /** + * The tags property. + */ + @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) + private List tags; + + /** + * The regions property. + */ + @JsonProperty(value = "regions", access = JsonProperty.Access.WRITE_ONLY) + private List regions; + + /** + * Get the id value. + * + * @return the id value + */ + public UUID id() { + return this.id; + } + + /** + * Get the created value. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the width value. + * + * @return the width value + */ + public int width() { + return this.width; + } + + /** + * Get the height value. + * + * @return the height value + */ + public int height() { + return this.height; + } + + /** + * Get the imageUri value. + * + * @return the imageUri value + */ + public String imageUri() { + return this.imageUri; + } + + /** + * Get the thumbnailUri value. + * + * @return the thumbnailUri value + */ + public String thumbnailUri() { + return this.thumbnailUri; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public List tags() { + return this.tags; + } + + /** + * Get the regions value. + * + * @return the regions value + */ + public List regions() { + return this.regions; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageCreateResult.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageCreateResult.java new file mode 100644 index 000000000000..550d0a0ec3b7 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageCreateResult.java @@ -0,0 +1,65 @@ +/** + * 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 ImageCreateResult model. + */ +public class ImageCreateResult { + /** + * The sourceUrl property. + */ + @JsonProperty(value = "sourceUrl", access = JsonProperty.Access.WRITE_ONLY) + private String sourceUrl; + + /** + * Possible values include: 'OK', 'OKDuplicate', 'ErrorSource', + * 'ErrorImageFormat', 'ErrorImageSize', 'ErrorStorage', + * 'ErrorLimitExceed', 'ErrorTagLimitExceed', 'ErrorRegionLimitExceed', + * 'ErrorUnknown'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ImageUploadStatus status; + + /** + * The image property. + */ + @JsonProperty(value = "image", access = JsonProperty.Access.WRITE_ONLY) + private Image image; + + /** + * Get the sourceUrl value. + * + * @return the sourceUrl value + */ + public String sourceUrl() { + return this.sourceUrl; + } + + /** + * Get the status value. + * + * @return the status value + */ + public ImageUploadStatus status() { + return this.status; + } + + /** + * Get the image value. + * + * @return the image value + */ + public Image image() { + return this.image; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageCreateSummary.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageCreateSummary.java new file mode 100644 index 000000000000..16597571a075 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageCreateSummary.java @@ -0,0 +1,48 @@ +/** + * 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.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ImageCreateSummary model. + */ +public class ImageCreateSummary { + /** + * The isBatchSuccessful property. + */ + @JsonProperty(value = "isBatchSuccessful", access = JsonProperty.Access.WRITE_ONLY) + private boolean isBatchSuccessful; + + /** + * The images property. + */ + @JsonProperty(value = "images", access = JsonProperty.Access.WRITE_ONLY) + private List images; + + /** + * Get the isBatchSuccessful value. + * + * @return the isBatchSuccessful value + */ + public boolean isBatchSuccessful() { + return this.isBatchSuccessful; + } + + /** + * Get the images value. + * + * @return the images value + */ + public List images() { + return this.images; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageFileCreateBatch.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageFileCreateBatch.java new file mode 100644 index 000000000000..e482d940e2ef --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageFileCreateBatch.java @@ -0,0 +1,71 @@ +/** + * 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.List; +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ImageFileCreateBatch model. + */ +public class ImageFileCreateBatch { + /** + * The images property. + */ + @JsonProperty(value = "images") + private List images; + + /** + * The tagIds property. + */ + @JsonProperty(value = "tagIds") + private List tagIds; + + /** + * Get the images value. + * + * @return the images value + */ + public List images() { + return this.images; + } + + /** + * Set the images value. + * + * @param images the images value to set + * @return the ImageFileCreateBatch object itself. + */ + public ImageFileCreateBatch withImages(List images) { + this.images = images; + return this; + } + + /** + * Get the tagIds value. + * + * @return the tagIds value + */ + public List tagIds() { + return this.tagIds; + } + + /** + * Set the tagIds value. + * + * @param tagIds the tagIds value to set + * @return the ImageFileCreateBatch object itself. + */ + public ImageFileCreateBatch withTagIds(List tagIds) { + this.tagIds = tagIds; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageFileCreateEntry.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageFileCreateEntry.java new file mode 100644 index 000000000000..ffb24a279748 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageFileCreateEntry.java @@ -0,0 +1,123 @@ +/** + * 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.List; +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ImageFileCreateEntry model. + */ +public class ImageFileCreateEntry { + /** + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The contents property. + */ + @JsonProperty(value = "contents") + private byte[] contents; + + /** + * The tagIds property. + */ + @JsonProperty(value = "tagIds") + private List tagIds; + + /** + * The regions property. + */ + @JsonProperty(value = "regions") + private List regions; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the ImageFileCreateEntry object itself. + */ + public ImageFileCreateEntry withName(String name) { + this.name = name; + return this; + } + + /** + * Get the contents value. + * + * @return the contents value + */ + public byte[] contents() { + return this.contents; + } + + /** + * Set the contents value. + * + * @param contents the contents value to set + * @return the ImageFileCreateEntry object itself. + */ + public ImageFileCreateEntry withContents(byte[] contents) { + this.contents = contents; + return this; + } + + /** + * Get the tagIds value. + * + * @return the tagIds value + */ + public List tagIds() { + return this.tagIds; + } + + /** + * Set the tagIds value. + * + * @param tagIds the tagIds value to set + * @return the ImageFileCreateEntry object itself. + */ + public ImageFileCreateEntry withTagIds(List tagIds) { + this.tagIds = tagIds; + return this; + } + + /** + * Get the regions value. + * + * @return the regions value + */ + public List regions() { + return this.regions; + } + + /** + * Set the regions value. + * + * @param regions the regions value to set + * @return the ImageFileCreateEntry object itself. + */ + public ImageFileCreateEntry withRegions(List regions) { + this.regions = regions; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageIdCreateBatch.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageIdCreateBatch.java new file mode 100644 index 000000000000..7e6d2aef3020 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageIdCreateBatch.java @@ -0,0 +1,71 @@ +/** + * 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.List; +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ImageIdCreateBatch model. + */ +public class ImageIdCreateBatch { + /** + * The images property. + */ + @JsonProperty(value = "images") + private List images; + + /** + * The tagIds property. + */ + @JsonProperty(value = "tagIds") + private List tagIds; + + /** + * Get the images value. + * + * @return the images value + */ + public List images() { + return this.images; + } + + /** + * Set the images value. + * + * @param images the images value to set + * @return the ImageIdCreateBatch object itself. + */ + public ImageIdCreateBatch withImages(List images) { + this.images = images; + return this; + } + + /** + * Get the tagIds value. + * + * @return the tagIds value + */ + public List tagIds() { + return this.tagIds; + } + + /** + * Set the tagIds value. + * + * @param tagIds the tagIds value to set + * @return the ImageIdCreateBatch object itself. + */ + public ImageIdCreateBatch withTagIds(List tagIds) { + this.tagIds = tagIds; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageIdCreateEntry.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageIdCreateEntry.java new file mode 100644 index 000000000000..050efd57101b --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageIdCreateEntry.java @@ -0,0 +1,97 @@ +/** + * 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.UUID; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ImageIdCreateEntry model. + */ +public class ImageIdCreateEntry { + /** + * The id property. + */ + @JsonProperty(value = "id") + private UUID id; + + /** + * The tagIds property. + */ + @JsonProperty(value = "tagIds") + private List tagIds; + + /** + * The regions property. + */ + @JsonProperty(value = "regions") + private List regions; + + /** + * Get the id value. + * + * @return the id value + */ + public UUID id() { + return this.id; + } + + /** + * Set the id value. + * + * @param id the id value to set + * @return the ImageIdCreateEntry object itself. + */ + public ImageIdCreateEntry withId(UUID id) { + this.id = id; + return this; + } + + /** + * Get the tagIds value. + * + * @return the tagIds value + */ + public List tagIds() { + return this.tagIds; + } + + /** + * Set the tagIds value. + * + * @param tagIds the tagIds value to set + * @return the ImageIdCreateEntry object itself. + */ + public ImageIdCreateEntry withTagIds(List tagIds) { + this.tagIds = tagIds; + return this; + } + + /** + * Get the regions value. + * + * @return the regions value + */ + public List regions() { + return this.regions; + } + + /** + * Set the regions value. + * + * @param regions the regions value to set + * @return the ImageIdCreateEntry object itself. + */ + public ImageIdCreateEntry withRegions(List regions) { + this.regions = regions; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImagePerformance.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImagePerformance.java new file mode 100644 index 000000000000..f89830435139 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImagePerformance.java @@ -0,0 +1,155 @@ +/** + * 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.List; +import java.util.UUID; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Image performance model. + */ +public class ImagePerformance { + /** + * The predictions property. + */ + @JsonProperty(value = "predictions", access = JsonProperty.Access.WRITE_ONLY) + private List predictions; + + /** + * The id property. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private UUID id; + + /** + * The created property. + */ + @JsonProperty(value = "created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The width property. + */ + @JsonProperty(value = "width", access = JsonProperty.Access.WRITE_ONLY) + private int width; + + /** + * The height property. + */ + @JsonProperty(value = "height", access = JsonProperty.Access.WRITE_ONLY) + private int height; + + /** + * The imageUri property. + */ + @JsonProperty(value = "imageUri", access = JsonProperty.Access.WRITE_ONLY) + private String imageUri; + + /** + * The thumbnailUri property. + */ + @JsonProperty(value = "thumbnailUri", access = JsonProperty.Access.WRITE_ONLY) + private String thumbnailUri; + + /** + * The tags property. + */ + @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) + private List tags; + + /** + * The regions property. + */ + @JsonProperty(value = "regions", access = JsonProperty.Access.WRITE_ONLY) + private List regions; + + /** + * Get the predictions value. + * + * @return the predictions value + */ + public List predictions() { + return this.predictions; + } + + /** + * Get the id value. + * + * @return the id value + */ + public UUID id() { + return this.id; + } + + /** + * Get the created value. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the width value. + * + * @return the width value + */ + public int width() { + return this.width; + } + + /** + * Get the height value. + * + * @return the height value + */ + public int height() { + return this.height; + } + + /** + * Get the imageUri value. + * + * @return the imageUri value + */ + public String imageUri() { + return this.imageUri; + } + + /** + * Get the thumbnailUri value. + * + * @return the thumbnailUri value + */ + public String thumbnailUri() { + return this.thumbnailUri; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public List tags() { + return this.tags; + } + + /** + * Get the regions value. + * + * @return the regions value + */ + public List regions() { + return this.regions; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImagePrediction.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImagePrediction.java new file mode 100644 index 000000000000..81f0107ce3ae --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImagePrediction.java @@ -0,0 +1,95 @@ +/** + * 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.UUID; +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ImagePrediction model. + */ +public class ImagePrediction { + /** + * The id property. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private UUID id; + + /** + * The project property. + */ + @JsonProperty(value = "project", access = JsonProperty.Access.WRITE_ONLY) + private UUID project; + + /** + * The iteration property. + */ + @JsonProperty(value = "iteration", access = JsonProperty.Access.WRITE_ONLY) + private UUID iteration; + + /** + * The created property. + */ + @JsonProperty(value = "created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The predictions property. + */ + @JsonProperty(value = "predictions", access = JsonProperty.Access.WRITE_ONLY) + private List predictions; + + /** + * Get the id value. + * + * @return the id value + */ + public UUID id() { + return this.id; + } + + /** + * Get the project value. + * + * @return the project value + */ + public UUID project() { + return this.project; + } + + /** + * Get the iteration value. + * + * @return the iteration value + */ + public UUID iteration() { + return this.iteration; + } + + /** + * Get the created value. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the predictions value. + * + * @return the predictions value + */ + public List predictions() { + return this.predictions; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegion.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegion.java new file mode 100644 index 000000000000..36e160ed153d --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegion.java @@ -0,0 +1,194 @@ +/** + * 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.UUID; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ImageRegion model. + */ +public class ImageRegion { + /** + * The regionId property. + */ + @JsonProperty(value = "regionId", access = JsonProperty.Access.WRITE_ONLY) + private UUID regionId; + + /** + * The tagName property. + */ + @JsonProperty(value = "tagName", access = JsonProperty.Access.WRITE_ONLY) + private String tagName; + + /** + * The created property. + */ + @JsonProperty(value = "created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The tagId property. + */ + @JsonProperty(value = "tagId") + private UUID tagId; + + /** + * The left property. + */ + @JsonProperty(value = "left") + private double left; + + /** + * The top property. + */ + @JsonProperty(value = "top") + private double top; + + /** + * The width property. + */ + @JsonProperty(value = "width") + private double width; + + /** + * The height property. + */ + @JsonProperty(value = "height") + private double height; + + /** + * Get the regionId value. + * + * @return the regionId value + */ + public UUID regionId() { + return this.regionId; + } + + /** + * Get the tagName value. + * + * @return the tagName value + */ + public String tagName() { + return this.tagName; + } + + /** + * Get the created value. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the tagId value. + * + * @return the tagId value + */ + public UUID tagId() { + return this.tagId; + } + + /** + * Set the tagId value. + * + * @param tagId the tagId value to set + * @return the ImageRegion object itself. + */ + public ImageRegion withTagId(UUID tagId) { + this.tagId = tagId; + return this; + } + + /** + * Get the left value. + * + * @return the left value + */ + public double left() { + return this.left; + } + + /** + * Set the left value. + * + * @param left the left value to set + * @return the ImageRegion object itself. + */ + public ImageRegion withLeft(double left) { + this.left = left; + return this; + } + + /** + * Get the top value. + * + * @return the top value + */ + public double top() { + return this.top; + } + + /** + * Set the top value. + * + * @param top the top value to set + * @return the ImageRegion object itself. + */ + public ImageRegion withTop(double top) { + this.top = top; + return this; + } + + /** + * Get the width value. + * + * @return the width value + */ + public double width() { + return this.width; + } + + /** + * Set the width value. + * + * @param width the width value to set + * @return the ImageRegion object itself. + */ + public ImageRegion withWidth(double width) { + this.width = width; + return this; + } + + /** + * Get the height value. + * + * @return the height value + */ + public double height() { + return this.height; + } + + /** + * Set the height value. + * + * @param height the height value to set + * @return the ImageRegion object itself. + */ + public ImageRegion withHeight(double height) { + this.height = height; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionCreateBatch.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionCreateBatch.java new file mode 100644 index 000000000000..5e974e5ca76a --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionCreateBatch.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.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Batch of image region information to create. + */ +public class ImageRegionCreateBatch { + /** + * The regions property. + */ + @JsonProperty(value = "regions") + private List regions; + + /** + * Get the regions value. + * + * @return the regions value + */ + public List regions() { + return this.regions; + } + + /** + * Set the regions value. + * + * @param regions the regions value to set + * @return the ImageRegionCreateBatch object itself. + */ + public ImageRegionCreateBatch withRegions(List regions) { + this.regions = regions; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionCreateEntry.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionCreateEntry.java new file mode 100644 index 000000000000..077f0d78db63 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionCreateEntry.java @@ -0,0 +1,174 @@ +/** + * 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.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ImageRegionCreateEntry model. + */ +public class ImageRegionCreateEntry { + /** + * The imageId property. + */ + @JsonProperty(value = "imageId") + private UUID imageId; + + /** + * The tagId property. + */ + @JsonProperty(value = "tagId") + private UUID tagId; + + /** + * The left property. + */ + @JsonProperty(value = "left") + private double left; + + /** + * The top property. + */ + @JsonProperty(value = "top") + private double top; + + /** + * The width property. + */ + @JsonProperty(value = "width") + private double width; + + /** + * The height property. + */ + @JsonProperty(value = "height") + private double height; + + /** + * Get the imageId value. + * + * @return the imageId value + */ + public UUID imageId() { + return this.imageId; + } + + /** + * Set the imageId value. + * + * @param imageId the imageId value to set + * @return the ImageRegionCreateEntry object itself. + */ + public ImageRegionCreateEntry withImageId(UUID imageId) { + this.imageId = imageId; + return this; + } + + /** + * Get the tagId value. + * + * @return the tagId value + */ + public UUID tagId() { + return this.tagId; + } + + /** + * Set the tagId value. + * + * @param tagId the tagId value to set + * @return the ImageRegionCreateEntry object itself. + */ + public ImageRegionCreateEntry withTagId(UUID tagId) { + this.tagId = tagId; + return this; + } + + /** + * Get the left value. + * + * @return the left value + */ + public double left() { + return this.left; + } + + /** + * Set the left value. + * + * @param left the left value to set + * @return the ImageRegionCreateEntry object itself. + */ + public ImageRegionCreateEntry withLeft(double left) { + this.left = left; + return this; + } + + /** + * Get the top value. + * + * @return the top value + */ + public double top() { + return this.top; + } + + /** + * Set the top value. + * + * @param top the top value to set + * @return the ImageRegionCreateEntry object itself. + */ + public ImageRegionCreateEntry withTop(double top) { + this.top = top; + return this; + } + + /** + * Get the width value. + * + * @return the width value + */ + public double width() { + return this.width; + } + + /** + * Set the width value. + * + * @param width the width value to set + * @return the ImageRegionCreateEntry object itself. + */ + public ImageRegionCreateEntry withWidth(double width) { + this.width = width; + return this; + } + + /** + * Get the height value. + * + * @return the height value + */ + public double height() { + return this.height; + } + + /** + * Set the height value. + * + * @param height the height value to set + * @return the ImageRegionCreateEntry object itself. + */ + public ImageRegionCreateEntry withHeight(double height) { + this.height = height; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionCreateResult.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionCreateResult.java new file mode 100644 index 000000000000..212f89ba2b42 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionCreateResult.java @@ -0,0 +1,209 @@ +/** + * 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.UUID; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ImageRegionCreateResult model. + */ +public class ImageRegionCreateResult { + /** + * The imageId property. + */ + @JsonProperty(value = "imageId", access = JsonProperty.Access.WRITE_ONLY) + private UUID imageId; + + /** + * The regionId property. + */ + @JsonProperty(value = "regionId", access = JsonProperty.Access.WRITE_ONLY) + private UUID regionId; + + /** + * The tagName property. + */ + @JsonProperty(value = "tagName", access = JsonProperty.Access.WRITE_ONLY) + private String tagName; + + /** + * The created property. + */ + @JsonProperty(value = "created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The tagId property. + */ + @JsonProperty(value = "tagId") + private UUID tagId; + + /** + * The left property. + */ + @JsonProperty(value = "left") + private double left; + + /** + * The top property. + */ + @JsonProperty(value = "top") + private double top; + + /** + * The width property. + */ + @JsonProperty(value = "width") + private double width; + + /** + * The height property. + */ + @JsonProperty(value = "height") + private double height; + + /** + * Get the imageId value. + * + * @return the imageId value + */ + public UUID imageId() { + return this.imageId; + } + + /** + * Get the regionId value. + * + * @return the regionId value + */ + public UUID regionId() { + return this.regionId; + } + + /** + * Get the tagName value. + * + * @return the tagName value + */ + public String tagName() { + return this.tagName; + } + + /** + * Get the created value. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the tagId value. + * + * @return the tagId value + */ + public UUID tagId() { + return this.tagId; + } + + /** + * Set the tagId value. + * + * @param tagId the tagId value to set + * @return the ImageRegionCreateResult object itself. + */ + public ImageRegionCreateResult withTagId(UUID tagId) { + this.tagId = tagId; + return this; + } + + /** + * Get the left value. + * + * @return the left value + */ + public double left() { + return this.left; + } + + /** + * Set the left value. + * + * @param left the left value to set + * @return the ImageRegionCreateResult object itself. + */ + public ImageRegionCreateResult withLeft(double left) { + this.left = left; + return this; + } + + /** + * Get the top value. + * + * @return the top value + */ + public double top() { + return this.top; + } + + /** + * Set the top value. + * + * @param top the top value to set + * @return the ImageRegionCreateResult object itself. + */ + public ImageRegionCreateResult withTop(double top) { + this.top = top; + return this; + } + + /** + * Get the width value. + * + * @return the width value + */ + public double width() { + return this.width; + } + + /** + * Set the width value. + * + * @param width the width value to set + * @return the ImageRegionCreateResult object itself. + */ + public ImageRegionCreateResult withWidth(double width) { + this.width = width; + return this; + } + + /** + * Get the height value. + * + * @return the height value + */ + public double height() { + return this.height; + } + + /** + * Set the height value. + * + * @param height the height value to set + * @return the ImageRegionCreateResult object itself. + */ + public ImageRegionCreateResult withHeight(double height) { + this.height = height; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionCreateSummary.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionCreateSummary.java new file mode 100644 index 000000000000..8be9c1734c0e --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionCreateSummary.java @@ -0,0 +1,96 @@ +/** + * 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.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ImageRegionCreateSummary model. + */ +public class ImageRegionCreateSummary { + /** + * The created property. + */ + @JsonProperty(value = "created") + private List created; + + /** + * The duplicated property. + */ + @JsonProperty(value = "duplicated") + private List duplicated; + + /** + * The exceeded property. + */ + @JsonProperty(value = "exceeded") + private List exceeded; + + /** + * Get the created value. + * + * @return the created value + */ + public List created() { + return this.created; + } + + /** + * Set the created value. + * + * @param created the created value to set + * @return the ImageRegionCreateSummary object itself. + */ + public ImageRegionCreateSummary withCreated(List created) { + this.created = created; + return this; + } + + /** + * Get the duplicated value. + * + * @return the duplicated value + */ + public List duplicated() { + return this.duplicated; + } + + /** + * Set the duplicated value. + * + * @param duplicated the duplicated value to set + * @return the ImageRegionCreateSummary object itself. + */ + public ImageRegionCreateSummary withDuplicated(List duplicated) { + this.duplicated = duplicated; + return this; + } + + /** + * Get the exceeded value. + * + * @return the exceeded value + */ + public List exceeded() { + return this.exceeded; + } + + /** + * Set the exceeded value. + * + * @param exceeded the exceeded value to set + * @return the ImageRegionCreateSummary object itself. + */ + public ImageRegionCreateSummary withExceeded(List exceeded) { + this.exceeded = exceeded; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionProposal.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionProposal.java new file mode 100644 index 000000000000..0f2bb4bb9db6 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageRegionProposal.java @@ -0,0 +1,64 @@ +/** + * 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.UUID; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ImageRegionProposal model. + */ +public class ImageRegionProposal { + /** + * The projectId property. + */ + @JsonProperty(value = "projectId", access = JsonProperty.Access.WRITE_ONLY) + private UUID projectId; + + /** + * The imageId property. + */ + @JsonProperty(value = "imageId", access = JsonProperty.Access.WRITE_ONLY) + private UUID imageId; + + /** + * The proposals property. + */ + @JsonProperty(value = "proposals", access = JsonProperty.Access.WRITE_ONLY) + private List proposals; + + /** + * Get the projectId value. + * + * @return the projectId value + */ + public UUID projectId() { + return this.projectId; + } + + /** + * Get the imageId value. + * + * @return the imageId value + */ + public UUID imageId() { + return this.imageId; + } + + /** + * Get the proposals value. + * + * @return the proposals value + */ + public List proposals() { + return this.proposals; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageTag.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageTag.java new file mode 100644 index 000000000000..f98696827da7 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageTag.java @@ -0,0 +1,64 @@ +/** + * 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.UUID; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ImageTag model. + */ +public class ImageTag { + /** + * The tagId property. + */ + @JsonProperty(value = "tagId", access = JsonProperty.Access.WRITE_ONLY) + private UUID tagId; + + /** + * The tagName property. + */ + @JsonProperty(value = "tagName", access = JsonProperty.Access.WRITE_ONLY) + private String tagName; + + /** + * The created property. + */ + @JsonProperty(value = "created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * Get the tagId value. + * + * @return the tagId value + */ + public UUID tagId() { + return this.tagId; + } + + /** + * Get the tagName value. + * + * @return the tagName value + */ + public String tagName() { + return this.tagName; + } + + /** + * Get the created value. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageTagCreateBatch.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageTagCreateBatch.java new file mode 100644 index 000000000000..1a6645dd0e2f --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageTagCreateBatch.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.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ImageTagCreateBatch model. + */ +public class ImageTagCreateBatch { + /** + * The tags property. + */ + @JsonProperty(value = "tags") + private List tags; + + /** + * Get the tags value. + * + * @return the tags value + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the ImageTagCreateBatch object itself. + */ + public ImageTagCreateBatch withTags(List tags) { + this.tags = tags; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageTagCreateEntry.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageTagCreateEntry.java new file mode 100644 index 000000000000..f907b176be74 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageTagCreateEntry.java @@ -0,0 +1,70 @@ +/** + * 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.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ImageTagCreateEntry model. + */ +public class ImageTagCreateEntry { + /** + * The imageId property. + */ + @JsonProperty(value = "imageId") + private UUID imageId; + + /** + * The tagId property. + */ + @JsonProperty(value = "tagId") + private UUID tagId; + + /** + * Get the imageId value. + * + * @return the imageId value + */ + public UUID imageId() { + return this.imageId; + } + + /** + * Set the imageId value. + * + * @param imageId the imageId value to set + * @return the ImageTagCreateEntry object itself. + */ + public ImageTagCreateEntry withImageId(UUID imageId) { + this.imageId = imageId; + return this; + } + + /** + * Get the tagId value. + * + * @return the tagId value + */ + public UUID tagId() { + return this.tagId; + } + + /** + * Set the tagId value. + * + * @param tagId the tagId value to set + * @return the ImageTagCreateEntry object itself. + */ + public ImageTagCreateEntry withTagId(UUID tagId) { + this.tagId = tagId; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageTagCreateSummary.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageTagCreateSummary.java new file mode 100644 index 000000000000..743b57adc6aa --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageTagCreateSummary.java @@ -0,0 +1,96 @@ +/** + * 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.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ImageTagCreateSummary model. + */ +public class ImageTagCreateSummary { + /** + * The created property. + */ + @JsonProperty(value = "created") + private List created; + + /** + * The duplicated property. + */ + @JsonProperty(value = "duplicated") + private List duplicated; + + /** + * The exceeded property. + */ + @JsonProperty(value = "exceeded") + private List exceeded; + + /** + * Get the created value. + * + * @return the created value + */ + public List created() { + return this.created; + } + + /** + * Set the created value. + * + * @param created the created value to set + * @return the ImageTagCreateSummary object itself. + */ + public ImageTagCreateSummary withCreated(List created) { + this.created = created; + return this; + } + + /** + * Get the duplicated value. + * + * @return the duplicated value + */ + public List duplicated() { + return this.duplicated; + } + + /** + * Set the duplicated value. + * + * @param duplicated the duplicated value to set + * @return the ImageTagCreateSummary object itself. + */ + public ImageTagCreateSummary withDuplicated(List duplicated) { + this.duplicated = duplicated; + return this; + } + + /** + * Get the exceeded value. + * + * @return the exceeded value + */ + public List exceeded() { + return this.exceeded; + } + + /** + * Set the exceeded value. + * + * @param exceeded the exceeded value to set + * @return the ImageTagCreateSummary object itself. + */ + public ImageTagCreateSummary withExceeded(List exceeded) { + this.exceeded = exceeded; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageUploadStatus.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageUploadStatus.java new file mode 100644 index 000000000000..83f41cec498e --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageUploadStatus.java @@ -0,0 +1,65 @@ +/** + * 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/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageUrl.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageUrl.java new file mode 100644 index 000000000000..2fb58d808300 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageUrl.java @@ -0,0 +1,43 @@ +/** + * 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 ImageUrl model. + */ +public class ImageUrl { + /** + * The url property. + */ + @JsonProperty(value = "url") + private String url; + + /** + * 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 ImageUrl object itself. + */ + public ImageUrl withUrl(String url) { + this.url = url; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageUrlCreateBatch.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageUrlCreateBatch.java new file mode 100644 index 000000000000..e4b5b8358039 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageUrlCreateBatch.java @@ -0,0 +1,71 @@ +/** + * 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.List; +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ImageUrlCreateBatch model. + */ +public class ImageUrlCreateBatch { + /** + * The images property. + */ + @JsonProperty(value = "images") + private List images; + + /** + * The tagIds property. + */ + @JsonProperty(value = "tagIds") + private List tagIds; + + /** + * Get the images value. + * + * @return the images value + */ + public List images() { + return this.images; + } + + /** + * Set the images value. + * + * @param images the images value to set + * @return the ImageUrlCreateBatch object itself. + */ + public ImageUrlCreateBatch withImages(List images) { + this.images = images; + return this; + } + + /** + * Get the tagIds value. + * + * @return the tagIds value + */ + public List tagIds() { + return this.tagIds; + } + + /** + * Set the tagIds value. + * + * @param tagIds the tagIds value to set + * @return the ImageUrlCreateBatch object itself. + */ + public ImageUrlCreateBatch withTagIds(List tagIds) { + this.tagIds = tagIds; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageUrlCreateEntry.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageUrlCreateEntry.java new file mode 100644 index 000000000000..c5077f75461e --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ImageUrlCreateEntry.java @@ -0,0 +1,97 @@ +/** + * 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.List; +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ImageUrlCreateEntry model. + */ +public class ImageUrlCreateEntry { + /** + * The url property. + */ + @JsonProperty(value = "url") + private String url; + + /** + * The tagIds property. + */ + @JsonProperty(value = "tagIds") + private List tagIds; + + /** + * The regions property. + */ + @JsonProperty(value = "regions") + private List regions; + + /** + * 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 ImageUrlCreateEntry object itself. + */ + public ImageUrlCreateEntry withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the tagIds value. + * + * @return the tagIds value + */ + public List tagIds() { + return this.tagIds; + } + + /** + * Set the tagIds value. + * + * @param tagIds the tagIds value to set + * @return the ImageUrlCreateEntry object itself. + */ + public ImageUrlCreateEntry withTagIds(List tagIds) { + this.tagIds = tagIds; + return this; + } + + /** + * Get the regions value. + * + * @return the regions value + */ + public List regions() { + return this.regions; + } + + /** + * Set the regions value. + * + * @param regions the regions value to set + * @return the ImageUrlCreateEntry object itself. + */ + public ImageUrlCreateEntry withRegions(List regions) { + this.regions = regions; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Iteration.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Iteration.java new file mode 100644 index 000000000000..2f3eb95aeab3 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Iteration.java @@ -0,0 +1,208 @@ +/** + * 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.UUID; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Iteration model to be sent over JSON. + */ +public class Iteration { + /** + * Gets the id of the iteration. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private UUID id; + + /** + * Gets or sets the name of the iteration. + */ + @JsonProperty(value = "name") + 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. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** + * Gets the time this iteration was completed. + */ + @JsonProperty(value = "created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * Gets the time this iteration was last modified. + */ + @JsonProperty(value = "lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * Gets the time this iteration was last modified. + */ + @JsonProperty(value = "trainedAt", access = JsonProperty.Access.WRITE_ONLY) + private DateTime trainedAt; + + /** + * Gets the project id of the iteration. + */ + @JsonProperty(value = "projectId", access = JsonProperty.Access.WRITE_ONLY) + private UUID projectId; + + /** + * Whether the iteration can be exported to another format for download. + */ + @JsonProperty(value = "exportable", access = JsonProperty.Access.WRITE_ONLY) + private boolean exportable; + + /** + * Get or sets a guid of the domain the iteration has been trained on. + */ + @JsonProperty(value = "domainId", access = JsonProperty.Access.WRITE_ONLY) + private UUID domainId; + + /** + * Gets the classification type of the project. Possible values include: + * 'Multiclass', 'Multilabel'. + */ + @JsonProperty(value = "classificationType", access = JsonProperty.Access.WRITE_ONLY) + private Classifier classificationType; + + /** + * Get the id value. + * + * @return the id value + */ + public UUID id() { + return this.id; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the Iteration object itself. + */ + public Iteration withName(String name) { + this.name = 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. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Get the created value. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the lastModified value. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + + /** + * Get the trainedAt value. + * + * @return the trainedAt value + */ + public DateTime trainedAt() { + return this.trainedAt; + } + + /** + * Get the projectId value. + * + * @return the projectId value + */ + public UUID projectId() { + return this.projectId; + } + + /** + * Get the exportable value. + * + * @return the exportable value + */ + public boolean exportable() { + return this.exportable; + } + + /** + * Get the domainId value. + * + * @return the domainId value + */ + public UUID domainId() { + return this.domainId; + } + + /** + * Get the classificationType value. + * + * @return the classificationType value + */ + public Classifier classificationType() { + return this.classificationType; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/IterationPerformance.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/IterationPerformance.java new file mode 100644 index 000000000000..eec95575cf0f --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/IterationPerformance.java @@ -0,0 +1,108 @@ +/** + * 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.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the detailed performance data for a trained iteration. + */ +public class IterationPerformance { + /** + * Gets the per-tag performance details for this iteration. + */ + @JsonProperty(value = "perTagPerformance", access = JsonProperty.Access.WRITE_ONLY) + private List perTagPerformance; + + /** + * Gets the precision. + */ + @JsonProperty(value = "precision", access = JsonProperty.Access.WRITE_ONLY) + private double precision; + + /** + * Gets the standard deviation for the precision. + */ + @JsonProperty(value = "precisionStdDeviation", access = JsonProperty.Access.WRITE_ONLY) + private double precisionStdDeviation; + + /** + * Gets the recall. + */ + @JsonProperty(value = "recall", access = JsonProperty.Access.WRITE_ONLY) + private double recall; + + /** + * Gets the standard deviation for the recall. + */ + @JsonProperty(value = "recallStdDeviation", access = JsonProperty.Access.WRITE_ONLY) + private double recallStdDeviation; + + /** + * Gets the average precision when applicable. + */ + @JsonProperty(value = "averagePrecision", access = JsonProperty.Access.WRITE_ONLY) + private Double averagePrecision; + + /** + * Get the perTagPerformance value. + * + * @return the perTagPerformance value + */ + public List perTagPerformance() { + return this.perTagPerformance; + } + + /** + * Get the precision value. + * + * @return the precision value + */ + public double precision() { + return this.precision; + } + + /** + * Get the precisionStdDeviation value. + * + * @return the precisionStdDeviation value + */ + public double precisionStdDeviation() { + return this.precisionStdDeviation; + } + + /** + * Get the recall value. + * + * @return the recall value + */ + public double recall() { + return this.recall; + } + + /** + * Get the recallStdDeviation value. + * + * @return the recallStdDeviation value + */ + public double recallStdDeviation() { + return this.recallStdDeviation; + } + + /** + * Get the averagePrecision value. + * + * @return the averagePrecision value + */ + public Double averagePrecision() { + return this.averagePrecision; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/OrderBy.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/OrderBy.java new file mode 100644 index 000000000000..791dc39332a8 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/OrderBy.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 OrderBy. + */ +public final class OrderBy extends ExpandableStringEnum { + /** Static value Newest for OrderBy. */ + public static final OrderBy NEWEST = fromString("Newest"); + + /** Static value Oldest for OrderBy. */ + public static final OrderBy OLDEST = fromString("Oldest"); + + /** Static value Suggested for OrderBy. */ + public static final OrderBy SUGGESTED = fromString("Suggested"); + + /** + * Creates or finds a OrderBy from its string representation. + * @param name a name to look for + * @return the corresponding OrderBy + */ + @JsonCreator + public static OrderBy fromString(String name) { + return fromString(name, OrderBy.class); + } + + /** + * @return known OrderBy values + */ + public static Collection values() { + return values(OrderBy.class); + } +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Prediction.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Prediction.java new file mode 100644 index 000000000000..7b22c84704c6 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Prediction.java @@ -0,0 +1,78 @@ +/** + * 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.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Prediction model. + */ +public class Prediction { + /** + * The probability property. + */ + @JsonProperty(value = "probability", access = JsonProperty.Access.WRITE_ONLY) + private double probability; + + /** + * The tagId property. + */ + @JsonProperty(value = "tagId", access = JsonProperty.Access.WRITE_ONLY) + private UUID tagId; + + /** + * The tagName property. + */ + @JsonProperty(value = "tagName", access = JsonProperty.Access.WRITE_ONLY) + private String tagName; + + /** + * The boundingBox property. + */ + @JsonProperty(value = "boundingBox", access = JsonProperty.Access.WRITE_ONLY) + private BoundingBox boundingBox; + + /** + * Get the probability value. + * + * @return the probability value + */ + public double probability() { + return this.probability; + } + + /** + * Get the tagId value. + * + * @return the tagId value + */ + public UUID tagId() { + return this.tagId; + } + + /** + * Get the tagName value. + * + * @return the tagName value + */ + public String tagName() { + return this.tagName; + } + + /** + * Get the boundingBox value. + * + * @return the boundingBox value + */ + public BoundingBox boundingBox() { + return this.boundingBox; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/PredictionQueryResult.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/PredictionQueryResult.java new file mode 100644 index 000000000000..7e39fc375f7e --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/PredictionQueryResult.java @@ -0,0 +1,48 @@ +/** + * 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.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The PredictionQueryResult model. + */ +public class PredictionQueryResult { + /** + * The token property. + */ + @JsonProperty(value = "token", access = JsonProperty.Access.WRITE_ONLY) + private PredictionQueryToken token; + + /** + * The results property. + */ + @JsonProperty(value = "results", access = JsonProperty.Access.WRITE_ONLY) + private List results; + + /** + * Get the token value. + * + * @return the token value + */ + public PredictionQueryToken token() { + return this.token; + } + + /** + * Get the results value. + * + * @return the results value + */ + public List results() { + return this.results; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/PredictionQueryTag.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/PredictionQueryTag.java new file mode 100644 index 000000000000..eabe4c9fd84d --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/PredictionQueryTag.java @@ -0,0 +1,63 @@ +/** + * 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.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The PredictionQueryTag model. + */ +public class PredictionQueryTag { + /** + * The id property. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private UUID id; + + /** + * The minThreshold property. + */ + @JsonProperty(value = "minThreshold", access = JsonProperty.Access.WRITE_ONLY) + private double minThreshold; + + /** + * The maxThreshold property. + */ + @JsonProperty(value = "maxThreshold", access = JsonProperty.Access.WRITE_ONLY) + private double maxThreshold; + + /** + * Get the id value. + * + * @return the id value + */ + public UUID id() { + return this.id; + } + + /** + * Get the minThreshold value. + * + * @return the minThreshold value + */ + public double minThreshold() { + return this.minThreshold; + } + + /** + * Get the maxThreshold value. + * + * @return the maxThreshold value + */ + public double maxThreshold() { + return this.maxThreshold; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/PredictionQueryToken.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/PredictionQueryToken.java new file mode 100644 index 000000000000..bfaed30a24a4 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/PredictionQueryToken.java @@ -0,0 +1,254 @@ +/** + * 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.List; +import java.util.UUID; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The PredictionQueryToken model. + */ +public class PredictionQueryToken { + /** + * The session property. + */ + @JsonProperty(value = "session") + private String session; + + /** + * The continuation property. + */ + @JsonProperty(value = "continuation") + private String continuation; + + /** + * The maxCount property. + */ + @JsonProperty(value = "maxCount") + private int maxCount; + + /** + * Possible values include: 'Newest', 'Oldest', 'Suggested'. + */ + @JsonProperty(value = "orderBy") + private OrderBy orderBy; + + /** + * The tags property. + */ + @JsonProperty(value = "tags") + private List tags; + + /** + * The iterationId property. + */ + @JsonProperty(value = "iterationId") + private UUID iterationId; + + /** + * The startTime property. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * The endTime property. + */ + @JsonProperty(value = "endTime") + private DateTime endTime; + + /** + * The application property. + */ + @JsonProperty(value = "application") + private String application; + + /** + * Get the session value. + * + * @return the session value + */ + public String session() { + return this.session; + } + + /** + * Set the session value. + * + * @param session the session value to set + * @return the PredictionQueryToken object itself. + */ + public PredictionQueryToken withSession(String session) { + this.session = session; + return this; + } + + /** + * Get the continuation value. + * + * @return the continuation value + */ + public String continuation() { + return this.continuation; + } + + /** + * Set the continuation value. + * + * @param continuation the continuation value to set + * @return the PredictionQueryToken object itself. + */ + public PredictionQueryToken withContinuation(String continuation) { + this.continuation = continuation; + return this; + } + + /** + * Get the maxCount value. + * + * @return the maxCount value + */ + public int maxCount() { + return this.maxCount; + } + + /** + * Set the maxCount value. + * + * @param maxCount the maxCount value to set + * @return the PredictionQueryToken object itself. + */ + public PredictionQueryToken withMaxCount(int maxCount) { + this.maxCount = maxCount; + return this; + } + + /** + * Get the orderBy value. + * + * @return the orderBy value + */ + public OrderBy orderBy() { + return this.orderBy; + } + + /** + * Set the orderBy value. + * + * @param orderBy the orderBy value to set + * @return the PredictionQueryToken object itself. + */ + public PredictionQueryToken withOrderBy(OrderBy orderBy) { + this.orderBy = orderBy; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the PredictionQueryToken object itself. + */ + public PredictionQueryToken withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * 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 PredictionQueryToken object itself. + */ + public PredictionQueryToken withIterationId(UUID iterationId) { + this.iterationId = iterationId; + return this; + } + + /** + * Get the startTime value. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime value. + * + * @param startTime the startTime value to set + * @return the PredictionQueryToken object itself. + */ + public PredictionQueryToken withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime value. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime value. + * + * @param endTime the endTime value to set + * @return the PredictionQueryToken object itself. + */ + public PredictionQueryToken withEndTime(DateTime endTime) { + this.endTime = endTime; + 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 PredictionQueryToken object itself. + */ + public PredictionQueryToken withApplication(String application) { + this.application = application; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Project.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Project.java new file mode 100644 index 000000000000..31dd5e249e6e --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Project.java @@ -0,0 +1,157 @@ +/** + * 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.UUID; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a project. + */ +public class Project { + /** + * Gets the project id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private UUID id; + + /** + * Gets or sets the name of the project. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Gets or sets the description of the project. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Gets or sets the project settings. + */ + @JsonProperty(value = "settings") + private ProjectSettings settings; + + /** + * Gets the date this project was created. + */ + @JsonProperty(value = "created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * Gets the date this project was last modifed. + */ + @JsonProperty(value = "lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * Gets the thumbnail url representing the project. + */ + @JsonProperty(value = "thumbnailUri", access = JsonProperty.Access.WRITE_ONLY) + private String thumbnailUri; + + /** + * Get the id value. + * + * @return the id value + */ + public UUID id() { + return this.id; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the Project object itself. + */ + public Project withName(String name) { + this.name = name; + return this; + } + + /** + * Get the description value. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description value. + * + * @param description the description value to set + * @return the Project object itself. + */ + public Project withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the settings value. + * + * @return the settings value + */ + public ProjectSettings settings() { + return this.settings; + } + + /** + * Set the settings value. + * + * @param settings the settings value to set + * @return the Project object itself. + */ + public Project withSettings(ProjectSettings settings) { + this.settings = settings; + return this; + } + + /** + * Get the created value. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the lastModified value. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + + /** + * Get the thumbnailUri value. + * + * @return the thumbnailUri value + */ + public String thumbnailUri() { + return this.thumbnailUri; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ProjectSettings.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ProjectSettings.java new file mode 100644 index 000000000000..ba8855458e12 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/ProjectSettings.java @@ -0,0 +1,71 @@ +/** + * 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.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents settings associated with a project. + */ +public class ProjectSettings { + /** + * Gets or sets the id of the Domain to use with this project. + */ + @JsonProperty(value = "domainId") + private UUID domainId; + + /** + * Gets or sets the classification type of the project. Possible values + * include: 'Multiclass', 'Multilabel'. + */ + @JsonProperty(value = "classificationType") + private Classifier classificationType; + + /** + * Get the domainId value. + * + * @return the domainId value + */ + public UUID domainId() { + return this.domainId; + } + + /** + * Set the domainId value. + * + * @param domainId the domainId value to set + * @return the ProjectSettings object itself. + */ + public ProjectSettings withDomainId(UUID domainId) { + this.domainId = domainId; + return this; + } + + /** + * Get the classificationType value. + * + * @return the classificationType value + */ + public Classifier classificationType() { + return this.classificationType; + } + + /** + * Set the classificationType value. + * + * @param classificationType the classificationType value to set + * @return the ProjectSettings object itself. + */ + public ProjectSettings withClassificationType(Classifier classificationType) { + this.classificationType = classificationType; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/QuickTestImageOptionalParameter.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/QuickTestImageOptionalParameter.java new file mode 100644 index 000000000000..4e318ee1e31a --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/QuickTestImageOptionalParameter.java @@ -0,0 +1,69 @@ +/** + * 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.UUID; + +/** + * The QuickTestImageOptionalParameter model. + */ +public class QuickTestImageOptionalParameter { + /** + * 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; + + /** + * 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 QuickTestImageOptionalParameter object itself. + */ + public QuickTestImageOptionalParameter withIterationId(UUID iterationId) { + this.iterationId = iterationId; + 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 QuickTestImageOptionalParameter object itself. + */ + public QuickTestImageOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/QuickTestImageUrlOptionalParameter.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/QuickTestImageUrlOptionalParameter.java new file mode 100644 index 000000000000..6e63337d65a1 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/QuickTestImageUrlOptionalParameter.java @@ -0,0 +1,94 @@ +/** + * 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.UUID; + +/** + * The QuickTestImageUrlOptionalParameter model. + */ +public class QuickTestImageUrlOptionalParameter { + /** + * 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; + + /** + * 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 QuickTestImageUrlOptionalParameter object itself. + */ + public QuickTestImageUrlOptionalParameter withIterationId(UUID iterationId) { + this.iterationId = 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. + * + * @return the thisclientacceptLanguage value + */ + public String thisclientacceptLanguage() { + return this.thisclientacceptLanguage; + } + + /** + * Set the thisclientacceptLanguage value. + * + * @param thisclientacceptLanguage the thisclientacceptLanguage value to set + * @return the QuickTestImageUrlOptionalParameter object itself. + */ + public QuickTestImageUrlOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Region.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Region.java new file mode 100644 index 000000000000..1c9cf038292c --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Region.java @@ -0,0 +1,148 @@ +/** + * 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.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Region model. + */ +public class Region { + /** + * The tagId property. + */ + @JsonProperty(value = "tagId") + private UUID tagId; + + /** + * The left property. + */ + @JsonProperty(value = "left") + private double left; + + /** + * The top property. + */ + @JsonProperty(value = "top") + private double top; + + /** + * The width property. + */ + @JsonProperty(value = "width") + private double width; + + /** + * The height property. + */ + @JsonProperty(value = "height") + private double height; + + /** + * Get the tagId value. + * + * @return the tagId value + */ + public UUID tagId() { + return this.tagId; + } + + /** + * Set the tagId value. + * + * @param tagId the tagId value to set + * @return the Region object itself. + */ + public Region withTagId(UUID tagId) { + this.tagId = tagId; + return this; + } + + /** + * Get the left value. + * + * @return the left value + */ + public double left() { + return this.left; + } + + /** + * Set the left value. + * + * @param left the left value to set + * @return the Region object itself. + */ + public Region withLeft(double left) { + this.left = left; + return this; + } + + /** + * Get the top value. + * + * @return the top value + */ + public double top() { + return this.top; + } + + /** + * Set the top value. + * + * @param top the top value to set + * @return the Region object itself. + */ + public Region withTop(double top) { + this.top = top; + return this; + } + + /** + * Get the width value. + * + * @return the width value + */ + public double width() { + return this.width; + } + + /** + * Set the width value. + * + * @param width the width value to set + * @return the Region object itself. + */ + public Region withWidth(double width) { + this.width = width; + return this; + } + + /** + * Get the height value. + * + * @return the height value + */ + public double height() { + return this.height; + } + + /** + * Set the height value. + * + * @param height the height value to set + * @return the Region object itself. + */ + public Region withHeight(double height) { + this.height = height; + return this; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/RegionProposal.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/RegionProposal.java new file mode 100644 index 000000000000..48245f89956f --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/RegionProposal.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.cognitiveservices.vision.customvision.training.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The RegionProposal model. + */ +public class RegionProposal { + /** + * The confidence property. + */ + @JsonProperty(value = "confidence", access = JsonProperty.Access.WRITE_ONLY) + private double confidence; + + /** + * The boundingBox property. + */ + @JsonProperty(value = "boundingBox", access = JsonProperty.Access.WRITE_ONLY) + private BoundingBox boundingBox; + + /** + * Get the confidence value. + * + * @return the confidence value + */ + public double confidence() { + return this.confidence; + } + + /** + * Get the boundingBox value. + * + * @return the boundingBox value + */ + public BoundingBox boundingBox() { + return this.boundingBox; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/StoredImagePrediction.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/StoredImagePrediction.java new file mode 100644 index 000000000000..763004edf3f6 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/StoredImagePrediction.java @@ -0,0 +1,140 @@ +/** + * 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.UUID; +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * result of an image classification request. + */ +public class StoredImagePrediction { + /** + * The imageUri property. + */ + @JsonProperty(value = "imageUri", access = JsonProperty.Access.WRITE_ONLY) + private String imageUri; + + /** + * The thumbnailUri property. + */ + @JsonProperty(value = "thumbnailUri", access = JsonProperty.Access.WRITE_ONLY) + private String thumbnailUri; + + /** + * The domain property. + */ + @JsonProperty(value = "domain", access = JsonProperty.Access.WRITE_ONLY) + private UUID domain; + + /** + * The id property. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private UUID id; + + /** + * The project property. + */ + @JsonProperty(value = "project", access = JsonProperty.Access.WRITE_ONLY) + private UUID project; + + /** + * The iteration property. + */ + @JsonProperty(value = "iteration", access = JsonProperty.Access.WRITE_ONLY) + private UUID iteration; + + /** + * The created property. + */ + @JsonProperty(value = "created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The predictions property. + */ + @JsonProperty(value = "predictions", access = JsonProperty.Access.WRITE_ONLY) + private List predictions; + + /** + * Get the imageUri value. + * + * @return the imageUri value + */ + public String imageUri() { + return this.imageUri; + } + + /** + * Get the thumbnailUri value. + * + * @return the thumbnailUri value + */ + public String thumbnailUri() { + return this.thumbnailUri; + } + + /** + * Get the domain value. + * + * @return the domain value + */ + public UUID domain() { + return this.domain; + } + + /** + * Get the id value. + * + * @return the id value + */ + public UUID id() { + return this.id; + } + + /** + * Get the project value. + * + * @return the project value + */ + public UUID project() { + return this.project; + } + + /** + * Get the iteration value. + * + * @return the iteration value + */ + public UUID iteration() { + return this.iteration; + } + + /** + * Get the created value. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the predictions value. + * + * @return the predictions value + */ + public List predictions() { + return this.predictions; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Tag.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Tag.java new file mode 100644 index 000000000000..42de469690e0 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/Tag.java @@ -0,0 +1,100 @@ +/** + * 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.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a Tag. + */ +public class Tag { + /** + * Gets the Tag ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private UUID id; + + /** + * Gets or sets the name of the tag. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Gets or sets the description of the tag. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Gets the number of images with this tag. + */ + @JsonProperty(value = "imageCount", access = JsonProperty.Access.WRITE_ONLY) + private int imageCount; + + /** + * Get the id value. + * + * @return the id value + */ + public UUID id() { + return this.id; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the Tag object itself. + */ + public Tag withName(String name) { + this.name = name; + return this; + } + + /** + * Get the description value. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description value. + * + * @param description the description value to set + * @return the Tag object itself. + */ + public Tag withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the imageCount value. + * + * @return the imageCount value + */ + public int imageCount() { + return this.imageCount; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/TagPerformance.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/TagPerformance.java new file mode 100644 index 000000000000..c19f74b0e4a3 --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/TagPerformance.java @@ -0,0 +1,123 @@ +/** + * 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.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents performance data for a particular tag in a trained iteration. + */ +public class TagPerformance { + /** + * The id property. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private UUID id; + + /** + * The name property. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Gets the precision. + */ + @JsonProperty(value = "precision", access = JsonProperty.Access.WRITE_ONLY) + private double precision; + + /** + * Gets the standard deviation for the precision. + */ + @JsonProperty(value = "precisionStdDeviation", access = JsonProperty.Access.WRITE_ONLY) + private double precisionStdDeviation; + + /** + * Gets the recall. + */ + @JsonProperty(value = "recall", access = JsonProperty.Access.WRITE_ONLY) + private double recall; + + /** + * Gets the standard deviation for the recall. + */ + @JsonProperty(value = "recallStdDeviation", access = JsonProperty.Access.WRITE_ONLY) + private double recallStdDeviation; + + /** + * Gets the average precision when applicable. + */ + @JsonProperty(value = "averagePrecision", access = JsonProperty.Access.WRITE_ONLY) + private Double averagePrecision; + + /** + * Get the id value. + * + * @return the id value + */ + public UUID id() { + return this.id; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the precision value. + * + * @return the precision value + */ + public double precision() { + return this.precision; + } + + /** + * Get the precisionStdDeviation value. + * + * @return the precisionStdDeviation value + */ + public double precisionStdDeviation() { + return this.precisionStdDeviation; + } + + /** + * Get the recall value. + * + * @return the recall value + */ + public double recall() { + return this.recall; + } + + /** + * Get the recallStdDeviation value. + * + * @return the recallStdDeviation value + */ + public double recallStdDeviation() { + return this.recallStdDeviation; + } + + /** + * Get the averagePrecision value. + * + * @return the averagePrecision value + */ + public Double averagePrecision() { + return this.averagePrecision; + } + +} diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/package-info.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/package-info.java new file mode 100644 index 000000000000..a23776b5606c --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/models/package-info.java @@ -0,0 +1,10 @@ +// 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. + +/** + * This package contains the models classes for TrainingApi. + */ +package com.microsoft.azure.cognitiveservices.vision.customvision.training.models; diff --git a/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/package-info.java b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/package-info.java new file mode 100644 index 000000000000..40cf7938d6de --- /dev/null +++ b/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/package-info.java @@ -0,0 +1,10 @@ +// 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. + +/** + * This package contains the classes for TrainingApi. + */ +package com.microsoft.azure.cognitiveservices.vision.customvision.training; diff --git a/cognitiveservices/data-plane/vision/faceapi/pom.xml b/cognitiveservices/data-plane/vision/faceapi/pom.xml index 0edf678883d7..9da7c4316669 100644 --- a/cognitiveservices/data-plane/vision/faceapi/pom.xml +++ b/cognitiveservices/data-plane/vision/faceapi/pom.xml @@ -8,15 +8,15 @@ com.microsoft.azure.cognitiveservices azure-cognitiveservices-parent - 1.0.1 + 1.0.2 ../../pom.xml azure-cognitiveservices-faceapi - 1.0.1-beta + 1.0.2-beta jar Microsoft Azure SDK for Cognitive Service Face API This package contains Microsoft Cognitive Service Face API SDK. - https://github.com/Azure/azure-sdk-for-java/azure-cognitiveservices/vision/faceapi + https://github.com/Azure/azure-sdk-for-java/cognitiveservices/data-plane/vision/faceapi The MIT License (MIT)