diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/CheckSkuAvailabilityParameter.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/CheckSkuAvailabilityParameter.java new file mode 100644 index 00000000000..534bfae78b8 --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/CheckSkuAvailabilityParameter.java @@ -0,0 +1,102 @@ +/** + * 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.advisor; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Check SKU availability parameter. + */ +public class CheckSkuAvailabilityParameter { + /** + * The SKU of the resource. + */ + @JsonProperty(value = "skus", required = true) + 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'. + */ + @JsonProperty(value = "kind", required = true) + private Kind kind; + + /** + * The Type of the resource. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Get the skus value. + * + * @return the skus value + */ + public List skus() { + return this.skus; + } + + /** + * Set the skus value. + * + * @param skus the skus value to set + * @return the CheckSkuAvailabilityParameter object itself. + */ + public CheckSkuAvailabilityParameter withSkus(List skus) { + this.skus = skus; + return this; + } + + /** + * Get the kind value. + * + * @return the kind value + */ + public Kind kind() { + return this.kind; + } + + /** + * Set the kind value. + * + * @param kind the kind value to set + * @return the CheckSkuAvailabilityParameter object itself. + */ + public CheckSkuAvailabilityParameter withKind(Kind kind) { + this.kind = kind; + return this; + } + + /** + * Get the type value. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type value. + * + * @param type the type value to set + * @return the CheckSkuAvailabilityParameter object itself. + */ + public CheckSkuAvailabilityParameter withType(String type) { + this.type = type; + return this; + } + +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/CheckSkuAvailabilityResult.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/CheckSkuAvailabilityResult.java new file mode 100644 index 00000000000..8e906310205 --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/CheckSkuAvailabilityResult.java @@ -0,0 +1,180 @@ +/** + * 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.advisor; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Check SKU availability result. + */ +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'. + */ + @JsonProperty(value = "kind") + private Kind kind; + + /** + * The Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * The SKU of Cognitive Services account. Possible values include: 'F0', + * 'P0', 'P1', 'P2', 'S0', 'S1', 'S2', 'S3', 'S4', 'S5', 'S6'. + */ + @JsonProperty(value = "skuName") + private SkuName skuName; + + /** + * Indicates the given SKU is available or not. + */ + @JsonProperty(value = "skuAvailable") + private Boolean skuAvailable; + + /** + * Reason why the SKU is not available. + */ + @JsonProperty(value = "reason") + private String reason; + + /** + * Additional error message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the kind value. + * + * @return the kind value + */ + public Kind kind() { + return this.kind; + } + + /** + * Set the kind value. + * + * @param kind the kind value to set + * @return the CheckSkuAvailabilityResult object itself. + */ + public CheckSkuAvailabilityResult withKind(Kind kind) { + this.kind = kind; + return this; + } + + /** + * Get the type value. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type value. + * + * @param type the type value to set + * @return the CheckSkuAvailabilityResult object itself. + */ + public CheckSkuAvailabilityResult withType(String type) { + this.type = type; + return this; + } + + /** + * Get the skuName value. + * + * @return the skuName value + */ + public SkuName skuName() { + return this.skuName; + } + + /** + * Set the skuName value. + * + * @param skuName the skuName value to set + * @return the CheckSkuAvailabilityResult object itself. + */ + public CheckSkuAvailabilityResult withSkuName(SkuName skuName) { + this.skuName = skuName; + return this; + } + + /** + * Get the skuAvailable value. + * + * @return the skuAvailable value + */ + public Boolean skuAvailable() { + return this.skuAvailable; + } + + /** + * Set the skuAvailable value. + * + * @param skuAvailable the skuAvailable value to set + * @return the CheckSkuAvailabilityResult object itself. + */ + public CheckSkuAvailabilityResult withSkuAvailable(Boolean skuAvailable) { + this.skuAvailable = skuAvailable; + return this; + } + + /** + * Get the reason value. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason value. + * + * @param reason the reason value to set + * @return the CheckSkuAvailabilityResult object itself. + */ + public CheckSkuAvailabilityResult withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the CheckSkuAvailabilityResult object itself. + */ + public CheckSkuAvailabilityResult withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/CognitiveServicesAccountUpdateParameters.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/CognitiveServicesAccountUpdateParameters.java new file mode 100644 index 00000000000..dc5f9aefdde --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/CognitiveServicesAccountUpdateParameters.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.advisor; + +import com.microsoft.azure.management.advisor.implementation.SkuInner; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters to provide for the account. + */ +public class CognitiveServicesAccountUpdateParameters { + /** + * Gets or sets the SKU of the resource. + */ + @JsonProperty(value = "sku") + private SkuInner sku; + + /** + * 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. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the sku value. + * + * @return the sku value + */ + public SkuInner sku() { + return this.sku; + } + + /** + * Set the sku value. + * + * @param sku the sku value to set + * @return the CognitiveServicesAccountUpdateParameters object itself. + */ + public CognitiveServicesAccountUpdateParameters withSku(SkuInner sku) { + this.sku = sku; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the CognitiveServicesAccountUpdateParameters object itself. + */ + public CognitiveServicesAccountUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/CognitiveServicesResourceAndSku.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/CognitiveServicesResourceAndSku.java new file mode 100644 index 00000000000..18029c25113 --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/CognitiveServicesResourceAndSku.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.advisor; + +import com.microsoft.azure.management.advisor.implementation.SkuInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cognitive Services resource type and SKU. + */ +public class CognitiveServicesResourceAndSku { + /** + * Resource Namespace and Type. + */ + @JsonProperty(value = "resourceType") + private String resourceType; + + /** + * The SKU of Cognitive Services account. + */ + @JsonProperty(value = "sku") + private SkuInner sku; + + /** + * Get the resourceType value. + * + * @return the resourceType value + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType value. + * + * @param resourceType the resourceType value to set + * @return the CognitiveServicesResourceAndSku object itself. + */ + public CognitiveServicesResourceAndSku withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get the sku value. + * + * @return the sku value + */ + public SkuInner sku() { + return this.sku; + } + + /** + * Set the sku value. + * + * @param sku the sku value to set + * @return the CognitiveServicesResourceAndSku object itself. + */ + public CognitiveServicesResourceAndSku withSku(SkuInner sku) { + this.sku = sku; + return this; + } + +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/Error.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/Error.java new file mode 100644 index 00000000000..b855bb89b26 --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/Error.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.advisor; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cognitive Services error object. + */ +public class Error { + /** + * The error body. + */ + @JsonProperty(value = "error") + private ErrorBody error; + + /** + * Get the error value. + * + * @return the error value + */ + public ErrorBody error() { + return this.error; + } + + /** + * Set the error value. + * + * @param error the error value to set + * @return the Error object itself. + */ + public Error withError(ErrorBody error) { + this.error = error; + return this; + } + +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/ErrorBody.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/ErrorBody.java new file mode 100644 index 00000000000..f2ea0f56c6f --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/ErrorBody.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.advisor; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cognitive Services error body. + */ +public class ErrorBody { + /** + * error code. + */ + @JsonProperty(value = "code", required = true) + private String code; + + /** + * error message. + */ + @JsonProperty(value = "message", required = true) + private String message; + + /** + * Get the code value. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the code value. + * + * @param code the code value to set + * @return the ErrorBody object itself. + */ + public ErrorBody withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the ErrorBody object itself. + */ + public ErrorBody withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/ErrorException.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/ErrorException.java new file mode 100644 index 00000000000..65b1a112615 --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/ErrorException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.advisor; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/KeyName.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/KeyName.java new file mode 100644 index 00000000000..fa7466e4ca3 --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/KeyName.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.advisor; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for KeyName. + */ +public enum KeyName { + /** Enum value Key1. */ + KEY1("Key1"), + + /** Enum value Key2. */ + KEY2("Key2"); + + /** The actual serialized value for a KeyName instance. */ + private String value; + + KeyName(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a KeyName instance. + * + * @param value the serialized value to parse. + * @return the parsed KeyName object, or null if unable to parse. + */ + @JsonCreator + public static KeyName fromString(String value) { + KeyName[] items = KeyName.values(); + for (KeyName item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/Kind.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/Kind.java new file mode 100644 index 00000000000..9338af0cb10 --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/Kind.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.advisor; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Kind. + */ +public final class Kind extends ExpandableStringEnum { + /** Static value Bing.Autosuggest.v7 for Kind. */ + public static final Kind BING_AUTOSUGGESTV7 = fromString("Bing.Autosuggest.v7"); + + /** Static value Bing.CustomSearch for Kind. */ + public static final Kind BING_CUSTOM_SEARCH = fromString("Bing.CustomSearch"); + + /** Static value Bing.Search.v7 for Kind. */ + public static final Kind BING_SEARCHV7 = fromString("Bing.Search.v7"); + + /** Static value Bing.Speech for Kind. */ + public static final Kind BING_SPEECH = fromString("Bing.Speech"); + + /** Static value Bing.SpellCheck.v7 for Kind. */ + public static final Kind BING_SPELL_CHECKV7 = fromString("Bing.SpellCheck.v7"); + + /** Static value ComputerVision for Kind. */ + public static final Kind COMPUTER_VISION = fromString("ComputerVision"); + + /** Static value ContentModerator for Kind. */ + public static final Kind CONTENT_MODERATOR = fromString("ContentModerator"); + + /** Static value CustomSpeech for Kind. */ + public static final Kind CUSTOM_SPEECH = fromString("CustomSpeech"); + + /** Static value CustomVision.Prediction for Kind. */ + public static final Kind CUSTOM_VISION_PREDICTION = fromString("CustomVision.Prediction"); + + /** Static value CustomVision.Training for Kind. */ + public static final Kind CUSTOM_VISION_TRAINING = fromString("CustomVision.Training"); + + /** Static value Emotion for Kind. */ + public static final Kind EMOTION = fromString("Emotion"); + + /** Static value Face for Kind. */ + public static final Kind FACE = fromString("Face"); + + /** Static value LUIS for Kind. */ + public static final Kind LUIS = fromString("LUIS"); + + /** Static value QnAMaker for Kind. */ + public static final Kind QN_AMAKER = fromString("QnAMaker"); + + /** Static value SpeakerRecognition for Kind. */ + public static final Kind SPEAKER_RECOGNITION = fromString("SpeakerRecognition"); + + /** Static value SpeechTranslation for Kind. */ + public static final Kind SPEECH_TRANSLATION = fromString("SpeechTranslation"); + + /** Static value TextAnalytics for Kind. */ + public static final Kind TEXT_ANALYTICS = fromString("TextAnalytics"); + + /** Static value TextTranslation for Kind. */ + public static final Kind TEXT_TRANSLATION = fromString("TextTranslation"); + + /** Static value WebLM for Kind. */ + public static final Kind WEB_LM = fromString("WebLM"); + + /** + * Creates or finds a Kind from its string representation. + * @param name a name to look for + * @return the corresponding Kind + */ + @JsonCreator + public static Kind fromString(String name) { + return fromString(name, Kind.class); + } + + /** + * @return known Kind values + */ + public static Collection values() { + return values(Kind.class); + } +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/MetricName.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/MetricName.java new file mode 100644 index 00000000000..1c453528c10 --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/MetricName.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.advisor; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A metric name. + */ +public class MetricName { + /** + * The name of the metric. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * The friendly name of the metric. + */ + @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY) + private String localizedValue; + + /** + * Get the value value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Get the localizedValue value. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/OperationDisplayInfo.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/OperationDisplayInfo.java new file mode 100644 index 00000000000..0065e2d11bb --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/OperationDisplayInfo.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.advisor; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The operation supported by Cognitive Services. + */ +public class OperationDisplayInfo { + /** + * The description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * The action that users can perform, based on their permission level. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Service provider: Microsoft Cognitive Services. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Resource on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Get the description value. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description value. + * + * @param description the description value to set + * @return the OperationDisplayInfo object itself. + */ + public OperationDisplayInfo withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the operation value. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation value. + * + * @param operation the operation value to set + * @return the OperationDisplayInfo object itself. + */ + public OperationDisplayInfo withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the provider value. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider value. + * + * @param provider the provider value to set + * @return the OperationDisplayInfo object itself. + */ + public OperationDisplayInfo withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource value. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource value. + * + * @param resource the resource value to set + * @return the OperationDisplayInfo object itself. + */ + public OperationDisplayInfo withResource(String resource) { + this.resource = resource; + return this; + } + +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/ProvisioningState.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/ProvisioningState.java new file mode 100644 index 00000000000..4e0f9d4f2d9 --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/ProvisioningState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.advisor; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProvisioningState. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value ResolvingDNS for ProvisioningState. */ + public static final ProvisioningState RESOLVING_DNS = fromString("ResolvingDNS"); + + /** Static value Moving for ProvisioningState. */ + public static final ProvisioningState MOVING = fromString("Moving"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding ProvisioningState + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * @return known ProvisioningState values + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/QuotaUsageStatus.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/QuotaUsageStatus.java new file mode 100644 index 00000000000..716616449f5 --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/QuotaUsageStatus.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.advisor; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for QuotaUsageStatus. + */ +public final class QuotaUsageStatus extends ExpandableStringEnum { + /** Static value Included for QuotaUsageStatus. */ + public static final QuotaUsageStatus INCLUDED = fromString("Included"); + + /** Static value Blocked for QuotaUsageStatus. */ + public static final QuotaUsageStatus BLOCKED = fromString("Blocked"); + + /** Static value InOverage for QuotaUsageStatus. */ + public static final QuotaUsageStatus IN_OVERAGE = fromString("InOverage"); + + /** Static value Unknown for QuotaUsageStatus. */ + public static final QuotaUsageStatus UNKNOWN = fromString("Unknown"); + + /** + * Creates or finds a QuotaUsageStatus from its string representation. + * @param name a name to look for + * @return the corresponding QuotaUsageStatus + */ + @JsonCreator + public static QuotaUsageStatus fromString(String name) { + return fromString(name, QuotaUsageStatus.class); + } + + /** + * @return known QuotaUsageStatus values + */ + public static Collection values() { + return values(QuotaUsageStatus.class); + } +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/RegenerateKeyParameters.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/RegenerateKeyParameters.java new file mode 100644 index 00000000000..dfa02e07c37 --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/RegenerateKeyParameters.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.advisor; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Regenerate key parameters. + */ +public class RegenerateKeyParameters { + /** + * key name to generate (Key1|Key2). Possible values include: 'Key1', + * 'Key2'. + */ + @JsonProperty(value = "keyName", required = true) + private KeyName keyName; + + /** + * Get the keyName value. + * + * @return the keyName value + */ + public KeyName keyName() { + return this.keyName; + } + + /** + * Set the keyName value. + * + * @param keyName the keyName value to set + * @return the RegenerateKeyParameters object itself. + */ + public RegenerateKeyParameters withKeyName(KeyName keyName) { + this.keyName = keyName; + return this; + } + +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/SkuName.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/SkuName.java new file mode 100644 index 00000000000..91583b756a3 --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/SkuName.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.advisor; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SkuName. + */ +public final class SkuName extends ExpandableStringEnum { + /** Static value F0 for SkuName. */ + public static final SkuName F0 = fromString("F0"); + + /** Static value P0 for SkuName. */ + public static final SkuName P0 = fromString("P0"); + + /** Static value P1 for SkuName. */ + public static final SkuName P1 = fromString("P1"); + + /** Static value P2 for SkuName. */ + public static final SkuName P2 = fromString("P2"); + + /** Static value S0 for SkuName. */ + public static final SkuName S0 = fromString("S0"); + + /** Static value S1 for SkuName. */ + public static final SkuName S1 = fromString("S1"); + + /** Static value S2 for SkuName. */ + public static final SkuName S2 = fromString("S2"); + + /** Static value S3 for SkuName. */ + public static final SkuName S3 = fromString("S3"); + + /** Static value S4 for SkuName. */ + public static final SkuName S4 = fromString("S4"); + + /** Static value S5 for SkuName. */ + public static final SkuName S5 = fromString("S5"); + + /** Static value S6 for SkuName. */ + public static final SkuName S6 = fromString("S6"); + + /** + * Creates or finds a SkuName from its string representation. + * @param name a name to look for + * @return the corresponding SkuName + */ + @JsonCreator + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** + * @return known SkuName values + */ + public static Collection values() { + return values(SkuName.class); + } +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/SkuTier.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/SkuTier.java new file mode 100644 index 00000000000..22ee7297906 --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/SkuTier.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.advisor; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for SkuTier. + */ +public enum SkuTier { + /** Enum value Free. */ + FREE("Free"), + + /** Enum value Standard. */ + STANDARD("Standard"), + + /** Enum value Premium. */ + PREMIUM("Premium"); + + /** The actual serialized value for a SkuTier instance. */ + private String value; + + SkuTier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SkuTier instance. + * + * @param value the serialized value to parse. + * @return the parsed SkuTier object, or null if unable to parse. + */ + @JsonCreator + public static SkuTier fromString(String value) { + SkuTier[] items = SkuTier.values(); + for (SkuTier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/UnitType.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/UnitType.java new file mode 100644 index 00000000000..d28e0c54ce4 --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/UnitType.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.advisor; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for UnitType. + */ +public final class UnitType extends ExpandableStringEnum { + /** Static value Count for UnitType. */ + public static final UnitType COUNT = fromString("Count"); + + /** Static value Bytes for UnitType. */ + public static final UnitType BYTES = fromString("Bytes"); + + /** Static value Seconds for UnitType. */ + public static final UnitType SECONDS = fromString("Seconds"); + + /** Static value Percent for UnitType. */ + public static final UnitType PERCENT = fromString("Percent"); + + /** Static value CountPerSecond for UnitType. */ + public static final UnitType COUNT_PER_SECOND = fromString("CountPerSecond"); + + /** Static value BytesPerSecond for UnitType. */ + public static final UnitType BYTES_PER_SECOND = fromString("BytesPerSecond"); + + /** Static value Milliseconds for UnitType. */ + public static final UnitType MILLISECONDS = fromString("Milliseconds"); + + /** + * Creates or finds a UnitType from its string representation. + * @param name a name to look for + * @return the corresponding UnitType + */ + @JsonCreator + public static UnitType fromString(String name) { + return fromString(name, UnitType.class); + } + + /** + * @return known UnitType values + */ + public static Collection values() { + return values(UnitType.class); + } +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/Usage.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/Usage.java new file mode 100644 index 00000000000..5243dd1488a --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/Usage.java @@ -0,0 +1,147 @@ +/** + * 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.advisor; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The usage data for a usage request. + */ +public class Usage { + /** + * The unit of the metric. Possible values include: 'Count', 'Bytes', + * 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', + * 'Milliseconds'. + */ + @JsonProperty(value = "unit") + private UnitType unit; + + /** + * The name information for the metric. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private MetricName name; + + /** + * The quota period used to summarize the usage values. + */ + @JsonProperty(value = "quotaPeriod", access = JsonProperty.Access.WRITE_ONLY) + private String quotaPeriod; + + /** + * Maximum value for this metric. + */ + @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) + private Double limit; + + /** + * Current value for this metric. + */ + @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) + private Double currentValue; + + /** + * Next reset time for current quota. + */ + @JsonProperty(value = "nextResetTime", access = JsonProperty.Access.WRITE_ONLY) + private String nextResetTime; + + /** + * Cognitive Services account quota usage status. Possible values include: + * 'Included', 'Blocked', 'InOverage', 'Unknown'. + */ + @JsonProperty(value = "status") + private QuotaUsageStatus status; + + /** + * Get the unit value. + * + * @return the unit value + */ + public UnitType unit() { + return this.unit; + } + + /** + * Set the unit value. + * + * @param unit the unit value to set + * @return the Usage object itself. + */ + public Usage withUnit(UnitType unit) { + this.unit = unit; + return this; + } + + /** + * Get the name value. + * + * @return the name value + */ + public MetricName name() { + return this.name; + } + + /** + * Get the quotaPeriod value. + * + * @return the quotaPeriod value + */ + public String quotaPeriod() { + return this.quotaPeriod; + } + + /** + * Get the limit value. + * + * @return the limit value + */ + public Double limit() { + return this.limit; + } + + /** + * Get the currentValue value. + * + * @return the currentValue value + */ + public Double currentValue() { + return this.currentValue; + } + + /** + * Get the nextResetTime value. + * + * @return the nextResetTime value + */ + public String nextResetTime() { + return this.nextResetTime; + } + + /** + * Get the status value. + * + * @return the status value + */ + public QuotaUsageStatus status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Usage object itself. + */ + public Usage withStatus(QuotaUsageStatus status) { + this.status = status; + return this; + } + +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/AccountsInner.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/AccountsInner.java new file mode 100644 index 00000000000..d0a0c64e381 --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/AccountsInner.java @@ -0,0 +1,1370 @@ +/** + * 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.advisor.implementation; + +import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsGet; +import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsDelete; +import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.advisor.CognitiveServicesAccountUpdateParameters; +import com.microsoft.azure.management.advisor.ErrorException; +import com.microsoft.azure.management.advisor.KeyName; +import com.microsoft.azure.management.advisor.RegenerateKeyParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Accounts. + */ +public class AccountsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private AccountsService service; + /** The service client containing this operation class. */ + private CognitiveServicesManagementClientImpl client; + + /** + * Initializes an instance of AccountsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AccountsInner(Retrofit retrofit, CognitiveServicesManagementClientImpl client) { + this.service = retrofit.create(AccountsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Accounts to be + * used by Retrofit to perform actually REST calls. + */ + interface AccountsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.advisor.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 CognitiveServicesAccountCreateParametersInner parameters, @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.advisor.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); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.advisor.Accounts delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @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.advisor.Accounts getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @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.advisor.Accounts listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @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.advisor.Accounts list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/accounts") + Observable> list(@Path("subscriptionId") String subscriptionId, @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.advisor.Accounts listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/listKeys") + Observable> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @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.advisor.Accounts regenerateKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/regenerateKey") + Observable> regenerateKey(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RegenerateKeyParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.advisor.Accounts listSkus" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/skus") + Observable> listSkus(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @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.advisor.Accounts getUsages" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/usages") + Observable> getUsages(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$filter") String filter, @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.advisor.Accounts listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @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.advisor.Accounts listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the keys for developer to access intelligent APIs. It's also the resource type for billing. + * + * @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. + * @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, CognitiveServicesAccountCreateParametersInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); + } + + /** + * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the keys for developer to access intelligent APIs. It's also the resource type for billing. + * + * @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 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, CognitiveServicesAccountCreateParametersInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the keys for developer to access intelligent APIs. It's also the resource type for billing. + * + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CognitiveServicesAccountInner object + */ + public Observable createAsync(String resourceGroupName, String accountName, CognitiveServicesAccountCreateParametersInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, CognitiveServicesAccountInner>() { + @Override + public CognitiveServicesAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the keys for developer to access intelligent APIs. It's also the resource type for billing. + * + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CognitiveServicesAccountInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, CognitiveServicesAccountCreateParametersInner parameters) { + 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * 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. + * @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) { + return updateWithServiceResponseAsync(resourceGroupName, accountName).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 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, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName), 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. + * @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>() { + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CognitiveServicesAccountInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final SkuInner 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, SkuInner 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, SkuInner 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, SkuInner 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, SkuInner 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 (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()) + .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); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Deletes a Cognitive Services account from the resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param accountName The name of Cognitive Services 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 + */ + public void delete(String resourceGroupName, String accountName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Deletes a Cognitive Services account from the resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param accountName The name of Cognitive Services 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 deleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Deletes a Cognitive Services account from the resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a Cognitive Services account from the resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Returns a Cognitive Services account specified by the parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param accountName The name of Cognitive Services 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 getByResourceGroup(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Returns a Cognitive Services account specified by the parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param accountName The name of Cognitive Services 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 getByResourceGroupAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Returns a Cognitive Services account specified by the parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CognitiveServicesAccountInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, CognitiveServicesAccountInner>() { + @Override + public CognitiveServicesAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns a Cognitive Services account specified by the parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CognitiveServicesAccountInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String accountName) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Returns all the resources of a particular type belonging to a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 PagedList<CognitiveServicesAccountInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Returns all the resources of a particular type belonging to a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @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> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Returns all the resources of a particular type belonging to a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CognitiveServicesAccountInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns all the resources of a particular type belonging to a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CognitiveServicesAccountInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Returns all the resources of a particular type belonging to a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CognitiveServicesAccountInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Returns all the resources of a particular type belonging to a subscription. + * + * @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 PagedList<CognitiveServicesAccountInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Returns all the resources of a particular type belonging to a subscription. + * + * @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> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Returns all the resources of a particular type belonging to a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CognitiveServicesAccountInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns all the resources of a particular type belonging to a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CognitiveServicesAccountInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Returns all the resources of a particular type belonging to a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CognitiveServicesAccountInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + 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."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists the account keys for the specified Cognitive Services account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param accountName The name of Cognitive Services 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 CognitiveServicesAccountKeysInner object if successful. + */ + public CognitiveServicesAccountKeysInner listKeys(String resourceGroupName, String accountName) { + return listKeysWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Lists the account keys for the specified 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 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 listKeysAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Lists the account keys for the specified Cognitive Services account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CognitiveServicesAccountKeysInner object + */ + public Observable listKeysAsync(String resourceGroupName, String accountName) { + return listKeysWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, CognitiveServicesAccountKeysInner>() { + @Override + public CognitiveServicesAccountKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the account keys for the specified Cognitive Services account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CognitiveServicesAccountKeysInner object + */ + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String accountName) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listKeys(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listKeysDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Regenerates the specified account key for the specified 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 keyName key name to generate (Key1|Key2). Possible values include: 'Key1', 'Key2' + * @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 CognitiveServicesAccountKeysInner object if successful. + */ + public CognitiveServicesAccountKeysInner regenerateKey(String resourceGroupName, String accountName, KeyName keyName) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyName).toBlocking().single().body(); + } + + /** + * Regenerates the specified account key for the specified 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 keyName key name to generate (Key1|Key2). Possible values include: 'Key1', 'Key2' + * @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 regenerateKeyAsync(String resourceGroupName, String accountName, KeyName keyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyName), serviceCallback); + } + + /** + * Regenerates the specified account key for the specified 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 keyName key name to generate (Key1|Key2). Possible values include: 'Key1', 'Key2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CognitiveServicesAccountKeysInner object + */ + public Observable regenerateKeyAsync(String resourceGroupName, String accountName, KeyName keyName) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyName).map(new Func1, CognitiveServicesAccountKeysInner>() { + @Override + public CognitiveServicesAccountKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates the specified account key for the specified 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 keyName key name to generate (Key1|Key2). Possible values include: 'Key1', 'Key2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CognitiveServicesAccountKeysInner object + */ + public Observable> regenerateKeyWithServiceResponseAsync(String resourceGroupName, String accountName, KeyName keyName) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + RegenerateKeyParameters parameters = new RegenerateKeyParameters(); + parameters.withKeyName(keyName); + return service.regenerateKey(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 = regenerateKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateKeyDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * List available SKUs for the requested Cognitive Services account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param accountName The name of Cognitive Services 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 CognitiveServicesAccountEnumerateSkusResultInner object if successful. + */ + public CognitiveServicesAccountEnumerateSkusResultInner listSkus(String resourceGroupName, String accountName) { + return listSkusWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * List available SKUs for the requested 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 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 listSkusAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listSkusWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * List available SKUs for the requested Cognitive Services account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CognitiveServicesAccountEnumerateSkusResultInner object + */ + public Observable listSkusAsync(String resourceGroupName, String accountName) { + return listSkusWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, CognitiveServicesAccountEnumerateSkusResultInner>() { + @Override + public CognitiveServicesAccountEnumerateSkusResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List available SKUs for the requested Cognitive Services account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CognitiveServicesAccountEnumerateSkusResultInner object + */ + public Observable> listSkusWithServiceResponseAsync(String resourceGroupName, String accountName) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listSkus(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listSkusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listSkusDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get usages for the requested Cognitive Services account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param accountName The name of Cognitive Services 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 UsagesResultInner object if successful. + */ + public UsagesResultInner getUsages(String resourceGroupName, String accountName) { + return getUsagesWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Get usages for the requested 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 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 getUsagesAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getUsagesWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Get usages for the requested Cognitive Services account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UsagesResultInner object + */ + public Observable getUsagesAsync(String resourceGroupName, String accountName) { + return getUsagesWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, UsagesResultInner>() { + @Override + public UsagesResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get usages for the requested Cognitive Services account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UsagesResultInner object + */ + public Observable> getUsagesWithServiceResponseAsync(String resourceGroupName, String accountName) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getUsages(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.filter(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getUsagesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getUsagesDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Returns all the resources of a particular type belonging to a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<CognitiveServicesAccountInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Returns all the resources of a particular type belonging to a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Returns all the resources of a particular type belonging to a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CognitiveServicesAccountInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns all the resources of a particular type belonging to a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CognitiveServicesAccountInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Returns all the resources of a particular type belonging to a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CognitiveServicesAccountInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Returns all the resources of a particular type belonging to a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<CognitiveServicesAccountInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Returns all the resources of a particular type belonging to a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Returns all the resources of a particular type belonging to a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CognitiveServicesAccountInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns all the resources of a particular type belonging to a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CognitiveServicesAccountInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Returns all the resources of a particular type belonging to a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CognitiveServicesAccountInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/CheckSkuAvailabilityResultListInner.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/CheckSkuAvailabilityResultListInner.java new file mode 100644 index 00000000000..53568a12443 --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/CheckSkuAvailabilityResultListInner.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.advisor.implementation; + +import java.util.List; +import com.microsoft.azure.management.advisor.CheckSkuAvailabilityResult; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Check SKU availability result list. + */ +public class CheckSkuAvailabilityResultListInner { + /** + * Check SKU availability result list. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the CheckSkuAvailabilityResultListInner object itself. + */ + public CheckSkuAvailabilityResultListInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/CheckSkuAvailabilitysInner.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/CheckSkuAvailabilitysInner.java new file mode 100644 index 00000000000..a34f5669a0d --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/CheckSkuAvailabilitysInner.java @@ -0,0 +1,171 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.advisor.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.advisor.CheckSkuAvailabilityParameter; +import com.microsoft.azure.management.advisor.Kind; +import com.microsoft.azure.management.advisor.SkuName; +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; + +/** + * An instance of this class provides access to all the operations defined + * in CheckSkuAvailabilitys. + */ +public class CheckSkuAvailabilitysInner { + /** The Retrofit service to perform REST calls. */ + private CheckSkuAvailabilitysService service; + /** The service client containing this operation class. */ + private CognitiveServicesManagementClientImpl client; + + /** + * Initializes an instance of CheckSkuAvailabilitysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public CheckSkuAvailabilitysInner(Retrofit retrofit, CognitiveServicesManagementClientImpl client) { + this.service = retrofit.create(CheckSkuAvailabilitysService.class); + this.client = client; + } + + /** + * The interface defining all the services for CheckSkuAvailabilitys to be + * used by Retrofit to perform actually REST calls. + */ + interface CheckSkuAvailabilitysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.advisor.CheckSkuAvailabilitys list" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/checkSkuAvailability") + Observable> list(@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); + + } + + /** + * Check available SKUs. + * + * @param location Resource location. + * @param skus The SKU of the resource. + * @param kind 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' + * @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 list(String location, List skus, Kind kind, String type) { + return listWithServiceResponseAsync(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. 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' + * @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 listAsync(String location, List skus, Kind kind, String type, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(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. 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' + * @param type The Type of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckSkuAvailabilityResultListInner object + */ + public Observable listAsync(String location, List skus, Kind kind, String type) { + return listWithServiceResponseAsync(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. 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' + * @param type The Type of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckSkuAvailabilityResultListInner object + */ + public Observable> listWithServiceResponseAsync(String location, List skus, Kind kind, String type) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.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.list(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/CognitiveServicesAccountCreateParametersInner.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/CognitiveServicesAccountCreateParametersInner.java new file mode 100644 index 00000000000..f4b2df77cd1 --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/CognitiveServicesAccountCreateParametersInner.java @@ -0,0 +1,163 @@ +/** + * 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.advisor.implementation; + +import com.microsoft.azure.management.advisor.Kind; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters to provide for the account. + */ +public class CognitiveServicesAccountCreateParametersInner { + /** + * Required. Gets or sets the SKU of the resource. + */ + @JsonProperty(value = "sku", required = true) + private SkuInner sku; + + /** + * Required. Gets or sets 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'. + */ + @JsonProperty(value = "kind", required = true) + private Kind kind; + + /** + * Required. Gets or sets the location of the resource. This will be one of + * the supported and registered Azure Geo Regions (e.g. West US, East US, + * Southeast Asia, etc.). The geo region of a resource cannot be changed + * once it is created, but if an identical geo region is specified on + * update the request will succeed. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * 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. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Must exist in the request. Must be an empty object. Must not be null. + */ + @JsonProperty(value = "properties", required = true) + private Object properties; + + /** + * Get the sku value. + * + * @return the sku value + */ + public SkuInner sku() { + return this.sku; + } + + /** + * Set the sku value. + * + * @param sku the sku value to set + * @return the CognitiveServicesAccountCreateParametersInner object itself. + */ + public CognitiveServicesAccountCreateParametersInner withSku(SkuInner sku) { + this.sku = sku; + return this; + } + + /** + * Get the kind value. + * + * @return the kind value + */ + public Kind kind() { + return this.kind; + } + + /** + * Set the kind value. + * + * @param kind the kind value to set + * @return the CognitiveServicesAccountCreateParametersInner object itself. + */ + public CognitiveServicesAccountCreateParametersInner withKind(Kind kind) { + this.kind = kind; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the CognitiveServicesAccountCreateParametersInner object itself. + */ + public CognitiveServicesAccountCreateParametersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the CognitiveServicesAccountCreateParametersInner object itself. + */ + public CognitiveServicesAccountCreateParametersInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties value. + * + * @return the properties value + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the CognitiveServicesAccountCreateParametersInner object itself. + */ + public CognitiveServicesAccountCreateParametersInner withProperties(Object properties) { + this.properties = properties; + return this; + } + +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/CognitiveServicesAccountEnumerateSkusResultInner.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/CognitiveServicesAccountEnumerateSkusResultInner.java new file mode 100644 index 00000000000..a4cb78815a1 --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/CognitiveServicesAccountEnumerateSkusResultInner.java @@ -0,0 +1,34 @@ +/** + * 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.advisor.implementation; + +import java.util.List; +import com.microsoft.azure.management.advisor.CognitiveServicesResourceAndSku; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of cognitive services accounts operation response. + */ +public class CognitiveServicesAccountEnumerateSkusResultInner { + /** + * Gets the list of Cognitive Services accounts and their properties. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/CognitiveServicesAccountInner.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/CognitiveServicesAccountInner.java new file mode 100644 index 00000000000..7bed4b3c5da --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/CognitiveServicesAccountInner.java @@ -0,0 +1,270 @@ +/** + * 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.advisor.implementation; + +import com.microsoft.azure.management.advisor.ProvisioningState; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Cognitive Services Account is an Azure resource representing the provisioned + * account, its type, location and SKU. + */ +@JsonFlatten +public class CognitiveServicesAccountInner { + /** + * Entity Tag. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * The id of the created account. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Type of cognitive service account. + */ + @JsonProperty(value = "kind") + private String kind; + + /** + * The location of the resource. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The name of the created account. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * 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 = "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; + + /** + * The SKU of Cognitive Services account. + */ + @JsonProperty(value = "sku") + private SkuInner sku; + + /** + * 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. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get the etag value. + * + * @return the etag value + */ + public String etag() { + return this.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 id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the kind value. + * + * @return the kind value + */ + public String kind() { + return this.kind; + } + + /** + * Set the kind value. + * + * @param kind the kind value to set + * @return the CognitiveServicesAccountInner object itself. + */ + public CognitiveServicesAccountInner withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the CognitiveServicesAccountInner object itself. + */ + public CognitiveServicesAccountInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * 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. + * + * @return the internalId value + */ + public String internalId() { + return this.internalId; + } + + /** + * Set the internalId value. + * + * @param internalId the internalId value to set + * @return the CognitiveServicesAccountInner object itself. + */ + public CognitiveServicesAccountInner withInternalId(String internalId) { + this.internalId = internalId; + return this; + } + + /** + * Get the sku value. + * + * @return the sku value + */ + public SkuInner sku() { + return this.sku; + } + + /** + * Set the sku value. + * + * @param sku the sku value to set + * @return the CognitiveServicesAccountInner object itself. + */ + public CognitiveServicesAccountInner withSku(SkuInner sku) { + this.sku = sku; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the CognitiveServicesAccountInner object itself. + */ + public CognitiveServicesAccountInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the type value. + * + * @return the type value + */ + public String type() { + return this.type; + } + +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/CognitiveServicesAccountKeysInner.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/CognitiveServicesAccountKeysInner.java new file mode 100644 index 00000000000..cc7ee13ad73 --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/CognitiveServicesAccountKeysInner.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.advisor.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The access keys for the cognitive services account. + */ +public class CognitiveServicesAccountKeysInner { + /** + * Gets the value of key 1. + */ + @JsonProperty(value = "key1") + private String key1; + + /** + * Gets the value of key 2. + */ + @JsonProperty(value = "key2") + private String key2; + + /** + * Get the key1 value. + * + * @return the key1 value + */ + public String key1() { + return this.key1; + } + + /** + * Set the key1 value. + * + * @param key1 the key1 value to set + * @return the CognitiveServicesAccountKeysInner object itself. + */ + public CognitiveServicesAccountKeysInner withKey1(String key1) { + this.key1 = key1; + return this; + } + + /** + * Get the key2 value. + * + * @return the key2 value + */ + public String key2() { + return this.key2; + } + + /** + * Set the key2 value. + * + * @param key2 the key2 value to set + * @return the CognitiveServicesAccountKeysInner object itself. + */ + public CognitiveServicesAccountKeysInner withKey2(String key2) { + this.key2 = key2; + return this; + } + +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/CognitiveServicesManagementClientImpl.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/CognitiveServicesManagementClientImpl.java new file mode 100644 index 00000000000..0bd3acde065 --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/CognitiveServicesManagementClientImpl.java @@ -0,0 +1,247 @@ +/** + * 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.advisor.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the CognitiveServicesManagementClientImpl class. + */ +public class CognitiveServicesManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Azure Subscription ID. */ + private String subscriptionId; + + /** + * Gets Azure Subscription ID. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Azure Subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public CognitiveServicesManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Version of the API to be used with the client request. Current version is 2017-04-18. */ + private String apiVersion; + + /** + * Gets Version of the API to be used with the client request. Current version is 2017-04-18. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). */ + private String filter; + + /** + * Gets An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). + * + * @return the filter value. + */ + public String filter() { + return this.filter; + } + + /** + * Sets An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). + * + * @param filter the filter value. + * @return the service client itself + */ + public CognitiveServicesManagementClientImpl withFilter(String filter) { + this.filter = filter; + return this; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public CognitiveServicesManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public CognitiveServicesManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public CognitiveServicesManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The AccountsInner object to access its operations. + */ + private AccountsInner accounts; + + /** + * Gets the AccountsInner object to access its operations. + * @return the AccountsInner object. + */ + public AccountsInner accounts() { + return this.accounts; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + 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. + * + * @param credentials the management credentials for Azure + */ + public CognitiveServicesManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of CognitiveServicesManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public CognitiveServicesManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of CognitiveServicesManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public CognitiveServicesManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2017-04-18"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.accounts = new AccountsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.checkSkuAvailabilitys = new CheckSkuAvailabilitysInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "CognitiveServicesManagementClient", "2017-04-18"); + } +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/OperationEntityInner.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/OperationEntityInner.java new file mode 100644 index 00000000000..0fda9df37b3 --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/OperationEntityInner.java @@ -0,0 +1,122 @@ +/** + * 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.advisor.implementation; + +import com.microsoft.azure.management.advisor.OperationDisplayInfo; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The operation supported by Cognitive Services. + */ +public class OperationEntityInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The operation supported by Cognitive Services. + */ + @JsonProperty(value = "display") + private OperationDisplayInfo display; + + /** + * The origin of the operation. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * Additional properties. + */ + @JsonProperty(value = "properties") + private Object properties; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the OperationEntityInner object itself. + */ + public OperationEntityInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display value. + * + * @return the display value + */ + public OperationDisplayInfo display() { + return this.display; + } + + /** + * Set the display value. + * + * @param display the display value to set + * @return the OperationEntityInner object itself. + */ + public OperationEntityInner withDisplay(OperationDisplayInfo display) { + this.display = display; + return this; + } + + /** + * Get the origin value. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin value. + * + * @param origin the origin value to set + * @return the OperationEntityInner object itself. + */ + public OperationEntityInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the properties value. + * + * @return the properties value + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the OperationEntityInner object itself. + */ + public OperationEntityInner withProperties(Object properties) { + this.properties = properties; + return this; + } + +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/OperationsInner.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/OperationsInner.java new file mode 100644 index 00000000000..d0c60072170 --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/OperationsInner.java @@ -0,0 +1,283 @@ +/** + * 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.advisor.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private CognitiveServicesManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, CognitiveServicesManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.advisor.Operations list" }) + @GET("providers/Microsoft.CognitiveServices/operations") + Observable> list(@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.advisor.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all the available Cognitive Services account operations. + * + * @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 PagedList<OperationEntityInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the available Cognitive Services account operations. + * + * @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> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the available Cognitive Services account operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationEntityInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the available Cognitive Services account operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationEntityInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the available Cognitive Services account operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationEntityInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the available Cognitive Services account operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<OperationEntityInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the available Cognitive Services account operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the available Cognitive Services account operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationEntityInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the available Cognitive Services account operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationEntityInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the available Cognitive Services account operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationEntityInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/PageImpl.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/PageImpl.java new file mode 100644 index 00000000000..dd03c7cfe01 --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.advisor.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/SkuInner.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/SkuInner.java new file mode 100644 index 00000000000..d28258b31f1 --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/SkuInner.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.advisor.implementation; + +import com.microsoft.azure.management.advisor.SkuName; +import com.microsoft.azure.management.advisor.SkuTier; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SKU of the cognitive services account. + */ +public class SkuInner { + /** + * 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'. + */ + @JsonProperty(value = "name", required = true) + private SkuName name; + + /** + * Gets the sku tier. This is based on the SKU name. Possible values + * include: 'Free', 'Standard', 'Premium'. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private SkuTier tier; + + /** + * Get the name value. + * + * @return the name value + */ + public SkuName name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the SkuInner object itself. + */ + public SkuInner withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier value. + * + * @return the tier value + */ + public SkuTier tier() { + return this.tier; + } + +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/UsagesResultInner.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/UsagesResultInner.java new file mode 100644 index 00000000000..71596565cda --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/UsagesResultInner.java @@ -0,0 +1,34 @@ +/** + * 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.advisor.implementation; + +import java.util.List; +import com.microsoft.azure.management.advisor.Usage; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response to a list usage request. + */ +public class UsagesResultInner { + /** + * The list of usages for Cognitive Service account. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + +} diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/package-info.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/package-info.java new file mode 100644 index 00000000000..873e9e82eed --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for CognitiveServicesManagementClient. + * Cognitive Services Management Client. + */ +package com.microsoft.azure.management.advisor.implementation; diff --git a/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/package-info.java b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/package-info.java new file mode 100644 index 00000000000..5cf6c88518d --- /dev/null +++ b/azure-mgmt-advisor/src/main/java/com/microsoft/azure/management/advisor/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for CognitiveServicesManagementClient. + * Cognitive Services Management Client. + */ +package com.microsoft.azure.management.advisor;