diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/pom.xml b/sdk/cognitiveservices/mgmt-v2017_04_18/pom.xml index f930ab4d0e3b..9c2ba0914aab 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/pom.xml +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/pom.xml @@ -7,19 +7,19 @@ --> 4.0.0 - com.microsoft.azure.azure-mgmt-cognitiveservices-2017-04-18 + com.microsoft.azure.cognitiveservices.v2017_04_18 com.microsoft.azure azure-arm-parent - 1.2.0 + 1.1.0 ../../../pom.management.xml azure-mgmt-cognitiveservices - 1.0.0-beta-SNAPSHOT + 1.0.0-beta jar Microsoft Azure SDK for CognitiveServices Management This package contains Microsoft CognitiveServices Management SDK. - https://github.com/Azure/azure-libraries-for-java + https://github.com/Azure/azure-sdk-for-java The MIT License (MIT) @@ -28,8 +28,8 @@ - scm:git:https://github.com/Azure/azure-libraries-for-java - scm:git:git@github.com:Azure/azure-libraries-for-java.git + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git HEAD @@ -71,6 +71,8 @@ azure-arm-client-runtime test-jar test + + 1.6.5 diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/CheckDomainAvailabilityParameter.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/CheckDomainAvailabilityParameter.java new file mode 100644 index 000000000000..595a8de9e315 --- /dev/null +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/CheckDomainAvailabilityParameter.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.management.cognitiveservices.v2017_04_18; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Check Domain availability parameter. + */ +public class CheckDomainAvailabilityParameter { + /** + * The subdomain name to use. + */ + @JsonProperty(value = "subdomainName", required = true) + private String subdomainName; + + /** + * The Type of the resource. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Get the subdomain name to use. + * + * @return the subdomainName value + */ + public String subdomainName() { + return this.subdomainName; + } + + /** + * Set the subdomain name to use. + * + * @param subdomainName the subdomainName value to set + * @return the CheckDomainAvailabilityParameter object itself. + */ + public CheckDomainAvailabilityParameter withSubdomainName(String subdomainName) { + this.subdomainName = subdomainName; + return this; + } + + /** + * Get the Type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the Type of the resource. + * + * @param type the type value to set + * @return the CheckDomainAvailabilityParameter object itself. + */ + public CheckDomainAvailabilityParameter withType(String type) { + this.type = type; + return this; + } + +} diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/CheckSkuAvailabilityParameter.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/CheckSkuAvailabilityParameter.java index 0628af3df9eb..7ba9af34d08b 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/CheckSkuAvailabilityParameter.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/CheckSkuAvailabilityParameter.java @@ -19,19 +19,13 @@ public class CheckSkuAvailabilityParameter { * The SKU of the resource. */ @JsonProperty(value = "skus", required = true) - private List skus; + private List skus; /** - * The Kind of the resource. Possible values include: - * 'Bing.Autosuggest.v7', 'Bing.CustomSearch', 'Bing.Search.v7', - * 'Bing.Speech', 'Bing.SpellCheck.v7', 'ComputerVision', - * 'ContentModerator', 'CustomSpeech', 'CustomVision.Prediction', - * 'CustomVision.Training', 'Emotion', 'Face', 'LUIS', 'QnAMaker', - * 'SpeakerRecognition', 'SpeechTranslation', 'TextAnalytics', - * 'TextTranslation', 'WebLM'. + * The Kind of the resource. */ @JsonProperty(value = "kind", required = true) - private Kind kind; + private String kind; /** * The Type of the resource. @@ -40,47 +34,47 @@ public class CheckSkuAvailabilityParameter { private String type; /** - * Get the skus value. + * Get the SKU of the resource. * * @return the skus value */ - public List skus() { + public List skus() { return this.skus; } /** - * Set the skus value. + * Set the SKU of the resource. * * @param skus the skus value to set * @return the CheckSkuAvailabilityParameter object itself. */ - public CheckSkuAvailabilityParameter withSkus(List skus) { + public CheckSkuAvailabilityParameter withSkus(List skus) { this.skus = skus; return this; } /** - * Get the kind value. + * Get the Kind of the resource. * * @return the kind value */ - public Kind kind() { + public String kind() { return this.kind; } /** - * Set the kind value. + * Set the Kind of the resource. * * @param kind the kind value to set * @return the CheckSkuAvailabilityParameter object itself. */ - public CheckSkuAvailabilityParameter withKind(Kind kind) { + public CheckSkuAvailabilityParameter withKind(String kind) { this.kind = kind; return this; } /** - * Get the type value. + * Get the Type of the resource. * * @return the type value */ @@ -89,7 +83,7 @@ public String type() { } /** - * Set the type value. + * Set the Type of the resource. * * @param type the type value to set * @return the CheckSkuAvailabilityParameter object itself. diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/CheckSkuAvailabilityResult.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/CheckSkuAvailabilityResult.java index c76772c593c3..b74879eca585 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/CheckSkuAvailabilityResult.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/CheckSkuAvailabilityResult.java @@ -15,16 +15,10 @@ */ public class CheckSkuAvailabilityResult { /** - * The Kind of the resource. Possible values include: - * 'Bing.Autosuggest.v7', 'Bing.CustomSearch', 'Bing.Search.v7', - * 'Bing.Speech', 'Bing.SpellCheck.v7', 'ComputerVision', - * 'ContentModerator', 'CustomSpeech', 'CustomVision.Prediction', - * 'CustomVision.Training', 'Emotion', 'Face', 'LUIS', 'QnAMaker', - * 'SpeakerRecognition', 'SpeechTranslation', 'TextAnalytics', - * 'TextTranslation', 'WebLM'. + * The Kind of the resource. */ @JsonProperty(value = "kind") - private Kind kind; + private String kind; /** * The Type of the resource. @@ -33,11 +27,10 @@ public class CheckSkuAvailabilityResult { private String type; /** - * The SKU of Cognitive Services account. Possible values include: 'F0', - * 'P0', 'P1', 'P2', 'S0', 'S1', 'S2', 'S3', 'S4', 'S5', 'S6'. + * The SKU of Cognitive Services account. */ @JsonProperty(value = "skuName") - private SkuName skuName; + private String skuName; /** * Indicates the given SKU is available or not. @@ -58,27 +51,27 @@ public class CheckSkuAvailabilityResult { private String message; /** - * Get the kind value. + * Get the Kind of the resource. * * @return the kind value */ - public Kind kind() { + public String kind() { return this.kind; } /** - * Set the kind value. + * Set the Kind of the resource. * * @param kind the kind value to set * @return the CheckSkuAvailabilityResult object itself. */ - public CheckSkuAvailabilityResult withKind(Kind kind) { + public CheckSkuAvailabilityResult withKind(String kind) { this.kind = kind; return this; } /** - * Get the type value. + * Get the Type of the resource. * * @return the type value */ @@ -87,7 +80,7 @@ public String type() { } /** - * Set the type value. + * Set the Type of the resource. * * @param type the type value to set * @return the CheckSkuAvailabilityResult object itself. @@ -98,27 +91,27 @@ public CheckSkuAvailabilityResult withType(String type) { } /** - * Get the skuName value. + * Get the SKU of Cognitive Services account. * * @return the skuName value */ - public SkuName skuName() { + public String skuName() { return this.skuName; } /** - * Set the skuName value. + * Set the SKU of Cognitive Services account. * * @param skuName the skuName value to set * @return the CheckSkuAvailabilityResult object itself. */ - public CheckSkuAvailabilityResult withSkuName(SkuName skuName) { + public CheckSkuAvailabilityResult withSkuName(String skuName) { this.skuName = skuName; return this; } /** - * Get the skuAvailable value. + * Get indicates the given SKU is available or not. * * @return the skuAvailable value */ @@ -127,7 +120,7 @@ public Boolean skuAvailable() { } /** - * Set the skuAvailable value. + * Set indicates the given SKU is available or not. * * @param skuAvailable the skuAvailable value to set * @return the CheckSkuAvailabilityResult object itself. @@ -138,7 +131,7 @@ public CheckSkuAvailabilityResult withSkuAvailable(Boolean skuAvailable) { } /** - * Get the reason value. + * Get reason why the SKU is not available. * * @return the reason value */ @@ -147,7 +140,7 @@ public String reason() { } /** - * Set the reason value. + * Set reason why the SKU is not available. * * @param reason the reason value to set * @return the CheckSkuAvailabilityResult object itself. @@ -158,7 +151,7 @@ public CheckSkuAvailabilityResult withReason(String reason) { } /** - * Get the message value. + * Get additional error message. * * @return the message value */ @@ -167,7 +160,7 @@ public String message() { } /** - * Set the message value. + * Set additional error message. * * @param message the message value to set * @return the CheckSkuAvailabilityResult object itself. diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/CognitiveServicesAccount.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/CognitiveServicesAccount.java index b6c4e027e962..a424cba62c01 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/CognitiveServicesAccount.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/CognitiveServicesAccount.java @@ -10,12 +10,12 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; import com.microsoft.azure.arm.resources.models.HasResourceGroup; import com.microsoft.azure.arm.model.Refreshable; import com.microsoft.azure.arm.model.Updatable; import com.microsoft.azure.arm.model.Appliable; import com.microsoft.azure.arm.model.Creatable; -import com.microsoft.azure.arm.resources.models.GroupableResourceCore; import com.microsoft.azure.arm.resources.models.HasManager; import com.microsoft.azure.management.cognitiveservices.v2017_04_18.implementation.CognitiveServicesManager; import com.microsoft.azure.management.cognitiveservices.v2017_04_18.implementation.CognitiveServicesAccountInner; @@ -24,30 +24,20 @@ * Type representing CognitiveServicesAccount. */ public interface CognitiveServicesAccount extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { - /** - * @return the endpoint value. - */ - String endpoint(); - /** * @return the etag value. */ String etag(); - /** - * @return the internalId value. - */ - String internalId(); - /** * @return the kind value. */ String kind(); /** - * @return the provisioningState value. + * @return the properties value. */ - ProvisioningState provisioningState(); + CognitiveServicesAccountProperties properties(); /** * @return the sku value. @@ -57,7 +47,7 @@ public interface CognitiveServicesAccount extends HasInner { /** * The stage of the CognitiveServicesAccount definition allowing to specify the resource group. */ - interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { } /** * The stage of the cognitiveservicesaccount definition allowing to specify Kind. */ interface WithKind { - /** - * Specifies kind. - */ - WithProperties withKind(Kind kind); + /** + * Specifies kind. + * @param kind The Kind of the resource + * @return the next definition stage + */ + WithCreate withKind(String kind); } /** * The stage of the cognitiveservicesaccount definition allowing to specify Properties. */ interface WithProperties { - /** - * Specifies properties. - */ - WithSku withProperties(Object properties); + /** + * Specifies properties. + * @param properties Properties of Cognitive Services account + * @return the next definition stage + */ + WithCreate withProperties(CognitiveServicesAccountProperties properties); } /** * The stage of the cognitiveservicesaccount definition allowing to specify Sku. */ interface WithSku { - /** - * Specifies sku. - */ + /** + * Specifies sku. + * @param sku The SKU of Cognitive Services account + * @return the next definition stage + */ WithCreate withSku(Sku sku); } @@ -111,18 +107,54 @@ interface WithSku { * the resource to be created (via {@link WithCreate#create()}), but also allows * for any other optional settings to be specified. */ - interface WithCreate extends Creatable, Resource.DefinitionWithTags { + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithKind, DefinitionStages.WithProperties, DefinitionStages.WithSku { } } /** * The template for a CognitiveServicesAccount update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, Resource.UpdateWithTags { + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithKind, UpdateStages.WithProperties, UpdateStages.WithSku { } /** * Grouping of CognitiveServicesAccount update stages. */ interface UpdateStages { + /** + * The stage of the cognitiveservicesaccount update allowing to specify Kind. + */ + interface WithKind { + /** + * Specifies kind. + * @param kind The Kind of the resource + * @return the next update stage + */ + Update withKind(String kind); + } + + /** + * The stage of the cognitiveservicesaccount update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Properties of Cognitive Services account + * @return the next update stage + */ + Update withProperties(CognitiveServicesAccountProperties properties); + } + + /** + * The stage of the cognitiveservicesaccount update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The SKU of Cognitive Services account + * @return the next update stage + */ + Update withSku(Sku sku); + } + } } diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/CognitiveServicesAccountApiProperties.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/CognitiveServicesAccountApiProperties.java new file mode 100644 index 000000000000..ae7e19c59759 --- /dev/null +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/CognitiveServicesAccountApiProperties.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.management.cognitiveservices.v2017_04_18; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The api properties for special APIs. + */ +public class CognitiveServicesAccountApiProperties { + /** + * (QnAMaker Only) The runtime endpoint of QnAMaker. + */ + @JsonProperty(value = "qnaRuntimeEndpoint") + private String qnaRuntimeEndpoint; + + /** + * (Bing Search Only) The flag to enable statistics of Bing Search. + */ + @JsonProperty(value = "statisticsEnabled") + private Boolean statisticsEnabled; + + /** + * (Personalization Only) The flag to enable statistics of Bing Search. + */ + @JsonProperty(value = "eventHubConnectionString") + private String eventHubConnectionString; + + /** + * (Personalization Only) The storage account connection string. + */ + @JsonProperty(value = "storageAccountConnectionString") + private String storageAccountConnectionString; + + /** + * Get (QnAMaker Only) The runtime endpoint of QnAMaker. + * + * @return the qnaRuntimeEndpoint value + */ + public String qnaRuntimeEndpoint() { + return this.qnaRuntimeEndpoint; + } + + /** + * Set (QnAMaker Only) The runtime endpoint of QnAMaker. + * + * @param qnaRuntimeEndpoint the qnaRuntimeEndpoint value to set + * @return the CognitiveServicesAccountApiProperties object itself. + */ + public CognitiveServicesAccountApiProperties withQnaRuntimeEndpoint(String qnaRuntimeEndpoint) { + this.qnaRuntimeEndpoint = qnaRuntimeEndpoint; + return this; + } + + /** + * Get (Bing Search Only) The flag to enable statistics of Bing Search. + * + * @return the statisticsEnabled value + */ + public Boolean statisticsEnabled() { + return this.statisticsEnabled; + } + + /** + * Set (Bing Search Only) The flag to enable statistics of Bing Search. + * + * @param statisticsEnabled the statisticsEnabled value to set + * @return the CognitiveServicesAccountApiProperties object itself. + */ + public CognitiveServicesAccountApiProperties withStatisticsEnabled(Boolean statisticsEnabled) { + this.statisticsEnabled = statisticsEnabled; + return this; + } + + /** + * Get (Personalization Only) The flag to enable statistics of Bing Search. + * + * @return the eventHubConnectionString value + */ + public String eventHubConnectionString() { + return this.eventHubConnectionString; + } + + /** + * Set (Personalization Only) The flag to enable statistics of Bing Search. + * + * @param eventHubConnectionString the eventHubConnectionString value to set + * @return the CognitiveServicesAccountApiProperties object itself. + */ + public CognitiveServicesAccountApiProperties withEventHubConnectionString(String eventHubConnectionString) { + this.eventHubConnectionString = eventHubConnectionString; + return this; + } + + /** + * Get (Personalization Only) The storage account connection string. + * + * @return the storageAccountConnectionString value + */ + public String storageAccountConnectionString() { + return this.storageAccountConnectionString; + } + + /** + * Set (Personalization Only) The storage account connection string. + * + * @param storageAccountConnectionString the storageAccountConnectionString value to set + * @return the CognitiveServicesAccountApiProperties object itself. + */ + public CognitiveServicesAccountApiProperties withStorageAccountConnectionString(String storageAccountConnectionString) { + this.storageAccountConnectionString = storageAccountConnectionString; + return this; + } + +} diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/CognitiveServicesAccountProperties.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/CognitiveServicesAccountProperties.java new file mode 100644 index 000000000000..304ff4e3fc40 --- /dev/null +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/CognitiveServicesAccountProperties.java @@ -0,0 +1,143 @@ +/** + * 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.management.cognitiveservices.v2017_04_18; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of Cognitive Services account. + */ +public class CognitiveServicesAccountProperties { + /** + * Gets the status of the cognitive services account at the time the + * operation was called. Possible values include: 'Creating', + * 'ResolvingDNS', 'Moving', 'Deleting', 'Succeeded', 'Failed'. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Endpoint of the created account. + */ + @JsonProperty(value = "endpoint", access = JsonProperty.Access.WRITE_ONLY) + private String endpoint; + + /** + * The internal identifier. + */ + @JsonProperty(value = "internalId", access = JsonProperty.Access.WRITE_ONLY) + private String internalId; + + /** + * Optional subdomain name used for token-based authentication. + */ + @JsonProperty(value = "customSubDomainName") + private String customSubDomainName; + + /** + * A collection of rules governing the accessibility from specific network + * locations. + */ + @JsonProperty(value = "networkAcls") + private NetworkRuleSet networkAcls; + + /** + * The api properties for special APIs. + */ + @JsonProperty(value = "apiProperties") + private CognitiveServicesAccountApiProperties apiProperties; + + /** + * Get gets the status of the cognitive services account at the time the operation was called. Possible values include: 'Creating', 'ResolvingDNS', 'Moving', 'Deleting', 'Succeeded', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get endpoint of the created account. + * + * @return the endpoint value + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Get the internal identifier. + * + * @return the internalId value + */ + public String internalId() { + return this.internalId; + } + + /** + * Get optional subdomain name used for token-based authentication. + * + * @return the customSubDomainName value + */ + public String customSubDomainName() { + return this.customSubDomainName; + } + + /** + * Set optional subdomain name used for token-based authentication. + * + * @param customSubDomainName the customSubDomainName value to set + * @return the CognitiveServicesAccountProperties object itself. + */ + public CognitiveServicesAccountProperties withCustomSubDomainName(String customSubDomainName) { + this.customSubDomainName = customSubDomainName; + return this; + } + + /** + * Get a collection of rules governing the accessibility from specific network locations. + * + * @return the networkAcls value + */ + public NetworkRuleSet networkAcls() { + return this.networkAcls; + } + + /** + * Set a collection of rules governing the accessibility from specific network locations. + * + * @param networkAcls the networkAcls value to set + * @return the CognitiveServicesAccountProperties object itself. + */ + public CognitiveServicesAccountProperties withNetworkAcls(NetworkRuleSet networkAcls) { + this.networkAcls = networkAcls; + return this; + } + + /** + * Get the api properties for special APIs. + * + * @return the apiProperties value + */ + public CognitiveServicesAccountApiProperties apiProperties() { + return this.apiProperties; + } + + /** + * Set the api properties for special APIs. + * + * @param apiProperties the apiProperties value to set + * @return the CognitiveServicesAccountProperties object itself. + */ + public CognitiveServicesAccountProperties withApiProperties(CognitiveServicesAccountApiProperties apiProperties) { + this.apiProperties = apiProperties; + return this; + } + +} diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/CognitiveServicesResourceAndSku.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/CognitiveServicesResourceAndSku.java index 05101654d788..fd943f93985b 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/CognitiveServicesResourceAndSku.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/CognitiveServicesResourceAndSku.java @@ -27,7 +27,7 @@ public class CognitiveServicesResourceAndSku { private Sku sku; /** - * Get the resourceType value. + * Get resource Namespace and Type. * * @return the resourceType value */ @@ -36,7 +36,7 @@ public String resourceType() { } /** - * Set the resourceType value. + * Set resource Namespace and Type. * * @param resourceType the resourceType value to set * @return the CognitiveServicesResourceAndSku object itself. @@ -47,7 +47,7 @@ public CognitiveServicesResourceAndSku withResourceType(String resourceType) { } /** - * Get the sku value. + * Get the SKU of Cognitive Services account. * * @return the sku value */ @@ -56,7 +56,7 @@ public Sku sku() { } /** - * Set the sku value. + * Set the SKU of Cognitive Services account. * * @param sku the sku value to set * @return the CognitiveServicesResourceAndSku object itself. diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/Error.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/Error.java index 3de58ecec472..18039d91afb7 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/Error.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/Error.java @@ -21,7 +21,7 @@ public class Error { private ErrorBody error; /** - * Get the error value. + * Get the error body. * * @return the error value */ @@ -30,7 +30,7 @@ public ErrorBody error() { } /** - * Set the error value. + * Set the error body. * * @param error the error value to set * @return the Error object itself. diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/ErrorBody.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/ErrorBody.java index f3272520ef0a..4bc0931c59ff 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/ErrorBody.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/ErrorBody.java @@ -27,7 +27,7 @@ public class ErrorBody { private String message; /** - * Get the code value. + * Get error code. * * @return the code value */ @@ -36,7 +36,7 @@ public String code() { } /** - * Set the code value. + * Set error code. * * @param code the code value to set * @return the ErrorBody object itself. @@ -47,7 +47,7 @@ public ErrorBody withCode(String code) { } /** - * Get the message value. + * Get error message. * * @return the message value */ @@ -56,7 +56,7 @@ public String message() { } /** - * Set the message value. + * Set error message. * * @param message the message value to set * @return the ErrorBody object itself. diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/IpRule.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/IpRule.java new file mode 100644 index 000000000000..c9da3991a09e --- /dev/null +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/IpRule.java @@ -0,0 +1,45 @@ +/** + * 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.management.cognitiveservices.v2017_04_18; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A rule governing the accessibility from a specific ip address or ip range. + */ +public class IpRule { + /** + * An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple + * IP address) or '124.56.78.0/24' (all addresses that start with + * 124.56.78). + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Get an IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or '124.56.78.0/24' (all addresses that start with 124.56.78). + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set an IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or '124.56.78.0/24' (all addresses that start with 124.56.78). + * + * @param value the value value to set + * @return the IpRule object itself. + */ + public IpRule withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/MetricName.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/MetricName.java index e192df37c15a..18597d12df49 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/MetricName.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/MetricName.java @@ -27,7 +27,7 @@ public class MetricName { private String localizedValue; /** - * Get the value value. + * Get the name of the metric. * * @return the value value */ @@ -36,7 +36,7 @@ public String value() { } /** - * Get the localizedValue value. + * Get the friendly name of the metric. * * @return the localizedValue value */ diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/NetworkRuleAction.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/NetworkRuleAction.java new file mode 100644 index 000000000000..47ea682cad25 --- /dev/null +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/NetworkRuleAction.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.management.cognitiveservices.v2017_04_18; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for NetworkRuleAction. + */ +public final class NetworkRuleAction extends ExpandableStringEnum { + /** Static value Allow for NetworkRuleAction. */ + public static final NetworkRuleAction ALLOW = fromString("Allow"); + + /** Static value Deny for NetworkRuleAction. */ + public static final NetworkRuleAction DENY = fromString("Deny"); + + /** + * Creates or finds a NetworkRuleAction from its string representation. + * @param name a name to look for + * @return the corresponding NetworkRuleAction + */ + @JsonCreator + public static NetworkRuleAction fromString(String name) { + return fromString(name, NetworkRuleAction.class); + } + + /** + * @return known NetworkRuleAction values + */ + public static Collection values() { + return values(NetworkRuleAction.class); + } +} diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/NetworkRuleSet.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/NetworkRuleSet.java new file mode 100644 index 000000000000..848be4550e41 --- /dev/null +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/NetworkRuleSet.java @@ -0,0 +1,98 @@ +/** + * 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.management.cognitiveservices.v2017_04_18; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A set of rules governing the network accessibility. + */ +public class NetworkRuleSet { + /** + * The default action when no rule from ipRules and from + * virtualNetworkRules match. This is only used after the bypass property + * has been evaluated. Possible values include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "defaultAction") + private NetworkRuleAction defaultAction; + + /** + * The list of IP address rules. + */ + @JsonProperty(value = "ipRules") + private List ipRules; + + /** + * The list of virtual network rules. + */ + @JsonProperty(value = "virtualNetworkRules") + private List virtualNetworkRules; + + /** + * Get the default action when no rule from ipRules and from virtualNetworkRules match. This is only used after the bypass property has been evaluated. Possible values include: 'Allow', 'Deny'. + * + * @return the defaultAction value + */ + public NetworkRuleAction defaultAction() { + return this.defaultAction; + } + + /** + * Set the default action when no rule from ipRules and from virtualNetworkRules match. This is only used after the bypass property has been evaluated. Possible values include: 'Allow', 'Deny'. + * + * @param defaultAction the defaultAction value to set + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withDefaultAction(NetworkRuleAction defaultAction) { + this.defaultAction = defaultAction; + return this; + } + + /** + * Get the list of IP address rules. + * + * @return the ipRules value + */ + public List ipRules() { + return this.ipRules; + } + + /** + * Set the list of IP address rules. + * + * @param ipRules the ipRules value to set + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withIpRules(List ipRules) { + this.ipRules = ipRules; + return this; + } + + /** + * Get the list of virtual network rules. + * + * @return the virtualNetworkRules value + */ + public List virtualNetworkRules() { + return this.virtualNetworkRules; + } + + /** + * Set the list of virtual network rules. + * + * @param virtualNetworkRules the virtualNetworkRules value to set + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withVirtualNetworkRules(List virtualNetworkRules) { + this.virtualNetworkRules = virtualNetworkRules; + return this; + } + +} diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/OperationDisplayInfo.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/OperationDisplayInfo.java index e4cbb28b61ce..b104a215eb99 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/OperationDisplayInfo.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/OperationDisplayInfo.java @@ -39,7 +39,7 @@ public class OperationDisplayInfo { private String resource; /** - * Get the description value. + * Get the description of the operation. * * @return the description value */ @@ -48,7 +48,7 @@ public String description() { } /** - * Set the description value. + * Set the description of the operation. * * @param description the description value to set * @return the OperationDisplayInfo object itself. @@ -59,7 +59,7 @@ public OperationDisplayInfo withDescription(String description) { } /** - * Get the operation value. + * Get the action that users can perform, based on their permission level. * * @return the operation value */ @@ -68,7 +68,7 @@ public String operation() { } /** - * Set the operation value. + * Set the action that users can perform, based on their permission level. * * @param operation the operation value to set * @return the OperationDisplayInfo object itself. @@ -79,7 +79,7 @@ public OperationDisplayInfo withOperation(String operation) { } /** - * Get the provider value. + * Get service provider: Microsoft Cognitive Services. * * @return the provider value */ @@ -88,7 +88,7 @@ public String provider() { } /** - * Set the provider value. + * Set service provider: Microsoft Cognitive Services. * * @param provider the provider value to set * @return the OperationDisplayInfo object itself. @@ -99,7 +99,7 @@ public OperationDisplayInfo withProvider(String provider) { } /** - * Get the resource value. + * Get resource on which the operation is performed. * * @return the resource value */ @@ -108,7 +108,7 @@ public String resource() { } /** - * Set the resource value. + * Set resource on which the operation is performed. * * @param resource the resource value to set * @return the OperationDisplayInfo object itself. diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/RegenerateKeyParameters.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/RegenerateKeyParameters.java index 7dfb39b092ca..ffa01d024646 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/RegenerateKeyParameters.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/RegenerateKeyParameters.java @@ -22,7 +22,7 @@ public class RegenerateKeyParameters { private KeyName keyName; /** - * Get the keyName value. + * Get key name to generate (Key1|Key2). Possible values include: 'Key1', 'Key2'. * * @return the keyName value */ @@ -31,7 +31,7 @@ public KeyName keyName() { } /** - * Set the keyName value. + * Set key name to generate (Key1|Key2). Possible values include: 'Key1', 'Key2'. * * @param keyName the keyName value to set * @return the RegenerateKeyParameters object itself. diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/ResourceSkuRestrictionInfo.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/ResourceSkuRestrictionInfo.java index d95c2df857c6..2a05b5e5b83a 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/ResourceSkuRestrictionInfo.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/ResourceSkuRestrictionInfo.java @@ -28,7 +28,7 @@ public class ResourceSkuRestrictionInfo { private List zones; /** - * Get the locations value. + * Get locations where the SKU is restricted. * * @return the locations value */ @@ -37,7 +37,7 @@ public List locations() { } /** - * Get the zones value. + * Get list of availability zones where the SKU is restricted. * * @return the zones value */ diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/ResourceSkuRestrictions.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/ResourceSkuRestrictions.java index 5d6d556a0acc..53f55127961d 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/ResourceSkuRestrictions.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/ResourceSkuRestrictions.java @@ -42,7 +42,7 @@ public class ResourceSkuRestrictions { private ResourceSkuRestrictionsReasonCode reasonCode; /** - * Get the type value. + * Get the type of restrictions. Possible values include: 'Location', 'Zone'. * * @return the type value */ @@ -51,7 +51,7 @@ public ResourceSkuRestrictionsType type() { } /** - * Get the values value. + * Get the value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. * * @return the values value */ @@ -60,7 +60,7 @@ public List values() { } /** - * Get the restrictionInfo value. + * Get the information about the restriction where the SKU cannot be used. * * @return the restrictionInfo value */ @@ -69,7 +69,7 @@ public ResourceSkuRestrictionInfo restrictionInfo() { } /** - * Get the reasonCode value. + * Get the reason for restriction. Possible values include: 'QuotaId', 'NotAvailableForSubscription'. * * @return the reasonCode value */ diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/Sku.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/Sku.java index 3a958818f8e1..e4b4b0845376 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/Sku.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/Sku.java @@ -16,11 +16,10 @@ public class Sku { /** * Gets or sets the sku name. Required for account creation, optional for - * update. Possible values include: 'F0', 'P0', 'P1', 'P2', 'S0', 'S1', - * 'S2', 'S3', 'S4', 'S5', 'S6'. + * update. */ @JsonProperty(value = "name", required = true) - private SkuName name; + private String name; /** * Gets the sku tier. This is based on the SKU name. Possible values @@ -30,27 +29,27 @@ public class Sku { private SkuTier tier; /** - * Get the name value. + * Get gets or sets the sku name. Required for account creation, optional for update. * * @return the name value */ - public SkuName name() { + public String name() { return this.name; } /** - * Set the name value. + * Set gets or sets the sku name. Required for account creation, optional for update. * * @param name the name value to set * @return the Sku object itself. */ - public Sku withName(SkuName name) { + public Sku withName(String name) { this.name = name; return this; } /** - * Get the tier value. + * Get gets the sku tier. This is based on the SKU name. Possible values include: 'Free', 'Standard', 'Premium'. * * @return the tier value */ diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/Usage.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/Usage.java index 2b1d4cf0737e..c9cce5e78a65 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/Usage.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/Usage.java @@ -60,7 +60,7 @@ public class Usage { private QuotaUsageStatus status; /** - * Get the unit value. + * Get the unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds'. * * @return the unit value */ @@ -69,7 +69,7 @@ public UnitType unit() { } /** - * Set the unit value. + * Set the unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds'. * * @param unit the unit value to set * @return the Usage object itself. @@ -80,7 +80,7 @@ public Usage withUnit(UnitType unit) { } /** - * Get the name value. + * Get the name information for the metric. * * @return the name value */ @@ -89,7 +89,7 @@ public MetricName name() { } /** - * Get the quotaPeriod value. + * Get the quota period used to summarize the usage values. * * @return the quotaPeriod value */ @@ -98,7 +98,7 @@ public String quotaPeriod() { } /** - * Get the limit value. + * Get maximum value for this metric. * * @return the limit value */ @@ -107,7 +107,7 @@ public Double limit() { } /** - * Get the currentValue value. + * Get current value for this metric. * * @return the currentValue value */ @@ -116,7 +116,7 @@ public Double currentValue() { } /** - * Get the nextResetTime value. + * Get next reset time for current quota. * * @return the nextResetTime value */ @@ -125,7 +125,7 @@ public String nextResetTime() { } /** - * Get the status value. + * Get cognitive Services account quota usage status. Possible values include: 'Included', 'Blocked', 'InOverage', 'Unknown'. * * @return the status value */ @@ -134,7 +134,7 @@ public QuotaUsageStatus status() { } /** - * Set the status value. + * Set cognitive Services account quota usage status. Possible values include: 'Included', 'Blocked', 'InOverage', 'Unknown'. * * @param status the status value to set * @return the Usage object itself. diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/VirtualNetworkRule.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/VirtualNetworkRule.java new file mode 100644 index 000000000000..124697627744 --- /dev/null +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/VirtualNetworkRule.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.management.cognitiveservices.v2017_04_18; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A rule governing the accessibility from a specific virtual network. + */ +public class VirtualNetworkRule { + /** + * Full resource id of a vnet subnet, such as + * '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Gets the state of virtual network rule. + */ + @JsonProperty(value = "state") + private String state; + + /** + * Ignore missing vnet service endpoint or not. + */ + @JsonProperty(value = "ignoreMissingVnetServiceEndpoint") + private Boolean ignoreMissingVnetServiceEndpoint; + + /** + * Get full resource id of a vnet subnet, such as '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set full resource id of a vnet subnet, such as '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. + * + * @param id the id value to set + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withId(String id) { + this.id = id; + return this; + } + + /** + * Get gets the state of virtual network rule. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Set gets the state of virtual network rule. + * + * @param state the state value to set + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withState(String state) { + this.state = state; + return this; + } + + /** + * Get ignore missing vnet service endpoint or not. + * + * @return the ignoreMissingVnetServiceEndpoint value + */ + public Boolean ignoreMissingVnetServiceEndpoint() { + return this.ignoreMissingVnetServiceEndpoint; + } + + /** + * Set ignore missing vnet service endpoint or not. + * + * @param ignoreMissingVnetServiceEndpoint the ignoreMissingVnetServiceEndpoint value to set + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withIgnoreMissingVnetServiceEndpoint(Boolean ignoreMissingVnetServiceEndpoint) { + this.ignoreMissingVnetServiceEndpoint = ignoreMissingVnetServiceEndpoint; + return this; + } + +} diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/AccountsImpl.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/AccountsImpl.java index 3741d2109158..702435a0cb80 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/AccountsImpl.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/AccountsImpl.java @@ -82,41 +82,22 @@ public PagedList listByResourceGroup(String resourceGr return this.wrapList(client.listByResourceGroup(resourceGroupName)); } - private Observable> listByResourceGroupNextInnerPageAsync(String nextLink) { - if (nextLink == null) { - Observable.empty(); - } - AccountsInner client = this.inner(); - return client.listByResourceGroupNextAsync(nextLink) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return Observable.just(page).concatWith(listByResourceGroupNextInnerPageAsync(page.nextPageLink())); - } - }); - } @Override public Observable listByResourceGroupAsync(String resourceGroupName) { AccountsInner client = this.inner(); return client.listByResourceGroupAsync(resourceGroupName) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return listByResourceGroupNextInnerPageAsync(page.nextPageLink()); - } - }) .flatMapIterable(new Func1, Iterable>() { @Override public Iterable call(Page page) { return page.items(); } - }) + }) .map(new Func1() { @Override public CognitiveServicesAccount call(CognitiveServicesAccountInner inner) { return wrapModel(inner); } - }); + }); } @Override @@ -125,41 +106,22 @@ public PagedList list() { return this.wrapList(client.list()); } - private Observable> listNextInnerPageAsync(String nextLink) { - if (nextLink == null) { - Observable.empty(); - } - AccountsInner client = this.inner(); - return client.listNextAsync(nextLink) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return Observable.just(page).concatWith(listNextInnerPageAsync(page.nextPageLink())); - } - }); - } @Override public Observable listAsync() { AccountsInner client = this.inner(); return client.listAsync() - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return listNextInnerPageAsync(page.nextPageLink()); - } - }) .flatMapIterable(new Func1, Iterable>() { @Override public Iterable call(Page page) { return page.items(); } - }) + }) .map(new Func1() { @Override public CognitiveServicesAccount call(CognitiveServicesAccountInner inner) { return wrapModel(inner); } - }); + }); } @Override diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/AccountsInner.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/AccountsInner.java index 55fdcc4cd88d..445794e8569a 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/AccountsInner.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/AccountsInner.java @@ -15,12 +15,9 @@ import com.google.common.reflect.TypeToken; import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.ListOperationCallback; -import com.microsoft.azure.management.cognitiveservices.v2017_04_18.CognitiveServicesAccountCreateParameters; -import com.microsoft.azure.management.cognitiveservices.v2017_04_18.CognitiveServicesAccountUpdateParameters; import com.microsoft.azure.management.cognitiveservices.v2017_04_18.ErrorException; import com.microsoft.azure.management.cognitiveservices.v2017_04_18.KeyName; import com.microsoft.azure.management.cognitiveservices.v2017_04_18.RegenerateKeyParameters; -import com.microsoft.azure.management.cognitiveservices.v2017_04_18.Sku; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -29,7 +26,6 @@ import com.microsoft.rest.Validator; import java.io.IOException; import java.util.List; -import java.util.Map; import okhttp3.ResponseBody; import retrofit2.http.Body; import retrofit2.http.GET; @@ -74,11 +70,11 @@ public AccountsInner(Retrofit retrofit, CognitiveServicesManagementClientImpl cl interface AccountsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cognitiveservices.v2017_04_18.Accounts create" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}") - Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Body CognitiveServicesAccountCreateParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Body CognitiveServicesAccountInner account, @Query("api-version") String apiVersion, @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.management.cognitiveservices.v2017_04_18.Accounts update" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}") - Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CognitiveServicesAccountUpdateParameters parameters, @Header("User-Agent") String userAgent); + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Body CognitiveServicesAccountInner account, @Query("api-version") String apiVersion, @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.management.cognitiveservices.v2017_04_18.Accounts delete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}", method = "DELETE", hasBody = true) @@ -127,14 +123,14 @@ interface AccountsService { * * @param resourceGroupName The name of the resource group within the user's subscription. * @param accountName The name of Cognitive Services account. - * @param parameters The parameters to provide for the created account. + * @param account The parameters to provide for the created account. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the CognitiveServicesAccountInner object if successful. */ - public CognitiveServicesAccountInner create(String resourceGroupName, String accountName, CognitiveServicesAccountCreateParameters parameters) { - return createWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); + public CognitiveServicesAccountInner create(String resourceGroupName, String accountName, CognitiveServicesAccountInner account) { + return createWithServiceResponseAsync(resourceGroupName, accountName, account).toBlocking().single().body(); } /** @@ -142,13 +138,13 @@ public CognitiveServicesAccountInner create(String resourceGroupName, String acc * * @param resourceGroupName The name of the resource group within the user's subscription. * @param accountName The name of Cognitive Services account. - * @param parameters The parameters to provide for the created account. + * @param account The parameters to provide for the created account. * @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 createAsync(String resourceGroupName, String accountName, CognitiveServicesAccountCreateParameters parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + public ServiceFuture createAsync(String resourceGroupName, String accountName, CognitiveServicesAccountInner account, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, account), serviceCallback); } /** @@ -156,12 +152,12 @@ public ServiceFuture createAsync(String resourceG * * @param resourceGroupName The name of the resource group within the user's subscription. * @param accountName The name of Cognitive Services account. - * @param parameters The parameters to provide for the created account. + * @param account The parameters to provide for the created account. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the CognitiveServicesAccountInner object */ - public Observable createAsync(String resourceGroupName, String accountName, CognitiveServicesAccountCreateParameters parameters) { - return createWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, CognitiveServicesAccountInner>() { + public Observable createAsync(String resourceGroupName, String accountName, CognitiveServicesAccountInner account) { + return createWithServiceResponseAsync(resourceGroupName, accountName, account).map(new Func1, CognitiveServicesAccountInner>() { @Override public CognitiveServicesAccountInner call(ServiceResponse response) { return response.body(); @@ -174,11 +170,11 @@ public CognitiveServicesAccountInner call(ServiceResponse> createWithServiceResponseAsync(String resourceGroupName, String accountName, CognitiveServicesAccountCreateParameters parameters) { + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, CognitiveServicesAccountInner account) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -188,14 +184,14 @@ public Observable> createWithServ if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + if (account == null) { + throw new IllegalArgumentException("Parameter account is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - Validator.validate(parameters); - return service.create(resourceGroupName, accountName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + Validator.validate(account); + return service.create(resourceGroupName, accountName, this.client.subscriptionId(), account, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -213,6 +209,7 @@ private ServiceResponse createDelegate(ResponsenewInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) .registerError(ErrorException.class) .build(response); } @@ -222,13 +219,14 @@ private ServiceResponse createDelegate(Response updateAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + public ServiceFuture updateAsync(String resourceGroupName, String accountName, CognitiveServicesAccountInner account, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, account), serviceCallback); } /** @@ -249,11 +248,12 @@ public ServiceFuture updateAsync(String resourceG * * @param resourceGroupName The name of the resource group within the user's subscription. * @param accountName The name of Cognitive Services account. + * @param account The parameters to provide for the created account. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the CognitiveServicesAccountInner object */ - public Observable updateAsync(String resourceGroupName, String accountName) { - return updateWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, CognitiveServicesAccountInner>() { + public Observable updateAsync(String resourceGroupName, String accountName, CognitiveServicesAccountInner account) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, account).map(new Func1, CognitiveServicesAccountInner>() { @Override public CognitiveServicesAccountInner call(ServiceResponse response) { return response.body(); @@ -266,10 +266,11 @@ public CognitiveServicesAccountInner call(ServiceResponse> updateWithServiceResponseAsync(String resourceGroupName, String accountName) { + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, CognitiveServicesAccountInner account) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -279,107 +280,14 @@ public Observable> updateWithServ if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - final Sku sku = null; - final Map tags = null; - CognitiveServicesAccountUpdateParameters parameters = new CognitiveServicesAccountUpdateParameters(); - parameters.withSku(null); - parameters.withTags(null); - return service.update(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = updateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - /** - * Updates a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. - * @param accountName The name of Cognitive Services account. - * @param sku Gets or sets the SKU of the resource. - * @param tags Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the CognitiveServicesAccountInner object if successful. - */ - public CognitiveServicesAccountInner update(String resourceGroupName, String accountName, Sku sku, Map tags) { - return updateWithServiceResponseAsync(resourceGroupName, accountName, sku, tags).toBlocking().single().body(); - } - - /** - * Updates a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. - * @param accountName The name of Cognitive Services account. - * @param sku Gets or sets the SKU of the resource. - * @param tags Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. - * @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 updateAsync(String resourceGroupName, String accountName, Sku sku, Map tags, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, sku, tags), serviceCallback); - } - - /** - * Updates a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. - * @param accountName The name of Cognitive Services account. - * @param sku Gets or sets the SKU of the resource. - * @param tags Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the CognitiveServicesAccountInner object - */ - public Observable updateAsync(String resourceGroupName, String accountName, Sku sku, Map tags) { - return updateWithServiceResponseAsync(resourceGroupName, accountName, sku, tags).map(new Func1, CognitiveServicesAccountInner>() { - @Override - public CognitiveServicesAccountInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Updates a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group within the user's subscription. - * @param accountName The name of Cognitive Services account. - * @param sku Gets or sets the SKU of the resource. - * @param tags Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the CognitiveServicesAccountInner object - */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, Sku sku, Map tags) { - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + if (account == null) { + throw new IllegalArgumentException("Parameter account is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - Validator.validate(sku); - Validator.validate(tags); - CognitiveServicesAccountUpdateParameters parameters = new CognitiveServicesAccountUpdateParameters(); - parameters.withSku(sku); - parameters.withTags(tags); - return service.update(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + Validator.validate(account); + return service.update(resourceGroupName, accountName, this.client.subscriptionId(), account, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -396,6 +304,7 @@ public Observable> call(Response< private ServiceResponse updateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) .registerError(ErrorException.class) .build(response); } @@ -481,6 +390,7 @@ public Observable> call(Response response) { private ServiceResponse deleteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) .register(204, new TypeToken() { }.getType()) .registerError(ErrorException.class) .build(response); diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CheckDomainAvailabilityResultInner.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CheckDomainAvailabilityResultInner.java new file mode 100644 index 000000000000..b82eac9e8df2 --- /dev/null +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CheckDomainAvailabilityResultInner.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.management.cognitiveservices.v2017_04_18.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Check Domain availability result. + */ +public class CheckDomainAvailabilityResultInner { + /** + * Indicates the given SKU is available or not. + */ + @JsonProperty(value = "isSubdomainAvailable") + private Boolean isSubdomainAvailable; + + /** + * Reason why the SKU is not available. + */ + @JsonProperty(value = "reason") + private String reason; + + /** + * The subdomain name to use. + */ + @JsonProperty(value = "subdomainName") + private String subdomainName; + + /** + * The Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get indicates the given SKU is available or not. + * + * @return the isSubdomainAvailable value + */ + public Boolean isSubdomainAvailable() { + return this.isSubdomainAvailable; + } + + /** + * Set indicates the given SKU is available or not. + * + * @param isSubdomainAvailable the isSubdomainAvailable value to set + * @return the CheckDomainAvailabilityResultInner object itself. + */ + public CheckDomainAvailabilityResultInner withIsSubdomainAvailable(Boolean isSubdomainAvailable) { + this.isSubdomainAvailable = isSubdomainAvailable; + return this; + } + + /** + * Get reason why the SKU is not available. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set reason why the SKU is not available. + * + * @param reason the reason value to set + * @return the CheckDomainAvailabilityResultInner object itself. + */ + public CheckDomainAvailabilityResultInner withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get the subdomain name to use. + * + * @return the subdomainName value + */ + public String subdomainName() { + return this.subdomainName; + } + + /** + * Set the subdomain name to use. + * + * @param subdomainName the subdomainName value to set + * @return the CheckDomainAvailabilityResultInner object itself. + */ + public CheckDomainAvailabilityResultInner withSubdomainName(String subdomainName) { + this.subdomainName = subdomainName; + return this; + } + + /** + * Get the Type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the Type of the resource. + * + * @param type the type value to set + * @return the CheckDomainAvailabilityResultInner object itself. + */ + public CheckDomainAvailabilityResultInner withType(String type) { + this.type = type; + return this; + } + +} diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CheckSkuAvailabilityResultListInner.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CheckSkuAvailabilityResultListInner.java index 99e08ca95923..3edc75d3412c 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CheckSkuAvailabilityResultListInner.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CheckSkuAvailabilityResultListInner.java @@ -23,7 +23,7 @@ public class CheckSkuAvailabilityResultListInner { private List value; /** - * Get the value value. + * Get check SKU availability result list. * * @return the value value */ @@ -32,7 +32,7 @@ public List value() { } /** - * Set the value value. + * Set check SKU availability result list. * * @param value the value value to set * @return the CheckSkuAvailabilityResultListInner object itself. diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesAccountEnumerateSkusResultInner.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesAccountEnumerateSkusResultInner.java index f1f50799a0e2..ada320f88f88 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesAccountEnumerateSkusResultInner.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesAccountEnumerateSkusResultInner.java @@ -23,7 +23,7 @@ public class CognitiveServicesAccountEnumerateSkusResultInner { private List value; /** - * Get the value value. + * Get gets the list of Cognitive Services accounts and their properties. * * @return the value value */ diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesAccountImpl.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesAccountImpl.java index 6f3578436ea2..c67b7875833a 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesAccountImpl.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesAccountImpl.java @@ -11,46 +11,25 @@ import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; import com.microsoft.azure.management.cognitiveservices.v2017_04_18.CognitiveServicesAccount; import rx.Observable; -import com.microsoft.azure.management.cognitiveservices.v2017_04_18.CognitiveServicesAccountCreateParameters; -import com.microsoft.azure.management.cognitiveservices.v2017_04_18.ProvisioningState; +import com.microsoft.azure.management.cognitiveservices.v2017_04_18.CognitiveServicesAccountProperties; import com.microsoft.azure.management.cognitiveservices.v2017_04_18.Sku; -import com.microsoft.azure.management.cognitiveservices.v2017_04_18.Kind; -import rx.functions.Func1; class CognitiveServicesAccountImpl extends GroupableResourceCoreImpl implements CognitiveServicesAccount, CognitiveServicesAccount.Definition, CognitiveServicesAccount.Update { - private CognitiveServicesAccountCreateParameters createParameter; CognitiveServicesAccountImpl(String name, CognitiveServicesAccountInner inner, CognitiveServicesManager manager) { super(name, inner, manager); - this.createParameter = new CognitiveServicesAccountCreateParameters(); } @Override public Observable createResourceAsync() { AccountsInner client = this.manager().inner().accounts(); - this.createParameter.withLocation(inner().location()); - this.createParameter.withTags(inner().getTags()); - return client.createAsync(this.resourceGroupName(), this.name(), this.createParameter) - .map(new Func1() { - @Override - public CognitiveServicesAccountInner call(CognitiveServicesAccountInner resource) { - resetCreateUpdateParameters(); - return resource; - } - }) + return client.createAsync(this.resourceGroupName(), this.name(), this.inner()) .map(innerToFluentMap(this)); } @Override public Observable updateResourceAsync() { AccountsInner client = this.manager().inner().accounts(); - return client.updateAsync(this.resourceGroupName(), this.name()) - .map(new Func1() { - @Override - public CognitiveServicesAccountInner call(CognitiveServicesAccountInner resource) { - resetCreateUpdateParameters(); - return resource; - } - }) + return client.updateAsync(this.resourceGroupName(), this.name(), this.inner()) .map(innerToFluentMap(this)); } @@ -65,33 +44,20 @@ public boolean isInCreateMode() { return this.inner().id() == null; } - private void resetCreateUpdateParameters() { - this.createParameter = new CognitiveServicesAccountCreateParameters(); - } - - @Override - public String endpoint() { - return this.inner().endpoint(); - } @Override public String etag() { return this.inner().etag(); } - @Override - public String internalId() { - return this.inner().internalId(); - } - @Override public String kind() { return this.inner().kind(); } @Override - public ProvisioningState provisioningState() { - return this.inner().provisioningState(); + public CognitiveServicesAccountProperties properties() { + return this.inner().properties(); } @Override @@ -100,20 +66,20 @@ public Sku sku() { } @Override - public CognitiveServicesAccountImpl withKind(Kind kind) { - this.createParameter.withKind(kind); + public CognitiveServicesAccountImpl withKind(String kind) { + this.inner().withKind(kind); return this; } @Override - public CognitiveServicesAccountImpl withProperties(Object properties) { - this.createParameter.withProperties(properties); + public CognitiveServicesAccountImpl withProperties(CognitiveServicesAccountProperties properties) { + this.inner().withProperties(properties); return this; } @Override public CognitiveServicesAccountImpl withSku(Sku sku) { - this.createParameter.withSku(sku); + this.inner().withSku(sku); return this; } diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesAccountInner.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesAccountInner.java index a8e5b3a0817d..17db8d99310c 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesAccountInner.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesAccountInner.java @@ -8,49 +8,33 @@ package com.microsoft.azure.management.cognitiveservices.v2017_04_18.implementation; -import com.microsoft.azure.management.cognitiveservices.v2017_04_18.ProvisioningState; +import com.microsoft.azure.management.cognitiveservices.v2017_04_18.CognitiveServicesAccountProperties; import com.microsoft.azure.management.cognitiveservices.v2017_04_18.Sku; import com.fasterxml.jackson.annotation.JsonProperty; -import com.microsoft.rest.serializer.JsonFlatten; import com.microsoft.azure.Resource; /** * Cognitive Services Account is an Azure resource representing the provisioned * account, its type, location and SKU. */ -@JsonFlatten public class CognitiveServicesAccountInner extends Resource { /** * Entity Tag. */ - @JsonProperty(value = "etag") + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; /** - * Type of cognitive service account. + * The Kind of the resource. */ @JsonProperty(value = "kind") private String kind; /** - * Gets the status of the cognitive services account at the time the - * operation was called. Possible values include: 'Creating', - * 'ResolvingDNS', 'Moving', 'Deleting', 'Succeeded', 'Failed'. + * Properties of Cognitive Services account. */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /** - * Endpoint of the created account. - */ - @JsonProperty(value = "properties.endpoint") - private String endpoint; - - /** - * The internal identifier. - */ - @JsonProperty(value = "properties.internalId") - private String internalId; + @JsonProperty(value = "properties") + private CognitiveServicesAccountProperties properties; /** * The SKU of Cognitive Services account. @@ -59,7 +43,7 @@ public class CognitiveServicesAccountInner extends Resource { private Sku sku; /** - * Get the etag value. + * Get entity Tag. * * @return the etag value */ @@ -68,18 +52,7 @@ public String etag() { } /** - * Set the etag value. - * - * @param etag the etag value to set - * @return the CognitiveServicesAccountInner object itself. - */ - public CognitiveServicesAccountInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the kind value. + * Get the Kind of the resource. * * @return the kind value */ @@ -88,7 +61,7 @@ public String kind() { } /** - * Set the kind value. + * Set the Kind of the resource. * * @param kind the kind value to set * @return the CognitiveServicesAccountInner object itself. @@ -99,56 +72,27 @@ public CognitiveServicesAccountInner withKind(String kind) { } /** - * Get the provisioningState value. - * - * @return the provisioningState value - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the endpoint value. - * - * @return the endpoint value - */ - public String endpoint() { - return this.endpoint; - } - - /** - * Set the endpoint value. - * - * @param endpoint the endpoint value to set - * @return the CognitiveServicesAccountInner object itself. - */ - public CognitiveServicesAccountInner withEndpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /** - * Get the internalId value. + * Get properties of Cognitive Services account. * - * @return the internalId value + * @return the properties value */ - public String internalId() { - return this.internalId; + public CognitiveServicesAccountProperties properties() { + return this.properties; } /** - * Set the internalId value. + * Set properties of Cognitive Services account. * - * @param internalId the internalId value to set + * @param properties the properties value to set * @return the CognitiveServicesAccountInner object itself. */ - public CognitiveServicesAccountInner withInternalId(String internalId) { - this.internalId = internalId; + public CognitiveServicesAccountInner withProperties(CognitiveServicesAccountProperties properties) { + this.properties = properties; return this; } /** - * Get the sku value. + * Get the SKU of Cognitive Services account. * * @return the sku value */ @@ -157,7 +101,7 @@ public Sku sku() { } /** - * Set the sku value. + * Set the SKU of Cognitive Services account. * * @param sku the sku value to set * @return the CognitiveServicesAccountInner object itself. diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesAccountKeysInner.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesAccountKeysInner.java index 6b6d5f6d3155..3e9bc1251a09 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesAccountKeysInner.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesAccountKeysInner.java @@ -27,7 +27,7 @@ public class CognitiveServicesAccountKeysInner { private String key2; /** - * Get the key1 value. + * Get gets the value of key 1. * * @return the key1 value */ @@ -36,7 +36,7 @@ public String key1() { } /** - * Set the key1 value. + * Set gets the value of key 1. * * @param key1 the key1 value to set * @return the CognitiveServicesAccountKeysInner object itself. @@ -47,7 +47,7 @@ public CognitiveServicesAccountKeysInner withKey1(String key1) { } /** - * Get the key2 value. + * Get gets the value of key 2. * * @return the key2 value */ @@ -56,7 +56,7 @@ public String key2() { } /** - * Set the key2 value. + * Set gets the value of key 2. * * @param key2 the key2 value to set * @return the CognitiveServicesAccountKeysInner object itself. diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesManagementClientImpl.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesManagementClientImpl.java index 35bb37c41659..5da4953e335c 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesManagementClientImpl.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesManagementClientImpl.java @@ -8,15 +8,37 @@ package com.microsoft.azure.management.cognitiveservices.v2017_04_18.implementation; +import com.google.common.reflect.TypeToken; import com.microsoft.azure.AzureClient; import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.cognitiveservices.v2017_04_18.CheckDomainAvailabilityParameter; +import com.microsoft.azure.management.cognitiveservices.v2017_04_18.CheckSkuAvailabilityParameter; import com.microsoft.rest.credentials.ServiceClientCredentials; import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; /** * Initializes a new instance of the CognitiveServicesManagementClientImpl class. */ public class CognitiveServicesManagementClientImpl extends AzureServiceClient { + /** The Retrofit service to perform REST calls. */ + private CognitiveServicesManagementClientService service; /** the {@link AzureClient} used for long running operations. */ private AzureClient azureClient; @@ -63,11 +85,11 @@ public String apiVersion() { return this.apiVersion; } - /** Gets or sets the preferred language for the response. */ + /** The preferred language for the response. */ private String acceptLanguage; /** - * Gets Gets or sets the preferred language for the response. + * Gets The preferred language for the response. * * @return the acceptLanguage value. */ @@ -76,7 +98,7 @@ public String acceptLanguage() { } /** - * Sets Gets or sets the preferred language for the response. + * Sets The preferred language for the response. * * @param acceptLanguage the acceptLanguage value. * @return the service client itself @@ -86,11 +108,11 @@ public CognitiveServicesManagementClientImpl withAcceptLanguage(String acceptLan return this; } - /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + /** 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. + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. * * @return the longRunningOperationRetryTimeout value. */ @@ -99,7 +121,7 @@ public int longRunningOperationRetryTimeout() { } /** - * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. * * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. * @return the service client itself @@ -109,11 +131,11 @@ public CognitiveServicesManagementClientImpl withLongRunningOperationRetryTimeou return this; } - /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ private boolean generateClientRequestId; /** - * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * * @return the generateClientRequestId value. */ @@ -122,7 +144,7 @@ public 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. + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * * @param generateClientRequestId the generateClientRequestId value. * @return the service client itself @@ -171,19 +193,6 @@ public OperationsInner operations() { return this.operations; } - /** - * The CheckSkuAvailabilitysInner object to access its operations. - */ - private CheckSkuAvailabilitysInner checkSkuAvailabilitys; - - /** - * Gets the CheckSkuAvailabilitysInner object to access its operations. - * @return the CheckSkuAvailabilitysInner object. - */ - public CheckSkuAvailabilitysInner checkSkuAvailabilitys() { - return this.checkSkuAvailabilitys; - } - /** * Initializes an instance of CognitiveServicesManagementClient client. * @@ -222,8 +231,8 @@ protected void initialize() { this.accounts = new AccountsInner(restClient().retrofit(), this); this.resourceSkus = new ResourceSkusInner(restClient().retrofit(), this); this.operations = new OperationsInner(restClient().retrofit(), this); - this.checkSkuAvailabilitys = new CheckSkuAvailabilitysInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); + initializeService(); } /** @@ -233,6 +242,220 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "CognitiveServicesManagementClient", "2017-04-18"); + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "CognitiveServicesManagementClient", "2017-04-18"); + } + + private void initializeService() { + service = restClient().retrofit().create(CognitiveServicesManagementClientService.class); + } + + /** + * The interface defining all the services for CognitiveServicesManagementClient to be + * used by Retrofit to perform actually REST calls. + */ + interface CognitiveServicesManagementClientService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cognitiveservices.v2017_04_18.CognitiveServicesManagementClient checkSkuAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/checkSkuAvailability") + Observable> checkSkuAvailability(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CheckSkuAvailabilityParameter parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cognitiveservices.v2017_04_18.CognitiveServicesManagementClient checkDomainAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/checkDomainAvailability") + Observable> checkDomainAvailability(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CheckDomainAvailabilityParameter parameters, @Header("User-Agent") String userAgent); + + } + + /** + * Check available SKUs. + * + * @param location Resource location. + * @param skus The SKU of the resource. + * @param kind The Kind of the resource. + * @param type The Type of the resource. + * @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 CheckSkuAvailabilityResultListInner object if successful. + */ + public CheckSkuAvailabilityResultListInner checkSkuAvailability(String location, List skus, String kind, String type) { + return checkSkuAvailabilityWithServiceResponseAsync(location, skus, kind, type).toBlocking().single().body(); + } + + /** + * Check available SKUs. + * + * @param location Resource location. + * @param skus The SKU of the resource. + * @param kind The Kind of the resource. + * @param type The Type of the resource. + * @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 checkSkuAvailabilityAsync(String location, List skus, String kind, String type, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkSkuAvailabilityWithServiceResponseAsync(location, skus, kind, type), serviceCallback); + } + + /** + * Check available SKUs. + * + * @param location Resource location. + * @param skus The SKU of the resource. + * @param kind The Kind of the resource. + * @param type The Type of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckSkuAvailabilityResultListInner object + */ + public Observable checkSkuAvailabilityAsync(String location, List skus, String kind, String type) { + return checkSkuAvailabilityWithServiceResponseAsync(location, skus, kind, type).map(new Func1, CheckSkuAvailabilityResultListInner>() { + @Override + public CheckSkuAvailabilityResultListInner call(ServiceResponse response) { + return response.body(); + } + }); } + + /** + * Check available SKUs. + * + * @param location Resource location. + * @param skus The SKU of the resource. + * @param kind The Kind of the resource. + * @param type The Type of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckSkuAvailabilityResultListInner object + */ + public Observable> checkSkuAvailabilityWithServiceResponseAsync(String location, List skus, String kind, String type) { + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (skus == null) { + throw new IllegalArgumentException("Parameter skus is required and cannot be null."); + } + if (kind == null) { + throw new IllegalArgumentException("Parameter kind is required and cannot be null."); + } + if (type == null) { + throw new IllegalArgumentException("Parameter type is required and cannot be null."); + } + Validator.validate(skus); + CheckSkuAvailabilityParameter parameters = new CheckSkuAvailabilityParameter(); + parameters.withSkus(skus); + parameters.withKind(kind); + parameters.withType(type); + return service.checkSkuAvailability(this.subscriptionId(), location, this.apiVersion(), this.acceptLanguage(), parameters, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkSkuAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkSkuAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Check whether a domain is available. + * + * @param subdomainName The subdomain name to use. + * @param type The Type of the resource. + * @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 CheckDomainAvailabilityResultInner object if successful. + */ + public CheckDomainAvailabilityResultInner checkDomainAvailability(String subdomainName, String type) { + return checkDomainAvailabilityWithServiceResponseAsync(subdomainName, type).toBlocking().single().body(); + } + + /** + * Check whether a domain is available. + * + * @param subdomainName The subdomain name to use. + * @param type The Type of the resource. + * @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 checkDomainAvailabilityAsync(String subdomainName, String type, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkDomainAvailabilityWithServiceResponseAsync(subdomainName, type), serviceCallback); + } + + /** + * Check whether a domain is available. + * + * @param subdomainName The subdomain name to use. + * @param type The Type of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckDomainAvailabilityResultInner object + */ + public Observable checkDomainAvailabilityAsync(String subdomainName, String type) { + return checkDomainAvailabilityWithServiceResponseAsync(subdomainName, type).map(new Func1, CheckDomainAvailabilityResultInner>() { + @Override + public CheckDomainAvailabilityResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check whether a domain is available. + * + * @param subdomainName The subdomain name to use. + * @param type The Type of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckDomainAvailabilityResultInner object + */ + public Observable> checkDomainAvailabilityWithServiceResponseAsync(String subdomainName, String type) { + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (subdomainName == null) { + throw new IllegalArgumentException("Parameter subdomainName is required and cannot be null."); + } + if (type == null) { + throw new IllegalArgumentException("Parameter type is required and cannot be null."); + } + CheckDomainAvailabilityParameter parameters = new CheckDomainAvailabilityParameter(); + parameters.withSubdomainName(subdomainName); + parameters.withType(type); + return service.checkDomainAvailability(this.subscriptionId(), this.apiVersion(), this.acceptLanguage(), parameters, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkDomainAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkDomainAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + } diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesManager.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesManager.java index f0eaa535088c..ae833c978ac3 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesManager.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesManager.java @@ -19,7 +19,6 @@ import com.microsoft.azure.management.cognitiveservices.v2017_04_18.Accounts; import com.microsoft.azure.management.cognitiveservices.v2017_04_18.ResourceSkus; import com.microsoft.azure.management.cognitiveservices.v2017_04_18.Operations; -import com.microsoft.azure.management.cognitiveservices.v2017_04_18.CheckSkuAvailabilitys; import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; import com.microsoft.azure.arm.resources.implementation.ManagerCore; @@ -30,7 +29,6 @@ public final class CognitiveServicesManager extends ManagerCore> listNextInnerPageAsync(String nextLink) { - if (nextLink == null) { - Observable.empty(); - } - OperationsInner client = this.inner(); - return client.listNextAsync(nextLink) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return Observable.just(page).concatWith(listNextInnerPageAsync(page.nextPageLink())); - } - }); - } @Override public Observable listAsync() { OperationsInner client = this.inner(); return client.listAsync() - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return listNextInnerPageAsync(page.nextPageLink()); - } - }) .flatMapIterable(new Func1, Iterable>() { @Override public Iterable call(Page page) { return page.items(); } - }) + }) .map(new Func1() { @Override public OperationEntity call(OperationEntityInner inner) { return new OperationEntityImpl(inner, manager()); } - }); + }); } } diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/ResourceSkuInner.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/ResourceSkuInner.java index 909de81a52b0..91e1c829cf21 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/ResourceSkuInner.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/ResourceSkuInner.java @@ -54,7 +54,7 @@ public class ResourceSkuInner { private List restrictions; /** - * Get the resourceType value. + * Get the type of resource the SKU applies to. * * @return the resourceType value */ @@ -63,7 +63,7 @@ public String resourceType() { } /** - * Get the name value. + * Get the name of SKU. * * @return the name value */ @@ -72,7 +72,7 @@ public String name() { } /** - * Get the tier value. + * Get specifies the tier of Cognitive Services account. * * @return the tier value */ @@ -81,7 +81,7 @@ public String tier() { } /** - * Get the kind value. + * Get the Kind of resources that are supported in this SKU. * * @return the kind value */ @@ -90,7 +90,7 @@ public String kind() { } /** - * Get the locations value. + * Get the set of locations that the SKU is available. * * @return the locations value */ @@ -99,7 +99,7 @@ public List locations() { } /** - * Get the restrictions value. + * Get the restrictions because of which SKU cannot be used. This is empty if there are no restrictions. * * @return the restrictions value */ diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/ResourceSkusImpl.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/ResourceSkusImpl.java index f0b7e756f3e2..7f5910f09e49 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/ResourceSkusImpl.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/ResourceSkusImpl.java @@ -28,41 +28,22 @@ public CognitiveServicesManager manager() { return this.manager; } - private Observable> listNextInnerPageAsync(String nextLink) { - if (nextLink == null) { - Observable.empty(); - } - ResourceSkusInner client = this.inner(); - return client.listNextAsync(nextLink) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return Observable.just(page).concatWith(listNextInnerPageAsync(page.nextPageLink())); - } - }); - } @Override public Observable listAsync() { ResourceSkusInner client = this.inner(); return client.listAsync() - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return listNextInnerPageAsync(page.nextPageLink()); - } - }) .flatMapIterable(new Func1, Iterable>() { @Override public Iterable call(Page page) { return page.items(); } - }) + }) .map(new Func1() { @Override public ResourceSku call(ResourceSkuInner inner) { return new ResourceSkuImpl(inner, manager()); } - }); + }); } } diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/UsagesResultInner.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/UsagesResultInner.java index faa532dc3b21..5eefb86d8298 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/UsagesResultInner.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/UsagesResultInner.java @@ -23,7 +23,7 @@ public class UsagesResultInner { private List value; /** - * Get the value value. + * Get the list of usages for Cognitive Service account. * * @return the value value */