diff --git a/.gitignore b/.gitignore index 6bf64a9da927..0a920ce61362 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,6 @@ target # Windows # Thumbs.db + +# reduced pom files should not be included +dependency-reduced-pom.xml diff --git a/azure-mgmt-datalake-analytics/pom.xml b/azure-mgmt-datalake-analytics/pom.xml new file mode 100644 index 000000000000..c03e71f7506e --- /dev/null +++ b/azure-mgmt-datalake-analytics/pom.xml @@ -0,0 +1,120 @@ + + + 4.0.0 + + com.microsoft.azure + azure + 1.0.0-SNAPSHOT + ../azure/pom.xml + + + azure-mgmt-datalake-analytics + jar + + Microsoft Azure SDK for Data Lake Analytics Management + This package contains Microsoft Azure Data Lake Analytics Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + UTF-8 + + + + + + microsoft + Microsoft + + + + + + com.microsoft.azure + azure-client-runtime + + + ${project.groupId} + azure-mgmt-resources + ${project.version} + test + + + ${project.groupId} + azure-mgmt-datalake-store + ${project.version} + test + + + ${project.groupId} + azure-mgmt-storage + ${project.version} + test + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + + org.codehaus.mojo + build-helper-maven-plugin + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.storage + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/]]>
+
+
+ +
+
+
diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/AccountOperations.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/AccountOperations.java new file mode 100644 index 000000000000..53b36e596e9f --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/AccountOperations.java @@ -0,0 +1,924 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics; + +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.datalake.analytics.models.AddDataLakeStoreParameters; +import com.microsoft.azure.management.datalake.analytics.models.AddStorageAccountParameters; +import com.microsoft.azure.management.datalake.analytics.models.BlobContainer; +import com.microsoft.azure.management.datalake.analytics.models.DataLakeAnalyticsAccount; +import com.microsoft.azure.management.datalake.analytics.models.DataLakeStoreAccountInfo; +import com.microsoft.azure.management.datalake.analytics.models.PageImpl; +import com.microsoft.azure.management.datalake.analytics.models.SasTokenInfo; +import com.microsoft.azure.management.datalake.analytics.models.StorageAccountInfo; +import com.microsoft.rest.ServiceCall; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; + +/** + * An instance of this class provides access to all the operations defined + * in AccountOperations. + */ +public interface AccountOperations { + /** + * Gets the specified Azure Storage account linked to the given Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to retrieve Azure storage account details. + * @param storageAccountName The name of the Azure Storage account for which to retrieve the details. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the StorageAccountInfo object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getStorageAccount(String resourceGroupName, String accountName, String storageAccountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the specified Azure Storage account linked to the given Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to retrieve Azure storage account details. + * @param storageAccountName The name of the Azure Storage account for which to retrieve the details. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getStorageAccountAsync(String resourceGroupName, String accountName, String storageAccountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Updates the specified Data Lake Analytics account to remove an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to remove the Azure Storage account. + * @param storageAccountName The name of the Azure Storage account to remove + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse deleteStorageAccount(String resourceGroupName, String accountName, String storageAccountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Updates the specified Data Lake Analytics account to remove an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to remove the Azure Storage account. + * @param storageAccountName The name of the Azure Storage account to remove + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall deleteStorageAccountAsync(String resourceGroupName, String accountName, String storageAccountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key and/or suffix. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to modify storage accounts in + * @param storageAccountName The Azure Storage account to modify + * @param parameters The parameters containing the access key and suffix to update the storage account with. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse updateStorageAccount(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters) throws CloudException, IOException, IllegalArgumentException; + + /** + * Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key and/or suffix. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to modify storage accounts in + * @param storageAccountName The Azure Storage account to modify + * @param parameters The parameters containing the access key and suffix to update the storage account with. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall updateStorageAccountAsync(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Updates the specified Data Lake Analytics account to add an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to which to add the Azure Storage account. + * @param storageAccountName The name of the Azure Storage account to add + * @param parameters The parameters containing the access key and optional suffix for the Azure Storage Account. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse addStorageAccount(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters) throws CloudException, IOException, IllegalArgumentException; + + /** + * Updates the specified Data Lake Analytics account to add an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to which to add the Azure Storage account. + * @param storageAccountName The name of the Azure Storage account to add + * @param parameters The parameters containing the access key and optional suffix for the Azure Storage Account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall addStorageAccountAsync(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Gets the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage accounts. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to retrieve blob container. + * @param storageAccountName The name of the Azure storage account from which to retrieve the blob container. + * @param containerName The name of the Azure storage container to retrieve + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the BlobContainer object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getStorageContainer(String resourceGroupName, String accountName, String storageAccountName, String containerName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage accounts. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to retrieve blob container. + * @param storageAccountName The name of the Azure storage account from which to retrieve the blob container. + * @param containerName The name of the Azure storage container to retrieve + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getStorageContainerAsync(String resourceGroupName, String accountName, String storageAccountName, String containerName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Azure Storage blob containers. + * @param storageAccountName The name of the Azure storage account from which to list blob containers. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<BlobContainer> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listStorageContainers(final String resourceGroupName, final String accountName, final String storageAccountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Azure Storage blob containers. + * @param storageAccountName The name of the Azure storage account from which to list blob containers. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listStorageContainersAsync(final String resourceGroupName, final String accountName, final String storageAccountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Gets the next page of Azure Storage containers, if any, within the specified Azure Storage account. The response includes a link to the next page of results, if any. + * + * @param nextLink The URL to the next Azure Storage Container page. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<BlobContainer> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> storageContainersListNext(final String nextLink) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the next page of Azure Storage containers, if any, within the specified Azure Storage account. The response includes a link to the next page of results, if any. + * + * @param nextLink The URL to the next Azure Storage Container page. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall storageContainersListNextAsync(final String nextLink, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Gets the next page of the SAS token objects within the specified Azure Storage account and container, if any. + * + * @param nextLink The URL to the next Azure Storage Container SAS token page. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<SasTokenInfo> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> sasTokensListNext(final String nextLink) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the next page of the SAS token objects within the specified Azure Storage account and container, if any. + * + * @param nextLink The URL to the next Azure Storage Container SAS token page. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall sasTokensListNextAsync(final String nextLink, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which an Azure Storage account's SAS token is being requested. + * @param storageAccountName The name of the Azure storage account for which the SAS token is being requested. + * @param containerName The name of the Azure storage container for which the SAS token is being requested. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<SasTokenInfo> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listSasTokens(final String resourceGroupName, final String accountName, final String storageAccountName, final String containerName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which an Azure Storage account's SAS token is being requested. + * @param storageAccountName The name of the Azure storage account for which the SAS token is being requested. + * @param containerName The name of the Azure storage container for which the SAS token is being requested. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listSasTokensAsync(final String resourceGroupName, final String accountName, final String storageAccountName, final String containerName, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Gets the specified Data Lake Store account details in the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to retrieve the Data Lake Store account details. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to retrieve + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the DataLakeStoreAccountInfo object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getDataLakeStoreAccount(String resourceGroupName, String accountName, String dataLakeStoreAccountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the specified Data Lake Store account details in the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to retrieve the Data Lake Store account details. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to retrieve + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getDataLakeStoreAccountAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Updates the Data Lake Analytics account specified to remove the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to remove the Data Lake Store account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to remove + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse deleteDataLakeStoreAccount(String resourceGroupName, String accountName, String dataLakeStoreAccountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Updates the Data Lake Analytics account specified to remove the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to remove the Data Lake Store account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to remove + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall deleteDataLakeStoreAccountAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Updates the specified Data Lake Analytics account to include the additional Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to which to add the Data Lake Store account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to add. + * @param parameters The details of the Data Lake Store account. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse addDataLakeStoreAccount(String resourceGroupName, String accountName, String dataLakeStoreAccountName, AddDataLakeStoreParameters parameters) throws CloudException, IOException, IllegalArgumentException; + + /** + * Updates the specified Data Lake Analytics account to include the additional Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to which to add the Data Lake Store account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to add. + * @param parameters The details of the Data Lake Store account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall addDataLakeStoreAccountAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName, AddDataLakeStoreParameters parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Azure Storage accounts. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<StorageAccountInfo> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listStorageAccounts(final String resourceGroupName, final String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Azure Storage accounts. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listStorageAccountsAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Azure Storage accounts. + * @param filter The OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<StorageAccountInfo> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listStorageAccounts(final String resourceGroupName, final String accountName, final StorageAccountInfo filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Azure Storage accounts. + * @param filter The OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listStorageAccountsAsync(final String resourceGroupName, final String accountName, final StorageAccountInfo filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Data Lake Store accounts. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DataLakeStoreAccountInfo> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listDataLakeStoreAccounts(final String resourceGroupName, final String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Data Lake Store accounts. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listDataLakeStoreAccountsAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Data Lake Store accounts. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DataLakeStoreAccountInfo> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listDataLakeStoreAccounts(final String resourceGroupName, final String accountName, final DataLakeStoreAccountInfo filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Data Lake Store accounts. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listDataLakeStoreAccountsAsync(final String resourceGroupName, final String accountName, final DataLakeStoreAccountInfo filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DataLakeAnalyticsAccount> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listByResourceGroup(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DataLakeAnalyticsAccount> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listByResourceGroup(final String resourceGroupName, final DataLakeAnalyticsAccount filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listByResourceGroupAsync(final String resourceGroupName, final DataLakeAnalyticsAccount filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DataLakeAnalyticsAccount> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> list() throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listAsync(final ListOperationCallback serviceCallback) throws IllegalArgumentException; + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DataLakeAnalyticsAccount> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> list(final DataLakeAnalyticsAccount filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listAsync(final DataLakeAnalyticsAccount filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Gets details of the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to retrieve. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the DataLakeAnalyticsAccount object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse get(String resourceGroupName, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets details of the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to retrieve. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Begins the delete delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to delete + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse delete(String resourceGroupName, String accountName) throws CloudException, IOException, IllegalArgumentException, InterruptedException; + + /** + * Begins the delete delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to delete + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall deleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Begins the delete delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to delete + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse beginDelete(String resourceGroupName, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Begins the delete delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to delete + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall beginDeleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.the account will be associated with. + * @param name The name of the Data Lake Analytics account to create. + * @param parameters Parameters supplied to the create Data Lake Analytics account operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the DataLakeAnalyticsAccount object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse create(String resourceGroupName, String name, DataLakeAnalyticsAccount parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException; + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.the account will be associated with. + * @param name The name of the Data Lake Analytics account to create. + * @param parameters Parameters supplied to the create Data Lake Analytics account operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall createAsync(String resourceGroupName, String name, DataLakeAnalyticsAccount parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.the account will be associated with. + * @param name The name of the Data Lake Analytics account to create. + * @param parameters Parameters supplied to the create Data Lake Analytics account operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the DataLakeAnalyticsAccount object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse beginCreate(String resourceGroupName, String name, DataLakeAnalyticsAccount parameters) throws CloudException, IOException, IllegalArgumentException; + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.the account will be associated with. + * @param name The name of the Data Lake Analytics account to create. + * @param parameters Parameters supplied to the create Data Lake Analytics account operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall beginCreateAsync(String resourceGroupName, String name, DataLakeAnalyticsAccount parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param name The name of the Data Lake Analytics account to update. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the DataLakeAnalyticsAccount object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse update(String resourceGroupName, String name, DataLakeAnalyticsAccount parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException; + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param name The name of the Data Lake Analytics account to update. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall updateAsync(String resourceGroupName, String name, DataLakeAnalyticsAccount parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param name The name of the Data Lake Analytics account to update. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the DataLakeAnalyticsAccount object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse beginUpdate(String resourceGroupName, String name, DataLakeAnalyticsAccount parameters) throws CloudException, IOException, IllegalArgumentException; + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param name The name of the Data Lake Analytics account to update. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall beginUpdateAsync(String resourceGroupName, String name, DataLakeAnalyticsAccount parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<BlobContainer> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listStorageContainersNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException; + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listStorageContainersNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Gets the next page of Azure Storage containers, if any, within the specified Azure Storage account. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<BlobContainer> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> storageContainersListNextNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the next page of Azure Storage containers, if any, within the specified Azure Storage account. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall storageContainersListNextNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Gets the next page of the SAS token objects within the specified Azure Storage account and container, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<SasTokenInfo> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> sasTokensListNextNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the next page of the SAS token objects within the specified Azure Storage account and container, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall sasTokensListNextNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<SasTokenInfo> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listSasTokensNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listSasTokensNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<StorageAccountInfo> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listStorageAccountsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listStorageAccountsNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DataLakeStoreAccountInfo> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listDataLakeStoreAccountsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listDataLakeStoreAccountsNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DataLakeAnalyticsAccount> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listByResourceGroupNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listByResourceGroupNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DataLakeAnalyticsAccount> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/AccountOperationsImpl.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/AccountOperationsImpl.java new file mode 100644 index 000000000000..f9b755f6044a --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/AccountOperationsImpl.java @@ -0,0 +1,3143 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics; + +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceResponseBuilder; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.datalake.analytics.models.AddDataLakeStoreParameters; +import com.microsoft.azure.management.datalake.analytics.models.AddStorageAccountParameters; +import com.microsoft.azure.management.datalake.analytics.models.BlobContainer; +import com.microsoft.azure.management.datalake.analytics.models.DataLakeAnalyticsAccount; +import com.microsoft.azure.management.datalake.analytics.models.DataLakeStoreAccountInfo; +import com.microsoft.azure.management.datalake.analytics.models.PageImpl; +import com.microsoft.azure.management.datalake.analytics.models.SasTokenInfo; +import com.microsoft.azure.management.datalake.analytics.models.StorageAccountInfo; +import com.microsoft.rest.ServiceCall; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseCallback; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.Call; +import retrofit2.Callback; +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 retrofit2.Retrofit; + +/** + * An instance of this class provides access to all the operations defined + * in AccountOperations. + */ +public final class AccountOperationsImpl implements AccountOperations { + /** The Retrofit service to perform REST calls. */ + private AccountService service; + /** The service client containing this operation class. */ + private DataLakeAnalyticsAccountManagementClient client; + + /** + * Initializes an instance of AccountOperations. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AccountOperationsImpl(Retrofit retrofit, DataLakeAnalyticsAccountManagementClient client) { + this.service = retrofit.create(AccountService.class); + this.client = client; + } + + /** + * The interface defining all the services for AccountOperations to be + * used by Retrofit to perform actually REST calls. + */ + interface AccountService { + @Headers("Content-Type: application/json; charset=utf-8") + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/{storageAccountName}") + Call getStorageAccount(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("storageAccountName") String storageAccountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/{storageAccountName}", method = "DELETE", hasBody = true) + Call deleteStorageAccount(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("storageAccountName") String storageAccountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/{storageAccountName}") + Call updateStorageAccount(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("storageAccountName") String storageAccountName, @Path("subscriptionId") String subscriptionId, @Body AddStorageAccountParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/{storageAccountName}") + Call addStorageAccount(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("storageAccountName") String storageAccountName, @Path("subscriptionId") String subscriptionId, @Body AddStorageAccountParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/{storageAccountName}/Containers/{containerName}") + Call getStorageContainer(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("storageAccountName") String storageAccountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/{storageAccountName}/Containers") + Call listStorageContainers(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("storageAccountName") String storageAccountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("{nextLink}") + Call storageContainersListNext(@Path("nextLink") String nextLink, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @POST("{nextLink}") + Call sasTokensListNext(@Path("nextLink") String nextLink, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/{storageAccountName}/Containers/{containerName}/listSasTokens") + Call listSasTokens(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("storageAccountName") String storageAccountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/DataLakeStoreAccounts/{dataLakeStoreAccountName}") + Call getDataLakeStoreAccount(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("dataLakeStoreAccountName") String dataLakeStoreAccountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/DataLakeStoreAccounts/{dataLakeStoreAccountName}", method = "DELETE", hasBody = true) + Call deleteDataLakeStoreAccount(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("dataLakeStoreAccountName") String dataLakeStoreAccountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/DataLakeStoreAccounts/{dataLakeStoreAccountName}") + Call addDataLakeStoreAccount(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("dataLakeStoreAccountName") String dataLakeStoreAccountName, @Path("subscriptionId") String subscriptionId, @Body AddDataLakeStoreParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/") + Call listStorageAccounts(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$expand") String expand, @Query("$select") String select, @Query("$orderby") String orderby, @Query("$count") Boolean count, @Query("$search") String search, @Query("$format") String format, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/DataLakeStoreAccounts/") + Call listDataLakeStoreAccounts(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$expand") String expand, @Query("$select") String select, @Query("$orderby") String orderby, @Query("$count") Boolean count, @Query("$search") String search, @Query("$format") String format, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts") + Call listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$expand") String expand, @Query("$select") String select, @Query("$orderby") String orderby, @Query("$count") Boolean count, @Query("$search") String search, @Query("$format") String format, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DataLakeAnalytics/accounts") + Call list(@Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$expand") String expand, @Query("$select") String select, @Query("$orderby") String orderby, @Query("$count") Boolean count, @Query("$search") String search, @Query("$format") String format, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}") + Call get(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}", method = "DELETE", hasBody = true) + Call delete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}", method = "DELETE", hasBody = true) + Call beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{name}") + Call create(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Body DataLakeAnalyticsAccount parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{name}") + Call beginCreate(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Body DataLakeAnalyticsAccount parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{name}") + Call update(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Body DataLakeAnalyticsAccount parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{name}") + Call beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Body DataLakeAnalyticsAccount parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET + Call listStorageContainersNext(@Url String nextPageLink, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET + Call storageContainersListNextNext(@Url String nextPageLink, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET + Call sasTokensListNextNext(@Url String nextPageLink, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET + Call listSasTokensNext(@Url String nextPageLink, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET + Call listStorageAccountsNext(@Url String nextPageLink, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET + Call listDataLakeStoreAccountsNext(@Url String nextPageLink, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET + Call listByResourceGroupNext(@Url String nextPageLink, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET + Call listNext(@Url String nextPageLink, @Header("accept-language") String acceptLanguage); + + } + + /** + * Gets the specified Azure Storage account linked to the given Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to retrieve Azure storage account details. + * @param storageAccountName The name of the Azure Storage account for which to retrieve the details. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the StorageAccountInfo object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getStorageAccount(String resourceGroupName, String accountName, String storageAccountName) throws CloudException, IOException, IllegalArgumentException { + 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 (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Call call = service.getStorageAccount(resourceGroupName, accountName, storageAccountName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getStorageAccountDelegate(call.execute()); + } + + /** + * Gets the specified Azure Storage account linked to the given Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to retrieve Azure storage account details. + * @param storageAccountName The name of the Azure Storage account for which to retrieve the details. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getStorageAccountAsync(String resourceGroupName, String accountName, String storageAccountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (storageAccountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Call call = service.getStorageAccount(resourceGroupName, accountName, storageAccountName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getStorageAccountDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getStorageAccountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the specified Data Lake Analytics account to remove an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to remove the Azure Storage account. + * @param storageAccountName The name of the Azure Storage account to remove + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse deleteStorageAccount(String resourceGroupName, String accountName, String storageAccountName) throws CloudException, IOException, IllegalArgumentException { + 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 (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Call call = service.deleteStorageAccount(resourceGroupName, accountName, storageAccountName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return deleteStorageAccountDelegate(call.execute()); + } + + /** + * Updates the specified Data Lake Analytics account to remove an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to remove the Azure Storage account. + * @param storageAccountName The name of the Azure Storage account to remove + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall deleteStorageAccountAsync(String resourceGroupName, String accountName, String storageAccountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (storageAccountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Call call = service.deleteStorageAccount(resourceGroupName, accountName, storageAccountName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(deleteStorageAccountDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse deleteStorageAccountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key and/or suffix. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to modify storage accounts in + * @param storageAccountName The Azure Storage account to modify + * @param parameters The parameters containing the access key and suffix to update the storage account with. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse updateStorageAccount(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters) throws CloudException, IOException, IllegalArgumentException { + 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 (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Call call = service.updateStorageAccount(resourceGroupName, accountName, storageAccountName, this.client.getSubscriptionId(), parameters, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return updateStorageAccountDelegate(call.execute()); + } + + /** + * Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key and/or suffix. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to modify storage accounts in + * @param storageAccountName The Azure Storage account to modify + * @param parameters The parameters containing the access key and suffix to update the storage account with. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall updateStorageAccountAsync(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (storageAccountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (parameters == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Validator.validate(parameters, serviceCallback); + Call call = service.updateStorageAccount(resourceGroupName, accountName, storageAccountName, this.client.getSubscriptionId(), parameters, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(updateStorageAccountDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse updateStorageAccountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Updates the specified Data Lake Analytics account to add an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to which to add the Azure Storage account. + * @param storageAccountName The name of the Azure Storage account to add + * @param parameters The parameters containing the access key and optional suffix for the Azure Storage Account. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse addStorageAccount(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters) throws CloudException, IOException, IllegalArgumentException { + 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 (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Call call = service.addStorageAccount(resourceGroupName, accountName, storageAccountName, this.client.getSubscriptionId(), parameters, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return addStorageAccountDelegate(call.execute()); + } + + /** + * Updates the specified Data Lake Analytics account to add an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to which to add the Azure Storage account. + * @param storageAccountName The name of the Azure Storage account to add + * @param parameters The parameters containing the access key and optional suffix for the Azure Storage Account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall addStorageAccountAsync(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (storageAccountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (parameters == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Validator.validate(parameters, serviceCallback); + Call call = service.addStorageAccount(resourceGroupName, accountName, storageAccountName, this.client.getSubscriptionId(), parameters, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(addStorageAccountDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse addStorageAccountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Gets the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage accounts. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to retrieve blob container. + * @param storageAccountName The name of the Azure storage account from which to retrieve the blob container. + * @param containerName The name of the Azure storage container to retrieve + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the BlobContainer object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getStorageContainer(String resourceGroupName, String accountName, String storageAccountName, String containerName) throws CloudException, IOException, IllegalArgumentException { + 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 (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Call call = service.getStorageContainer(resourceGroupName, accountName, storageAccountName, containerName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getStorageContainerDelegate(call.execute()); + } + + /** + * Gets the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage accounts. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to retrieve blob container. + * @param storageAccountName The name of the Azure storage account from which to retrieve the blob container. + * @param containerName The name of the Azure storage container to retrieve + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getStorageContainerAsync(String resourceGroupName, String accountName, String storageAccountName, String containerName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (storageAccountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null.")); + return null; + } + if (containerName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Call call = service.getStorageContainer(resourceGroupName, accountName, storageAccountName, containerName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getStorageContainerDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getStorageContainerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Azure Storage blob containers. + * @param storageAccountName The name of the Azure storage account from which to list blob containers. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<BlobContainer> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listStorageContainers(final String resourceGroupName, final String accountName, final String storageAccountName) throws CloudException, IOException, IllegalArgumentException { + 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 (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Call call = service.listStorageContainers(resourceGroupName, accountName, storageAccountName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listStorageContainersDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listStorageContainersNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Azure Storage blob containers. + * @param storageAccountName The name of the Azure storage account from which to list blob containers. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listStorageContainersAsync(final String resourceGroupName, final String accountName, final String storageAccountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (storageAccountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Call call = service.listStorageContainers(resourceGroupName, accountName, storageAccountName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listStorageContainersDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listStorageContainersNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listStorageContainersDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the next page of Azure Storage containers, if any, within the specified Azure Storage account. The response includes a link to the next page of results, if any. + * + * @param nextLink The URL to the next Azure Storage Container page. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<BlobContainer> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> storageContainersListNext(final String nextLink) throws CloudException, IOException, IllegalArgumentException { + if (nextLink == null) { + throw new IllegalArgumentException("Parameter nextLink is required and cannot be null."); + } + Call call = service.storageContainersListNext(nextLink, this.client.getAcceptLanguage()); + ServiceResponse> response = storageContainersListNextDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = storageContainersListNextNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Gets the next page of Azure Storage containers, if any, within the specified Azure Storage account. The response includes a link to the next page of results, if any. + * + * @param nextLink The URL to the next Azure Storage Container page. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall storageContainersListNextAsync(final String nextLink, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (nextLink == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + return null; + } + Call call = service.storageContainersListNext(nextLink, this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = storageContainersListNextDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + storageContainersListNextNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> storageContainersListNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the next page of the SAS token objects within the specified Azure Storage account and container, if any. + * + * @param nextLink The URL to the next Azure Storage Container SAS token page. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<SasTokenInfo> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> sasTokensListNext(final String nextLink) throws CloudException, IOException, IllegalArgumentException { + if (nextLink == null) { + throw new IllegalArgumentException("Parameter nextLink is required and cannot be null."); + } + Call call = service.sasTokensListNext(nextLink, this.client.getAcceptLanguage()); + ServiceResponse> response = sasTokensListNextDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = sasTokensListNextNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Gets the next page of the SAS token objects within the specified Azure Storage account and container, if any. + * + * @param nextLink The URL to the next Azure Storage Container SAS token page. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall sasTokensListNextAsync(final String nextLink, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (nextLink == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + return null; + } + Call call = service.sasTokensListNext(nextLink, this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = sasTokensListNextDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + sasTokensListNextNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> sasTokensListNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which an Azure Storage account's SAS token is being requested. + * @param storageAccountName The name of the Azure storage account for which the SAS token is being requested. + * @param containerName The name of the Azure storage container for which the SAS token is being requested. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<SasTokenInfo> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listSasTokens(final String resourceGroupName, final String accountName, final String storageAccountName, final String containerName) throws CloudException, IOException, IllegalArgumentException { + 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 (storageAccountName == null) { + throw new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Call call = service.listSasTokens(resourceGroupName, accountName, storageAccountName, containerName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listSasTokensDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listSasTokensNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which an Azure Storage account's SAS token is being requested. + * @param storageAccountName The name of the Azure storage account for which the SAS token is being requested. + * @param containerName The name of the Azure storage container for which the SAS token is being requested. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listSasTokensAsync(final String resourceGroupName, final String accountName, final String storageAccountName, final String containerName, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (storageAccountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null.")); + return null; + } + if (containerName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Call call = service.listSasTokens(resourceGroupName, accountName, storageAccountName, containerName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listSasTokensDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listSasTokensNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listSasTokensDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified Data Lake Store account details in the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to retrieve the Data Lake Store account details. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to retrieve + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the DataLakeStoreAccountInfo object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getDataLakeStoreAccount(String resourceGroupName, String accountName, String dataLakeStoreAccountName) throws CloudException, IOException, IllegalArgumentException { + 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 (dataLakeStoreAccountName == null) { + throw new IllegalArgumentException("Parameter dataLakeStoreAccountName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Call call = service.getDataLakeStoreAccount(resourceGroupName, accountName, dataLakeStoreAccountName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getDataLakeStoreAccountDelegate(call.execute()); + } + + /** + * Gets the specified Data Lake Store account details in the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to retrieve the Data Lake Store account details. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to retrieve + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getDataLakeStoreAccountAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (dataLakeStoreAccountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter dataLakeStoreAccountName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Call call = service.getDataLakeStoreAccount(resourceGroupName, accountName, dataLakeStoreAccountName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getDataLakeStoreAccountDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getDataLakeStoreAccountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the Data Lake Analytics account specified to remove the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to remove the Data Lake Store account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to remove + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse deleteDataLakeStoreAccount(String resourceGroupName, String accountName, String dataLakeStoreAccountName) throws CloudException, IOException, IllegalArgumentException { + 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 (dataLakeStoreAccountName == null) { + throw new IllegalArgumentException("Parameter dataLakeStoreAccountName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Call call = service.deleteDataLakeStoreAccount(resourceGroupName, accountName, dataLakeStoreAccountName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return deleteDataLakeStoreAccountDelegate(call.execute()); + } + + /** + * Updates the Data Lake Analytics account specified to remove the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account from which to remove the Data Lake Store account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to remove + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall deleteDataLakeStoreAccountAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (dataLakeStoreAccountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter dataLakeStoreAccountName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Call call = service.deleteDataLakeStoreAccount(resourceGroupName, accountName, dataLakeStoreAccountName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(deleteDataLakeStoreAccountDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse deleteDataLakeStoreAccountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Updates the specified Data Lake Analytics account to include the additional Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to which to add the Data Lake Store account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to add. + * @param parameters The details of the Data Lake Store account. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse addDataLakeStoreAccount(String resourceGroupName, String accountName, String dataLakeStoreAccountName, AddDataLakeStoreParameters parameters) throws CloudException, IOException, IllegalArgumentException { + 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 (dataLakeStoreAccountName == null) { + throw new IllegalArgumentException("Parameter dataLakeStoreAccountName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Call call = service.addDataLakeStoreAccount(resourceGroupName, accountName, dataLakeStoreAccountName, this.client.getSubscriptionId(), parameters, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return addDataLakeStoreAccountDelegate(call.execute()); + } + + /** + * Updates the specified Data Lake Analytics account to include the additional Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to which to add the Data Lake Store account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to add. + * @param parameters The details of the Data Lake Store account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall addDataLakeStoreAccountAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName, AddDataLakeStoreParameters parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (dataLakeStoreAccountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter dataLakeStoreAccountName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (parameters == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Validator.validate(parameters, serviceCallback); + Call call = service.addDataLakeStoreAccount(resourceGroupName, accountName, dataLakeStoreAccountName, this.client.getSubscriptionId(), parameters, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(addDataLakeStoreAccountDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse addDataLakeStoreAccountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Azure Storage accounts. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<StorageAccountInfo> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listStorageAccounts(final String resourceGroupName, final String accountName) throws CloudException, IOException, IllegalArgumentException { + 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.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + StorageAccountInfo filter = null; + Integer top = null; + Integer skip = null; + String expand = null; + String select = null; + String orderby = null; + Boolean count = null; + String search = null; + String format = null; + Call call = service.listStorageAccounts(resourceGroupName, accountName, this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, search, format, this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listStorageAccountsDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listStorageAccountsNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Azure Storage accounts. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listStorageAccountsAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final StorageAccountInfo filter = null; + final Integer top = null; + final Integer skip = null; + final String expand = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + final String search = null; + final String format = null; + Call call = service.listStorageAccounts(resourceGroupName, accountName, this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, search, format, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listStorageAccountsDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listStorageAccountsNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Azure Storage accounts. + * @param filter The OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<StorageAccountInfo> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listStorageAccounts(final String resourceGroupName, final String accountName, final StorageAccountInfo filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) throws CloudException, IOException, IllegalArgumentException { + 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.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Validator.validate(filter); + Call call = service.listStorageAccounts(resourceGroupName, accountName, this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, search, format, this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listStorageAccountsDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listStorageAccountsNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Azure Storage accounts. + * @param filter The OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listStorageAccountsAsync(final String resourceGroupName, final String accountName, final StorageAccountInfo filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Validator.validate(filter, serviceCallback); + Call call = service.listStorageAccounts(resourceGroupName, accountName, this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, search, format, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listStorageAccountsDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listStorageAccountsNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listStorageAccountsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Data Lake Store accounts. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DataLakeStoreAccountInfo> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listDataLakeStoreAccounts(final String resourceGroupName, final String accountName) throws CloudException, IOException, IllegalArgumentException { + 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.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + DataLakeStoreAccountInfo filter = null; + Integer top = null; + Integer skip = null; + String expand = null; + String select = null; + String orderby = null; + Boolean count = null; + String search = null; + String format = null; + Call call = service.listDataLakeStoreAccounts(resourceGroupName, accountName, this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, search, format, this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listDataLakeStoreAccountsDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listDataLakeStoreAccountsNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Data Lake Store accounts. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listDataLakeStoreAccountsAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final DataLakeStoreAccountInfo filter = null; + final Integer top = null; + final Integer skip = null; + final String expand = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + final String search = null; + final String format = null; + Call call = service.listDataLakeStoreAccounts(resourceGroupName, accountName, this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, search, format, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listDataLakeStoreAccountsDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listDataLakeStoreAccountsNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Data Lake Store accounts. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DataLakeStoreAccountInfo> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listDataLakeStoreAccounts(final String resourceGroupName, final String accountName, final DataLakeStoreAccountInfo filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) throws CloudException, IOException, IllegalArgumentException { + 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.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Validator.validate(filter); + Call call = service.listDataLakeStoreAccounts(resourceGroupName, accountName, this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, search, format, this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listDataLakeStoreAccountsDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listDataLakeStoreAccountsNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account for which to list Data Lake Store accounts. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listDataLakeStoreAccountsAsync(final String resourceGroupName, final String accountName, final DataLakeStoreAccountInfo filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Validator.validate(filter, serviceCallback); + Call call = service.listDataLakeStoreAccounts(resourceGroupName, accountName, this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, search, format, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listDataLakeStoreAccountsDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listDataLakeStoreAccountsNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listDataLakeStoreAccountsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DataLakeAnalyticsAccount> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listByResourceGroup(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + DataLakeAnalyticsAccount filter = null; + Integer top = null; + Integer skip = null; + String expand = null; + String select = null; + String orderby = null; + Boolean count = null; + String search = null; + String format = null; + Call call = service.listByResourceGroup(resourceGroupName, this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, search, format, this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listByResourceGroupDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listByResourceGroupNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final DataLakeAnalyticsAccount filter = null; + final Integer top = null; + final Integer skip = null; + final String expand = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + final String search = null; + final String format = null; + Call call = service.listByResourceGroup(resourceGroupName, this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, search, format, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listByResourceGroupNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DataLakeAnalyticsAccount> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listByResourceGroup(final String resourceGroupName, final DataLakeAnalyticsAccount filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Validator.validate(filter); + Call call = service.listByResourceGroup(resourceGroupName, this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, search, format, this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listByResourceGroupDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listByResourceGroupNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listByResourceGroupAsync(final String resourceGroupName, final DataLakeAnalyticsAccount filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Validator.validate(filter, serviceCallback); + Call call = service.listByResourceGroup(resourceGroupName, this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, search, format, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listByResourceGroupNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DataLakeAnalyticsAccount> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> list() throws CloudException, IOException, IllegalArgumentException { + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + DataLakeAnalyticsAccount filter = null; + Integer top = null; + Integer skip = null; + String expand = null; + String select = null; + String orderby = null; + Boolean count = null; + String search = null; + String format = null; + Call call = service.list(this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, search, format, this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listAsync(final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final DataLakeAnalyticsAccount filter = null; + final Integer top = null; + final Integer skip = null; + final String expand = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + final String search = null; + final String format = null; + Call call = service.list(this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, search, format, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DataLakeAnalyticsAccount> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> list(final DataLakeAnalyticsAccount filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) throws CloudException, IOException, IllegalArgumentException { + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Validator.validate(filter); + Call call = service.list(this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, search, format, this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listAsync(final DataLakeAnalyticsAccount filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Validator.validate(filter, serviceCallback); + Call call = service.list(this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, search, format, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets details of the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to retrieve. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the DataLakeAnalyticsAccount object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse get(String resourceGroupName, String accountName) throws CloudException, IOException, IllegalArgumentException { + 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.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Call call = service.get(resourceGroupName, accountName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getDelegate(call.execute()); + } + + /** + * Gets details of the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to retrieve. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Call call = service.get(resourceGroupName, accountName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Begins the delete delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to delete + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the ServiceResponse object if successful. + */ + public ServiceResponse delete(String resourceGroupName, String accountName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + 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.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Response result = service.delete(resourceGroupName, accountName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()).execute(); + return client.getAzureClient().getPostOrDeleteResult(result, new TypeToken() { }.getType()); + } + + /** + * Begins the delete delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to delete + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + public ServiceCall deleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + } + Call call = service.delete(resourceGroupName, accountName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, Throwable t) { + serviceCallback.failure(t); + } + @Override + public void onResponse(Call call, Response response) { + client.getAzureClient().getPostOrDeleteResultAsync(response, new TypeToken() { }.getType(), serviceCall, serviceCallback); + } + }); + return serviceCall; + } + + /** + * Begins the delete delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to delete + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse beginDelete(String resourceGroupName, String accountName) throws CloudException, IOException, IllegalArgumentException { + 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.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Call call = service.beginDelete(resourceGroupName, accountName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return beginDeleteDelegate(call.execute()); + } + + /** + * Begins the delete delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param accountName The name of the Data Lake Analytics account to delete + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall beginDeleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Call call = service.beginDelete(resourceGroupName, accountName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(beginDeleteDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.the account will be associated with. + * @param name The name of the Data Lake Analytics account to create. + * @param parameters Parameters supplied to the create Data Lake Analytics account operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the DataLakeAnalyticsAccount object wrapped in ServiceResponse if successful. + */ + public ServiceResponse create(String resourceGroupName, String name, DataLakeAnalyticsAccount parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Response result = service.create(resourceGroupName, name, this.client.getSubscriptionId(), parameters, this.client.getApiVersion(), this.client.getAcceptLanguage()).execute(); + return client.getAzureClient().getPutOrPatchResult(result, new TypeToken() { }.getType()); + } + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.the account will be associated with. + * @param name The name of the Data Lake Analytics account to create. + * @param parameters Parameters supplied to the create Data Lake Analytics account operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + public ServiceCall createAsync(String resourceGroupName, String name, DataLakeAnalyticsAccount parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + } + Validator.validate(parameters, serviceCallback); + Call call = service.create(resourceGroupName, name, this.client.getSubscriptionId(), parameters, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, Throwable t) { + serviceCallback.failure(t); + } + @Override + public void onResponse(Call call, Response response) { + client.getAzureClient().getPutOrPatchResultAsync(response, new TypeToken() { }.getType(), serviceCall, serviceCallback); + } + }); + return serviceCall; + } + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.the account will be associated with. + * @param name The name of the Data Lake Analytics account to create. + * @param parameters Parameters supplied to the create Data Lake Analytics account operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the DataLakeAnalyticsAccount object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse beginCreate(String resourceGroupName, String name, DataLakeAnalyticsAccount parameters) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Call call = service.beginCreate(resourceGroupName, name, this.client.getSubscriptionId(), parameters, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return beginCreateDelegate(call.execute()); + } + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.the account will be associated with. + * @param name The name of the Data Lake Analytics account to create. + * @param parameters Parameters supplied to the create Data Lake Analytics account operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall beginCreateAsync(String resourceGroupName, String name, DataLakeAnalyticsAccount parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (parameters == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Validator.validate(parameters, serviceCallback); + Call call = service.beginCreate(resourceGroupName, name, this.client.getSubscriptionId(), parameters, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(beginCreateDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(201, new TypeToken() { }.getType()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param name The name of the Data Lake Analytics account to update. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the DataLakeAnalyticsAccount object wrapped in ServiceResponse if successful. + */ + public ServiceResponse update(String resourceGroupName, String name, DataLakeAnalyticsAccount parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Response result = service.update(resourceGroupName, name, this.client.getSubscriptionId(), parameters, this.client.getApiVersion(), this.client.getAcceptLanguage()).execute(); + return client.getAzureClient().getPutOrPatchResult(result, new TypeToken() { }.getType()); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param name The name of the Data Lake Analytics account to update. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + public ServiceCall updateAsync(String resourceGroupName, String name, DataLakeAnalyticsAccount parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + } + Validator.validate(parameters, serviceCallback); + Call call = service.update(resourceGroupName, name, this.client.getSubscriptionId(), parameters, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, Throwable t) { + serviceCallback.failure(t); + } + @Override + public void onResponse(Call call, Response response) { + client.getAzureClient().getPutOrPatchResultAsync(response, new TypeToken() { }.getType(), serviceCall, serviceCallback); + } + }); + return serviceCall; + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param name The name of the Data Lake Analytics account to update. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the DataLakeAnalyticsAccount object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse beginUpdate(String resourceGroupName, String name, DataLakeAnalyticsAccount parameters) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Call call = service.beginUpdate(resourceGroupName, name, this.client.getSubscriptionId(), parameters, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return beginUpdateDelegate(call.execute()); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account. + * @param name The name of the Data Lake Analytics account to update. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall beginUpdateAsync(String resourceGroupName, String name, DataLakeAnalyticsAccount parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (parameters == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Validator.validate(parameters, serviceCallback); + Call call = service.beginUpdate(resourceGroupName, name, this.client.getSubscriptionId(), parameters, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(beginUpdateDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<BlobContainer> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listStorageContainersNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + Call call = service.listStorageContainersNext(nextPageLink, this.client.getAcceptLanguage()); + return listStorageContainersNextDelegate(call.execute()); + } + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listStorageContainersNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (nextPageLink == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.")); + return null; + } + Call call = service.listStorageContainersNext(nextPageLink, this.client.getAcceptLanguage()); + serviceCall.newCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listStorageContainersNextDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listStorageContainersNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listStorageContainersNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the next page of Azure Storage containers, if any, within the specified Azure Storage account. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<BlobContainer> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> storageContainersListNextNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + Call call = service.storageContainersListNextNext(nextPageLink, this.client.getAcceptLanguage()); + return storageContainersListNextNextDelegate(call.execute()); + } + + /** + * Gets the next page of Azure Storage containers, if any, within the specified Azure Storage account. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall storageContainersListNextNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (nextPageLink == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.")); + return null; + } + Call call = service.storageContainersListNextNext(nextPageLink, this.client.getAcceptLanguage()); + serviceCall.newCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = storageContainersListNextNextDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + storageContainersListNextNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> storageContainersListNextNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the next page of the SAS token objects within the specified Azure Storage account and container, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<SasTokenInfo> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> sasTokensListNextNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + Call call = service.sasTokensListNextNext(nextPageLink, this.client.getAcceptLanguage()); + return sasTokensListNextNextDelegate(call.execute()); + } + + /** + * Gets the next page of the SAS token objects within the specified Azure Storage account and container, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall sasTokensListNextNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (nextPageLink == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.")); + return null; + } + Call call = service.sasTokensListNextNext(nextPageLink, this.client.getAcceptLanguage()); + serviceCall.newCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = sasTokensListNextNextDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + sasTokensListNextNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> sasTokensListNextNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<SasTokenInfo> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listSasTokensNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + Call call = service.listSasTokensNext(nextPageLink, this.client.getAcceptLanguage()); + return listSasTokensNextDelegate(call.execute()); + } + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listSasTokensNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (nextPageLink == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.")); + return null; + } + Call call = service.listSasTokensNext(nextPageLink, this.client.getAcceptLanguage()); + serviceCall.newCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listSasTokensNextDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listSasTokensNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listSasTokensNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<StorageAccountInfo> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listStorageAccountsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + Call call = service.listStorageAccountsNext(nextPageLink, this.client.getAcceptLanguage()); + return listStorageAccountsNextDelegate(call.execute()); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listStorageAccountsNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (nextPageLink == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.")); + return null; + } + Call call = service.listStorageAccountsNext(nextPageLink, this.client.getAcceptLanguage()); + serviceCall.newCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listStorageAccountsNextDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listStorageAccountsNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listStorageAccountsNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DataLakeStoreAccountInfo> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listDataLakeStoreAccountsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + Call call = service.listDataLakeStoreAccountsNext(nextPageLink, this.client.getAcceptLanguage()); + return listDataLakeStoreAccountsNextDelegate(call.execute()); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listDataLakeStoreAccountsNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (nextPageLink == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.")); + return null; + } + Call call = service.listDataLakeStoreAccountsNext(nextPageLink, this.client.getAcceptLanguage()); + serviceCall.newCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listDataLakeStoreAccountsNextDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listDataLakeStoreAccountsNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listDataLakeStoreAccountsNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DataLakeAnalyticsAccount> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listByResourceGroupNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + Call call = service.listByResourceGroupNext(nextPageLink, this.client.getAcceptLanguage()); + return listByResourceGroupNextDelegate(call.execute()); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listByResourceGroupNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (nextPageLink == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.")); + return null; + } + Call call = service.listByResourceGroupNext(nextPageLink, this.client.getAcceptLanguage()); + serviceCall.newCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listByResourceGroupNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DataLakeAnalyticsAccount> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + Call call = service.listNext(nextPageLink, this.client.getAcceptLanguage()); + return listNextDelegate(call.execute()); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (nextPageLink == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.")); + return null; + } + Call call = service.listNext(nextPageLink, this.client.getAcceptLanguage()); + serviceCall.newCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/CatalogOperations.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/CatalogOperations.java new file mode 100644 index 000000000000..9129cb0280c8 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/CatalogOperations.java @@ -0,0 +1,1320 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics; + +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.datalake.analytics.models.DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters; +import com.microsoft.azure.management.datalake.analytics.models.PageImpl; +import com.microsoft.azure.management.datalake.analytics.models.USqlAssembly; +import com.microsoft.azure.management.datalake.analytics.models.USqlAssemblyClr; +import com.microsoft.azure.management.datalake.analytics.models.USqlCredential; +import com.microsoft.azure.management.datalake.analytics.models.USqlDatabase; +import com.microsoft.azure.management.datalake.analytics.models.USqlExternalDataSource; +import com.microsoft.azure.management.datalake.analytics.models.USqlProcedure; +import com.microsoft.azure.management.datalake.analytics.models.USqlSchema; +import com.microsoft.azure.management.datalake.analytics.models.USqlSecret; +import com.microsoft.azure.management.datalake.analytics.models.USqlTable; +import com.microsoft.azure.management.datalake.analytics.models.USqlTableStatistics; +import com.microsoft.azure.management.datalake.analytics.models.USqlTableValuedFunction; +import com.microsoft.azure.management.datalake.analytics.models.USqlType; +import com.microsoft.azure.management.datalake.analytics.models.USqlView; +import com.microsoft.rest.ServiceCall; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; + +/** + * An instance of this class provides access to all the operations defined + * in CatalogOperations. + */ +public interface CatalogOperations { + /** + * Creates the specified secret for use with external data sources in the specified database. + * + * @param databaseName The name of the database in which to create the secret. + * @param secretName The name of the secret. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param parameters The parameters required to create the secret (name and password) + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the USqlSecret object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse createSecret(String databaseName, String secretName, String accountName, DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters parameters) throws CloudException, IOException, IllegalArgumentException; + + /** + * Creates the specified secret for use with external data sources in the specified database. + * + * @param databaseName The name of the database in which to create the secret. + * @param secretName The name of the secret. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param parameters The parameters required to create the secret (name and password) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall createSecretAsync(String databaseName, String secretName, String accountName, DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Modifies the specified secret for use with external data sources in the specified database. + * + * @param databaseName The name of the database containing the secret. + * @param secretName The name of the secret. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param parameters The parameters required to modify the secret (name and password) + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the USqlSecret object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse updateSecret(String databaseName, String secretName, String accountName, DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters parameters) throws CloudException, IOException, IllegalArgumentException; + + /** + * Modifies the specified secret for use with external data sources in the specified database. + * + * @param databaseName The name of the database containing the secret. + * @param secretName The name of the secret. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param parameters The parameters required to modify the secret (name and password) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall updateSecretAsync(String databaseName, String secretName, String accountName, DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Gets the specified secret in the specified database. + * + * @param databaseName The name of the database containing the secret. + * @param secretName The name of the secret to get + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the USqlSecret object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getSecret(String databaseName, String secretName, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the specified secret in the specified database. + * + * @param databaseName The name of the database containing the secret. + * @param secretName The name of the secret to get + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getSecretAsync(String databaseName, String secretName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Deletes the specified secret in the specified database. + * + * @param databaseName The name of the database containing the secret. + * @param secretName The name of the secret to delete + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse deleteSecret(String databaseName, String secretName, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Deletes the specified secret in the specified database. + * + * @param databaseName The name of the database containing the secret. + * @param secretName The name of the secret to delete + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall deleteSecretAsync(String databaseName, String secretName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the specified external data source from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the external data source. + * @param externalDataSourceName The name of the external data source. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the USqlExternalDataSource object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getExternalDataSource(String databaseName, String externalDataSourceName, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the specified external data source from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the external data source. + * @param externalDataSourceName The name of the external data source. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getExternalDataSourceAsync(String databaseName, String externalDataSourceName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the list of external data sources from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the external data sources. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlExternalDataSource> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listExternalDataSources(final String databaseName, final String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of external data sources from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the external data sources. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listExternalDataSourcesAsync(final String databaseName, final String accountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + /** + * Retrieves the list of external data sources from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the external data sources. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlExternalDataSource> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listExternalDataSources(final String databaseName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of external data sources from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the external data sources. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listExternalDataSourcesAsync(final String databaseName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the specified credential from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the schema. + * @param credentialName The name of the credential. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the USqlCredential object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getCredential(String databaseName, String credentialName, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the specified credential from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the schema. + * @param credentialName The name of the credential. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getCredentialAsync(String databaseName, String credentialName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the list of credentials from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the schema. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlCredential> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listCredentials(final String databaseName, final String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of credentials from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the schema. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listCredentialsAsync(final String databaseName, final String accountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + /** + * Retrieves the list of credentials from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the schema. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlCredential> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listCredentials(final String databaseName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of credentials from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the schema. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listCredentialsAsync(final String databaseName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the specified procedure from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the procedure. + * @param schemaName The name of the schema containing the procedure. + * @param procedureName The name of the procedure. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the USqlProcedure object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getProcedure(String databaseName, String schemaName, String procedureName, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the specified procedure from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the procedure. + * @param schemaName The name of the schema containing the procedure. + * @param procedureName The name of the procedure. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getProcedureAsync(String databaseName, String schemaName, String procedureName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the list of procedures from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the procedures. + * @param schemaName The name of the schema containing the procedures. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlProcedure> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listProcedures(final String databaseName, final String schemaName, final String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of procedures from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the procedures. + * @param schemaName The name of the schema containing the procedures. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listProceduresAsync(final String databaseName, final String schemaName, final String accountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + /** + * Retrieves the list of procedures from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the procedures. + * @param schemaName The name of the schema containing the procedures. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlProcedure> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listProcedures(final String databaseName, final String schemaName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of procedures from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the procedures. + * @param schemaName The name of the schema containing the procedures. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listProceduresAsync(final String databaseName, final String schemaName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the specified table from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the table. + * @param schemaName The name of the schema containing the table. + * @param tableName The name of the table. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the USqlTable object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getTable(String databaseName, String schemaName, String tableName, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the specified table from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the table. + * @param schemaName The name of the schema containing the table. + * @param tableName The name of the table. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getTableAsync(String databaseName, String schemaName, String tableName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the list of tables from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the tables. + * @param schemaName The name of the schema containing the tables. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlTable> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listTables(final String databaseName, final String schemaName, final String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of tables from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the tables. + * @param schemaName The name of the schema containing the tables. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listTablesAsync(final String databaseName, final String schemaName, final String accountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + /** + * Retrieves the list of tables from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the tables. + * @param schemaName The name of the schema containing the tables. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlTable> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listTables(final String databaseName, final String schemaName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of tables from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the tables. + * @param schemaName The name of the schema containing the tables. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listTablesAsync(final String databaseName, final String schemaName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the specified view from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the view. + * @param schemaName The name of the schema containing the view. + * @param viewName The name of the view. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the USqlView object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getView(String databaseName, String schemaName, String viewName, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the specified view from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the view. + * @param schemaName The name of the schema containing the view. + * @param viewName The name of the view. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getViewAsync(String databaseName, String schemaName, String viewName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the list of views from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the views. + * @param schemaName The name of the schema containing the views. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlView> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listViews(final String databaseName, final String schemaName, final String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of views from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the views. + * @param schemaName The name of the schema containing the views. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listViewsAsync(final String databaseName, final String schemaName, final String accountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + /** + * Retrieves the list of views from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the views. + * @param schemaName The name of the schema containing the views. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlView> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listViews(final String databaseName, final String schemaName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of views from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the views. + * @param schemaName The name of the schema containing the views. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listViewsAsync(final String databaseName, final String schemaName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the specified table from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the statistics. + * @param schemaName The name of the schema containing the statistics. + * @param tableName The name of the table containing the statistics. + * @param statisticsName The name of the table statistics. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the USqlTableStatistics object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getTableStatistic(String databaseName, String schemaName, String tableName, String statisticsName, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the specified table from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the statistics. + * @param schemaName The name of the schema containing the statistics. + * @param tableName The name of the table containing the statistics. + * @param statisticsName The name of the table statistics. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getTableStatisticAsync(String databaseName, String schemaName, String tableName, String statisticsName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the list of tables from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the statistics. + * @param schemaName The name of the schema containing the statistics. + * @param tableName The name of the table containing the statistics. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlTableStatistics> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listTableStatistics(final String databaseName, final String schemaName, final String tableName, final String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of tables from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the statistics. + * @param schemaName The name of the schema containing the statistics. + * @param tableName The name of the table containing the statistics. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listTableStatisticsAsync(final String databaseName, final String schemaName, final String tableName, final String accountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + /** + * Retrieves the list of tables from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the statistics. + * @param schemaName The name of the schema containing the statistics. + * @param tableName The name of the table containing the statistics. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlTableStatistics> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listTableStatistics(final String databaseName, final String schemaName, final String tableName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of tables from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the statistics. + * @param schemaName The name of the schema containing the statistics. + * @param tableName The name of the table containing the statistics. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listTableStatisticsAsync(final String databaseName, final String schemaName, final String tableName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the list of types within the specified database and schema from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the types. + * @param schemaName The name of the schema containing the types. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlType> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listTypes(final String databaseName, final String schemaName, final String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of types within the specified database and schema from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the types. + * @param schemaName The name of the schema containing the types. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listTypesAsync(final String databaseName, final String schemaName, final String accountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + /** + * Retrieves the list of types within the specified database and schema from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the types. + * @param schemaName The name of the schema containing the types. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlType> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listTypes(final String databaseName, final String schemaName, final String accountName, final USqlType filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of types within the specified database and schema from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the types. + * @param schemaName The name of the schema containing the types. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listTypesAsync(final String databaseName, final String schemaName, final String accountName, final USqlType filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the specified table valued function from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the table valued function. + * @param schemaName The name of the schema containing the table valued function. + * @param tableValuedFunctionName The name of the tableValuedFunction. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the USqlTableValuedFunction object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getTableValuedFunction(String databaseName, String schemaName, String tableValuedFunctionName, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the specified table valued function from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the table valued function. + * @param schemaName The name of the schema containing the table valued function. + * @param tableValuedFunctionName The name of the tableValuedFunction. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getTableValuedFunctionAsync(String databaseName, String schemaName, String tableValuedFunctionName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the list of table valued functions from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the table valued functions. + * @param schemaName The name of the schema containing the table valued functions. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlTableValuedFunction> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listTableValuedFunctions(final String databaseName, final String schemaName, final String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of table valued functions from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the table valued functions. + * @param schemaName The name of the schema containing the table valued functions. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listTableValuedFunctionsAsync(final String databaseName, final String schemaName, final String accountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + /** + * Retrieves the list of table valued functions from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the table valued functions. + * @param schemaName The name of the schema containing the table valued functions. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlTableValuedFunction> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listTableValuedFunctions(final String databaseName, final String schemaName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of table valued functions from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the table valued functions. + * @param schemaName The name of the schema containing the table valued functions. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listTableValuedFunctionsAsync(final String databaseName, final String schemaName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the specified assembly from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the assembly. + * @param assemblyName The name of the assembly. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the USqlAssembly object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getAssembly(String databaseName, String assemblyName, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the specified assembly from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the assembly. + * @param assemblyName The name of the assembly. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getAssemblyAsync(String databaseName, String assemblyName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the list of assemblies from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the assembly. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlAssemblyClr> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listAssemblies(final String databaseName, final String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of assemblies from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the assembly. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listAssembliesAsync(final String databaseName, final String accountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + /** + * Retrieves the list of assemblies from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the assembly. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlAssemblyClr> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listAssemblies(final String databaseName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of assemblies from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the assembly. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listAssembliesAsync(final String databaseName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the specified schema from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the schema. + * @param schemaName The name of the schema. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the USqlSchema object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getSchema(String databaseName, String schemaName, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the specified schema from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the schema. + * @param schemaName The name of the schema. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getSchemaAsync(String databaseName, String schemaName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the list of schemas from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the schema. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlSchema> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listSchemas(final String databaseName, final String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of schemas from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the schema. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listSchemasAsync(final String databaseName, final String accountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + /** + * Retrieves the list of schemas from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the schema. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlSchema> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listSchemas(final String databaseName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of schemas from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the schema. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listSchemasAsync(final String databaseName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the specified database from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the USqlDatabase object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getDatabase(String databaseName, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the specified database from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getDatabaseAsync(String databaseName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the list of databases from the Data Lake Analytics catalog. + * + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlDatabase> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listDatabases(final String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of databases from the Data Lake Analytics catalog. + * + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listDatabasesAsync(final String accountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + /** + * Retrieves the list of databases from the Data Lake Analytics catalog. + * + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlDatabase> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listDatabases(final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of databases from the Data Lake Analytics catalog. + * + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listDatabasesAsync(final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the list of external data sources from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlExternalDataSource> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listExternalDataSourcesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of external data sources from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listExternalDataSourcesNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the list of credentials from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlCredential> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listCredentialsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of credentials from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listCredentialsNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the list of procedures from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlProcedure> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listProceduresNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of procedures from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listProceduresNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the list of tables from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlTable> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listTablesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of tables from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listTablesNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the list of views from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlView> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listViewsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of views from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listViewsNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the list of tables from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlTableStatistics> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listTableStatisticsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of tables from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listTableStatisticsNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the list of types within the specified database and schema from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlType> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listTypesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of types within the specified database and schema from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listTypesNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the list of table valued functions from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlTableValuedFunction> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listTableValuedFunctionsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of table valued functions from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listTableValuedFunctionsNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the list of assemblies from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlAssemblyClr> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listAssembliesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of assemblies from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listAssembliesNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the list of schemas from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlSchema> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listSchemasNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of schemas from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listSchemasNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Retrieves the list of databases from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlDatabase> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listDatabasesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException; + + /** + * Retrieves the list of databases from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listDatabasesNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/CatalogOperationsImpl.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/CatalogOperationsImpl.java new file mode 100644 index 000000000000..b6a6f5693ec6 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/CatalogOperationsImpl.java @@ -0,0 +1,5019 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics; + +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceResponseBuilder; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.datalake.analytics.models.DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters; +import com.microsoft.azure.management.datalake.analytics.models.PageImpl; +import com.microsoft.azure.management.datalake.analytics.models.USqlAssembly; +import com.microsoft.azure.management.datalake.analytics.models.USqlAssemblyClr; +import com.microsoft.azure.management.datalake.analytics.models.USqlCredential; +import com.microsoft.azure.management.datalake.analytics.models.USqlDatabase; +import com.microsoft.azure.management.datalake.analytics.models.USqlExternalDataSource; +import com.microsoft.azure.management.datalake.analytics.models.USqlProcedure; +import com.microsoft.azure.management.datalake.analytics.models.USqlSchema; +import com.microsoft.azure.management.datalake.analytics.models.USqlSecret; +import com.microsoft.azure.management.datalake.analytics.models.USqlTable; +import com.microsoft.azure.management.datalake.analytics.models.USqlTableStatistics; +import com.microsoft.azure.management.datalake.analytics.models.USqlTableValuedFunction; +import com.microsoft.azure.management.datalake.analytics.models.USqlType; +import com.microsoft.azure.management.datalake.analytics.models.USqlView; +import com.microsoft.rest.ServiceCall; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseCallback; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.Call; +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.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import retrofit2.Retrofit; + +/** + * An instance of this class provides access to all the operations defined + * in CatalogOperations. + */ +public final class CatalogOperationsImpl implements CatalogOperations { + /** The Retrofit service to perform REST calls. */ + private CatalogService service; + /** The service client containing this operation class. */ + private DataLakeAnalyticsCatalogManagementClient client; + + /** + * Initializes an instance of CatalogOperations. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public CatalogOperationsImpl(Retrofit retrofit, DataLakeAnalyticsCatalogManagementClient client) { + this.service = retrofit.create(CatalogService.class); + this.client = client; + } + + /** + * The interface defining all the services for CatalogOperations to be + * used by Retrofit to perform actually REST calls. + */ + interface CatalogService { + @Headers("Content-Type: application/json; charset=utf-8") + @PUT("catalog/usql/databases/{databaseName}/secrets/{secretName}") + Call createSecret(@Path("databaseName") String databaseName, @Path("secretName") String secretName, @Body DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters parameters, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @PATCH("catalog/usql/databases/{databaseName}/secrets/{secretName}") + Call updateSecret(@Path("databaseName") String databaseName, @Path("secretName") String secretName, @Body DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters parameters, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("catalog/usql/databases/{databaseName}/secrets/{secretName}") + Call getSecret(@Path("databaseName") String databaseName, @Path("secretName") String secretName, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @HTTP(path = "catalog/usql/databases/{databaseName}/secrets/{secretName}", method = "DELETE", hasBody = true) + Call deleteSecret(@Path("databaseName") String databaseName, @Path("secretName") String secretName, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("catalog/usql/databases/{databaseName}/externaldatasources/{externalDataSourceName}") + Call getExternalDataSource(@Path("databaseName") String databaseName, @Path("externalDataSourceName") String externalDataSourceName, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("catalog/usql/databases/{databaseName}/externaldatasources") + Call listExternalDataSources(@Path("databaseName") String databaseName, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$expand") String expand, @Query("$select") String select, @Query("$orderby") String orderby, @Query("$count") Boolean count, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("catalog/usql/databases/{databaseName}/credentials/{credentialName}") + Call getCredential(@Path("databaseName") String databaseName, @Path("credentialName") String credentialName, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("catalog/usql/databases/{databaseName}/credentials") + Call listCredentials(@Path("databaseName") String databaseName, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$expand") String expand, @Query("$select") String select, @Query("$orderby") String orderby, @Query("$count") Boolean count, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("catalog/usql/databases/{databaseName}/schemas/{schemaName}/procedures/{procedureName}") + Call getProcedure(@Path("databaseName") String databaseName, @Path("schemaName") String schemaName, @Path("procedureName") String procedureName, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("catalog/usql/databases/{databaseName}/schemas/{schemaName}/procedures") + Call listProcedures(@Path("databaseName") String databaseName, @Path("schemaName") String schemaName, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$expand") String expand, @Query("$select") String select, @Query("$orderby") String orderby, @Query("$count") Boolean count, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}") + Call getTable(@Path("databaseName") String databaseName, @Path("schemaName") String schemaName, @Path("tableName") String tableName, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables") + Call listTables(@Path("databaseName") String databaseName, @Path("schemaName") String schemaName, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$expand") String expand, @Query("$select") String select, @Query("$orderby") String orderby, @Query("$count") Boolean count, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("catalog/usql/databases/{databaseName}/schemas/{schemaName}/views/{viewName}") + Call getView(@Path("databaseName") String databaseName, @Path("schemaName") String schemaName, @Path("viewName") String viewName, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("catalog/usql/databases/{databaseName}/schemas/{schemaName}/views") + Call listViews(@Path("databaseName") String databaseName, @Path("schemaName") String schemaName, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$expand") String expand, @Query("$select") String select, @Query("$orderby") String orderby, @Query("$count") Boolean count, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/statistics/{statisticsName}") + Call getTableStatistic(@Path("databaseName") String databaseName, @Path("schemaName") String schemaName, @Path("tableName") String tableName, @Path("statisticsName") String statisticsName, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/statistics") + Call listTableStatistics(@Path("databaseName") String databaseName, @Path("schemaName") String schemaName, @Path("tableName") String tableName, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$expand") String expand, @Query("$select") String select, @Query("$orderby") String orderby, @Query("$count") Boolean count, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("catalog/usql/databases/{databaseName}/schemas/{schemaName}/types") + Call listTypes(@Path("databaseName") String databaseName, @Path("schemaName") String schemaName, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$expand") String expand, @Query("$select") String select, @Query("$orderby") String orderby, @Query("$count") Boolean count, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("catalog/usql/databases/{databaseName}/schemas/{schemaName}/tablevaluedfunctions/{tableValuedFunctionName}") + Call getTableValuedFunction(@Path("databaseName") String databaseName, @Path("schemaName") String schemaName, @Path("tableValuedFunctionName") String tableValuedFunctionName, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("catalog/usql/databases/{databaseName}/schemas/{schemaName}/tablevaluedfunctions") + Call listTableValuedFunctions(@Path("databaseName") String databaseName, @Path("schemaName") String schemaName, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$expand") String expand, @Query("$select") String select, @Query("$orderby") String orderby, @Query("$count") Boolean count, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("catalog/usql/databases/{databaseName}/assemblies/{assemblyName}") + Call getAssembly(@Path("databaseName") String databaseName, @Path("assemblyName") String assemblyName, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("catalog/usql/databases/{databaseName}/assemblies") + Call listAssemblies(@Path("databaseName") String databaseName, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$expand") String expand, @Query("$select") String select, @Query("$orderby") String orderby, @Query("$count") Boolean count, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("catalog/usql/databases/{databaseName}/schemas/{schemaName}") + Call getSchema(@Path("databaseName") String databaseName, @Path("schemaName") String schemaName, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("catalog/usql/databases/{databaseName}/schemas") + Call listSchemas(@Path("databaseName") String databaseName, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$expand") String expand, @Query("$select") String select, @Query("$orderby") String orderby, @Query("$count") Boolean count, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("catalog/usql/databases/{databaseName}") + Call getDatabase(@Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("catalog/usql/databases") + Call listDatabases(@Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$expand") String expand, @Query("$select") String select, @Query("$orderby") String orderby, @Query("$count") Boolean count, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET + Call listExternalDataSourcesNext(@Url String nextPageLink, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET + Call listCredentialsNext(@Url String nextPageLink, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET + Call listProceduresNext(@Url String nextPageLink, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET + Call listTablesNext(@Url String nextPageLink, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET + Call listViewsNext(@Url String nextPageLink, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET + Call listTableStatisticsNext(@Url String nextPageLink, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET + Call listTypesNext(@Url String nextPageLink, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET + Call listTableValuedFunctionsNext(@Url String nextPageLink, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET + Call listAssembliesNext(@Url String nextPageLink, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET + Call listSchemasNext(@Url String nextPageLink, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET + Call listDatabasesNext(@Url String nextPageLink, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + } + + /** + * Creates the specified secret for use with external data sources in the specified database. + * + * @param databaseName The name of the database in which to create the secret. + * @param secretName The name of the secret. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param parameters The parameters required to create the secret (name and password) + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the USqlSecret object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse createSecret(String databaseName, String secretName, String accountName, DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters parameters) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (secretName == null) { + throw new IllegalArgumentException("Parameter secretName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + Validator.validate(parameters); + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.createSecret(databaseName, secretName, parameters, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return createSecretDelegate(call.execute()); + } + + /** + * Creates the specified secret for use with external data sources in the specified database. + * + * @param databaseName The name of the database in which to create the secret. + * @param secretName The name of the secret. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param parameters The parameters required to create the secret (name and password) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall createSecretAsync(String databaseName, String secretName, String accountName, DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (secretName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter secretName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (parameters == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + Validator.validate(parameters, serviceCallback); + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.createSecret(databaseName, secretName, parameters, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(createSecretDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse createSecretDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Modifies the specified secret for use with external data sources in the specified database. + * + * @param databaseName The name of the database containing the secret. + * @param secretName The name of the secret. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param parameters The parameters required to modify the secret (name and password) + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the USqlSecret object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse updateSecret(String databaseName, String secretName, String accountName, DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters parameters) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (secretName == null) { + throw new IllegalArgumentException("Parameter secretName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + Validator.validate(parameters); + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.updateSecret(databaseName, secretName, parameters, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return updateSecretDelegate(call.execute()); + } + + /** + * Modifies the specified secret for use with external data sources in the specified database. + * + * @param databaseName The name of the database containing the secret. + * @param secretName The name of the secret. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param parameters The parameters required to modify the secret (name and password) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall updateSecretAsync(String databaseName, String secretName, String accountName, DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (secretName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter secretName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (parameters == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + Validator.validate(parameters, serviceCallback); + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.updateSecret(databaseName, secretName, parameters, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(updateSecretDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse updateSecretDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified secret in the specified database. + * + * @param databaseName The name of the database containing the secret. + * @param secretName The name of the secret to get + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the USqlSecret object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getSecret(String databaseName, String secretName, String accountName) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (secretName == null) { + throw new IllegalArgumentException("Parameter secretName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.getSecret(databaseName, secretName, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return getSecretDelegate(call.execute()); + } + + /** + * Gets the specified secret in the specified database. + * + * @param databaseName The name of the database containing the secret. + * @param secretName The name of the secret to get + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getSecretAsync(String databaseName, String secretName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (secretName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter secretName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.getSecret(databaseName, secretName, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getSecretDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getSecretDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified secret in the specified database. + * + * @param databaseName The name of the database containing the secret. + * @param secretName The name of the secret to delete + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse deleteSecret(String databaseName, String secretName, String accountName) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (secretName == null) { + throw new IllegalArgumentException("Parameter secretName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.deleteSecret(databaseName, secretName, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return deleteSecretDelegate(call.execute()); + } + + /** + * Deletes the specified secret in the specified database. + * + * @param databaseName The name of the database containing the secret. + * @param secretName The name of the secret to delete + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall deleteSecretAsync(String databaseName, String secretName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (secretName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter secretName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.deleteSecret(databaseName, secretName, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(deleteSecretDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse deleteSecretDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Retrieves the specified external data source from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the external data source. + * @param externalDataSourceName The name of the external data source. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the USqlExternalDataSource object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getExternalDataSource(String databaseName, String externalDataSourceName, String accountName) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (externalDataSourceName == null) { + throw new IllegalArgumentException("Parameter externalDataSourceName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.getExternalDataSource(databaseName, externalDataSourceName, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return getExternalDataSourceDelegate(call.execute()); + } + + /** + * Retrieves the specified external data source from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the external data source. + * @param externalDataSourceName The name of the external data source. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getExternalDataSourceAsync(String databaseName, String externalDataSourceName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (externalDataSourceName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter externalDataSourceName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.getExternalDataSource(databaseName, externalDataSourceName, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getExternalDataSourceDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getExternalDataSourceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the list of external data sources from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the external data sources. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlExternalDataSource> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listExternalDataSources(final String databaseName, final String accountName) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + String filter = null; + Integer top = null; + Integer skip = null; + String expand = null; + String select = null; + String orderby = null; + Boolean count = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listExternalDataSources(databaseName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + ServiceResponse> response = listExternalDataSourcesDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listExternalDataSourcesNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Retrieves the list of external data sources from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the external data sources. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listExternalDataSourcesAsync(final String databaseName, final String accountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String expand = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listExternalDataSources(databaseName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listExternalDataSourcesDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listExternalDataSourcesNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Retrieves the list of external data sources from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the external data sources. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlExternalDataSource> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listExternalDataSources(final String databaseName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listExternalDataSources(databaseName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + ServiceResponse> response = listExternalDataSourcesDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listExternalDataSourcesNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Retrieves the list of external data sources from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the external data sources. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listExternalDataSourcesAsync(final String databaseName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listExternalDataSources(databaseName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listExternalDataSourcesDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listExternalDataSourcesNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listExternalDataSourcesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the specified credential from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the schema. + * @param credentialName The name of the credential. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the USqlCredential object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getCredential(String databaseName, String credentialName, String accountName) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (credentialName == null) { + throw new IllegalArgumentException("Parameter credentialName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.getCredential(databaseName, credentialName, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return getCredentialDelegate(call.execute()); + } + + /** + * Retrieves the specified credential from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the schema. + * @param credentialName The name of the credential. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getCredentialAsync(String databaseName, String credentialName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (credentialName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter credentialName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.getCredential(databaseName, credentialName, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getCredentialDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getCredentialDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the list of credentials from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the schema. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlCredential> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listCredentials(final String databaseName, final String accountName) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + String filter = null; + Integer top = null; + Integer skip = null; + String expand = null; + String select = null; + String orderby = null; + Boolean count = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listCredentials(databaseName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + ServiceResponse> response = listCredentialsDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listCredentialsNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Retrieves the list of credentials from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the schema. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listCredentialsAsync(final String databaseName, final String accountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String expand = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listCredentials(databaseName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listCredentialsDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listCredentialsNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Retrieves the list of credentials from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the schema. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlCredential> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listCredentials(final String databaseName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listCredentials(databaseName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + ServiceResponse> response = listCredentialsDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listCredentialsNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Retrieves the list of credentials from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the schema. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listCredentialsAsync(final String databaseName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listCredentials(databaseName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listCredentialsDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listCredentialsNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listCredentialsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the specified procedure from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the procedure. + * @param schemaName The name of the schema containing the procedure. + * @param procedureName The name of the procedure. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the USqlProcedure object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getProcedure(String databaseName, String schemaName, String procedureName, String accountName) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (schemaName == null) { + throw new IllegalArgumentException("Parameter schemaName is required and cannot be null."); + } + if (procedureName == null) { + throw new IllegalArgumentException("Parameter procedureName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.getProcedure(databaseName, schemaName, procedureName, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return getProcedureDelegate(call.execute()); + } + + /** + * Retrieves the specified procedure from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the procedure. + * @param schemaName The name of the schema containing the procedure. + * @param procedureName The name of the procedure. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getProcedureAsync(String databaseName, String schemaName, String procedureName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (schemaName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + return null; + } + if (procedureName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter procedureName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.getProcedure(databaseName, schemaName, procedureName, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getProcedureDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getProcedureDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the list of procedures from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the procedures. + * @param schemaName The name of the schema containing the procedures. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlProcedure> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listProcedures(final String databaseName, final String schemaName, final String accountName) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (schemaName == null) { + throw new IllegalArgumentException("Parameter schemaName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + String filter = null; + Integer top = null; + Integer skip = null; + String expand = null; + String select = null; + String orderby = null; + Boolean count = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listProcedures(databaseName, schemaName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + ServiceResponse> response = listProceduresDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listProceduresNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Retrieves the list of procedures from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the procedures. + * @param schemaName The name of the schema containing the procedures. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listProceduresAsync(final String databaseName, final String schemaName, final String accountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (schemaName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String expand = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listProcedures(databaseName, schemaName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listProceduresDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listProceduresNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Retrieves the list of procedures from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the procedures. + * @param schemaName The name of the schema containing the procedures. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlProcedure> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listProcedures(final String databaseName, final String schemaName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (schemaName == null) { + throw new IllegalArgumentException("Parameter schemaName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listProcedures(databaseName, schemaName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + ServiceResponse> response = listProceduresDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listProceduresNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Retrieves the list of procedures from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the procedures. + * @param schemaName The name of the schema containing the procedures. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listProceduresAsync(final String databaseName, final String schemaName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (schemaName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listProcedures(databaseName, schemaName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listProceduresDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listProceduresNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listProceduresDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the specified table from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the table. + * @param schemaName The name of the schema containing the table. + * @param tableName The name of the table. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the USqlTable object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getTable(String databaseName, String schemaName, String tableName, String accountName) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (schemaName == null) { + throw new IllegalArgumentException("Parameter schemaName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.getTable(databaseName, schemaName, tableName, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return getTableDelegate(call.execute()); + } + + /** + * Retrieves the specified table from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the table. + * @param schemaName The name of the schema containing the table. + * @param tableName The name of the table. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getTableAsync(String databaseName, String schemaName, String tableName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (schemaName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + return null; + } + if (tableName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.getTable(databaseName, schemaName, tableName, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getTableDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getTableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the list of tables from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the tables. + * @param schemaName The name of the schema containing the tables. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlTable> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listTables(final String databaseName, final String schemaName, final String accountName) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (schemaName == null) { + throw new IllegalArgumentException("Parameter schemaName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + String filter = null; + Integer top = null; + Integer skip = null; + String expand = null; + String select = null; + String orderby = null; + Boolean count = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listTables(databaseName, schemaName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + ServiceResponse> response = listTablesDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listTablesNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Retrieves the list of tables from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the tables. + * @param schemaName The name of the schema containing the tables. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listTablesAsync(final String databaseName, final String schemaName, final String accountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (schemaName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String expand = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listTables(databaseName, schemaName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listTablesDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listTablesNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Retrieves the list of tables from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the tables. + * @param schemaName The name of the schema containing the tables. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlTable> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listTables(final String databaseName, final String schemaName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (schemaName == null) { + throw new IllegalArgumentException("Parameter schemaName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listTables(databaseName, schemaName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + ServiceResponse> response = listTablesDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listTablesNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Retrieves the list of tables from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the tables. + * @param schemaName The name of the schema containing the tables. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listTablesAsync(final String databaseName, final String schemaName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (schemaName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listTables(databaseName, schemaName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listTablesDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listTablesNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listTablesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the specified view from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the view. + * @param schemaName The name of the schema containing the view. + * @param viewName The name of the view. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the USqlView object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getView(String databaseName, String schemaName, String viewName, String accountName) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (schemaName == null) { + throw new IllegalArgumentException("Parameter schemaName is required and cannot be null."); + } + if (viewName == null) { + throw new IllegalArgumentException("Parameter viewName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.getView(databaseName, schemaName, viewName, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return getViewDelegate(call.execute()); + } + + /** + * Retrieves the specified view from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the view. + * @param schemaName The name of the schema containing the view. + * @param viewName The name of the view. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getViewAsync(String databaseName, String schemaName, String viewName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (schemaName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + return null; + } + if (viewName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.getView(databaseName, schemaName, viewName, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getViewDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getViewDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the list of views from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the views. + * @param schemaName The name of the schema containing the views. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlView> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listViews(final String databaseName, final String schemaName, final String accountName) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (schemaName == null) { + throw new IllegalArgumentException("Parameter schemaName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + String filter = null; + Integer top = null; + Integer skip = null; + String expand = null; + String select = null; + String orderby = null; + Boolean count = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listViews(databaseName, schemaName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + ServiceResponse> response = listViewsDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listViewsNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Retrieves the list of views from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the views. + * @param schemaName The name of the schema containing the views. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listViewsAsync(final String databaseName, final String schemaName, final String accountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (schemaName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String expand = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listViews(databaseName, schemaName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listViewsDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listViewsNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Retrieves the list of views from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the views. + * @param schemaName The name of the schema containing the views. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlView> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listViews(final String databaseName, final String schemaName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (schemaName == null) { + throw new IllegalArgumentException("Parameter schemaName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listViews(databaseName, schemaName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + ServiceResponse> response = listViewsDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listViewsNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Retrieves the list of views from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the views. + * @param schemaName The name of the schema containing the views. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listViewsAsync(final String databaseName, final String schemaName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (schemaName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listViews(databaseName, schemaName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listViewsDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listViewsNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listViewsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the specified table from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the statistics. + * @param schemaName The name of the schema containing the statistics. + * @param tableName The name of the table containing the statistics. + * @param statisticsName The name of the table statistics. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the USqlTableStatistics object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getTableStatistic(String databaseName, String schemaName, String tableName, String statisticsName, String accountName) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (schemaName == null) { + throw new IllegalArgumentException("Parameter schemaName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName is required and cannot be null."); + } + if (statisticsName == null) { + throw new IllegalArgumentException("Parameter statisticsName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.getTableStatistic(databaseName, schemaName, tableName, statisticsName, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return getTableStatisticDelegate(call.execute()); + } + + /** + * Retrieves the specified table from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the statistics. + * @param schemaName The name of the schema containing the statistics. + * @param tableName The name of the table containing the statistics. + * @param statisticsName The name of the table statistics. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getTableStatisticAsync(String databaseName, String schemaName, String tableName, String statisticsName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (schemaName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + return null; + } + if (tableName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + return null; + } + if (statisticsName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter statisticsName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.getTableStatistic(databaseName, schemaName, tableName, statisticsName, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getTableStatisticDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getTableStatisticDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the list of tables from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the statistics. + * @param schemaName The name of the schema containing the statistics. + * @param tableName The name of the table containing the statistics. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlTableStatistics> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listTableStatistics(final String databaseName, final String schemaName, final String tableName, final String accountName) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (schemaName == null) { + throw new IllegalArgumentException("Parameter schemaName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + String filter = null; + Integer top = null; + Integer skip = null; + String expand = null; + String select = null; + String orderby = null; + Boolean count = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listTableStatistics(databaseName, schemaName, tableName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + ServiceResponse> response = listTableStatisticsDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listTableStatisticsNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Retrieves the list of tables from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the statistics. + * @param schemaName The name of the schema containing the statistics. + * @param tableName The name of the table containing the statistics. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listTableStatisticsAsync(final String databaseName, final String schemaName, final String tableName, final String accountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (schemaName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + return null; + } + if (tableName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String expand = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listTableStatistics(databaseName, schemaName, tableName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listTableStatisticsDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listTableStatisticsNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Retrieves the list of tables from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the statistics. + * @param schemaName The name of the schema containing the statistics. + * @param tableName The name of the table containing the statistics. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlTableStatistics> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listTableStatistics(final String databaseName, final String schemaName, final String tableName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (schemaName == null) { + throw new IllegalArgumentException("Parameter schemaName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listTableStatistics(databaseName, schemaName, tableName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + ServiceResponse> response = listTableStatisticsDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listTableStatisticsNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Retrieves the list of tables from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the statistics. + * @param schemaName The name of the schema containing the statistics. + * @param tableName The name of the table containing the statistics. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listTableStatisticsAsync(final String databaseName, final String schemaName, final String tableName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (schemaName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + return null; + } + if (tableName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listTableStatistics(databaseName, schemaName, tableName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listTableStatisticsDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listTableStatisticsNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listTableStatisticsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the list of types within the specified database and schema from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the types. + * @param schemaName The name of the schema containing the types. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlType> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listTypes(final String databaseName, final String schemaName, final String accountName) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (schemaName == null) { + throw new IllegalArgumentException("Parameter schemaName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + USqlType filter = null; + Integer top = null; + Integer skip = null; + String expand = null; + String select = null; + String orderby = null; + Boolean count = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listTypes(databaseName, schemaName, this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + ServiceResponse> response = listTypesDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listTypesNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Retrieves the list of types within the specified database and schema from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the types. + * @param schemaName The name of the schema containing the types. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listTypesAsync(final String databaseName, final String schemaName, final String accountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (schemaName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final USqlType filter = null; + final Integer top = null; + final Integer skip = null; + final String expand = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listTypes(databaseName, schemaName, this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listTypesDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listTypesNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Retrieves the list of types within the specified database and schema from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the types. + * @param schemaName The name of the schema containing the types. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlType> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listTypes(final String databaseName, final String schemaName, final String accountName, final USqlType filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (schemaName == null) { + throw new IllegalArgumentException("Parameter schemaName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + Validator.validate(filter); + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listTypes(databaseName, schemaName, this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + ServiceResponse> response = listTypesDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listTypesNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Retrieves the list of types within the specified database and schema from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the types. + * @param schemaName The name of the schema containing the types. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listTypesAsync(final String databaseName, final String schemaName, final String accountName, final USqlType filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (schemaName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + Validator.validate(filter, serviceCallback); + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listTypes(databaseName, schemaName, this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listTypesDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listTypesNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listTypesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the specified table valued function from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the table valued function. + * @param schemaName The name of the schema containing the table valued function. + * @param tableValuedFunctionName The name of the tableValuedFunction. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the USqlTableValuedFunction object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getTableValuedFunction(String databaseName, String schemaName, String tableValuedFunctionName, String accountName) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (schemaName == null) { + throw new IllegalArgumentException("Parameter schemaName is required and cannot be null."); + } + if (tableValuedFunctionName == null) { + throw new IllegalArgumentException("Parameter tableValuedFunctionName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.getTableValuedFunction(databaseName, schemaName, tableValuedFunctionName, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return getTableValuedFunctionDelegate(call.execute()); + } + + /** + * Retrieves the specified table valued function from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the table valued function. + * @param schemaName The name of the schema containing the table valued function. + * @param tableValuedFunctionName The name of the tableValuedFunction. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getTableValuedFunctionAsync(String databaseName, String schemaName, String tableValuedFunctionName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (schemaName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + return null; + } + if (tableValuedFunctionName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter tableValuedFunctionName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.getTableValuedFunction(databaseName, schemaName, tableValuedFunctionName, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getTableValuedFunctionDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getTableValuedFunctionDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the list of table valued functions from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the table valued functions. + * @param schemaName The name of the schema containing the table valued functions. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlTableValuedFunction> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listTableValuedFunctions(final String databaseName, final String schemaName, final String accountName) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (schemaName == null) { + throw new IllegalArgumentException("Parameter schemaName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + String filter = null; + Integer top = null; + Integer skip = null; + String expand = null; + String select = null; + String orderby = null; + Boolean count = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listTableValuedFunctions(databaseName, schemaName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + ServiceResponse> response = listTableValuedFunctionsDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listTableValuedFunctionsNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Retrieves the list of table valued functions from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the table valued functions. + * @param schemaName The name of the schema containing the table valued functions. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listTableValuedFunctionsAsync(final String databaseName, final String schemaName, final String accountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (schemaName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String expand = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listTableValuedFunctions(databaseName, schemaName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listTableValuedFunctionsDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listTableValuedFunctionsNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Retrieves the list of table valued functions from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the table valued functions. + * @param schemaName The name of the schema containing the table valued functions. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlTableValuedFunction> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listTableValuedFunctions(final String databaseName, final String schemaName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (schemaName == null) { + throw new IllegalArgumentException("Parameter schemaName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listTableValuedFunctions(databaseName, schemaName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + ServiceResponse> response = listTableValuedFunctionsDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listTableValuedFunctionsNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Retrieves the list of table valued functions from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the table valued functions. + * @param schemaName The name of the schema containing the table valued functions. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listTableValuedFunctionsAsync(final String databaseName, final String schemaName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (schemaName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listTableValuedFunctions(databaseName, schemaName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listTableValuedFunctionsDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listTableValuedFunctionsNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listTableValuedFunctionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the specified assembly from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the assembly. + * @param assemblyName The name of the assembly. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the USqlAssembly object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getAssembly(String databaseName, String assemblyName, String accountName) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (assemblyName == null) { + throw new IllegalArgumentException("Parameter assemblyName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.getAssembly(databaseName, assemblyName, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return getAssemblyDelegate(call.execute()); + } + + /** + * Retrieves the specified assembly from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the assembly. + * @param assemblyName The name of the assembly. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getAssemblyAsync(String databaseName, String assemblyName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (assemblyName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter assemblyName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.getAssembly(databaseName, assemblyName, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getAssemblyDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getAssemblyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the list of assemblies from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the assembly. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlAssemblyClr> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listAssemblies(final String databaseName, final String accountName) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + String filter = null; + Integer top = null; + Integer skip = null; + String expand = null; + String select = null; + String orderby = null; + Boolean count = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listAssemblies(databaseName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + ServiceResponse> response = listAssembliesDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listAssembliesNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Retrieves the list of assemblies from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the assembly. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listAssembliesAsync(final String databaseName, final String accountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String expand = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listAssemblies(databaseName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listAssembliesDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listAssembliesNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Retrieves the list of assemblies from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the assembly. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlAssemblyClr> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listAssemblies(final String databaseName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listAssemblies(databaseName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + ServiceResponse> response = listAssembliesDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listAssembliesNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Retrieves the list of assemblies from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the assembly. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listAssembliesAsync(final String databaseName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listAssemblies(databaseName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listAssembliesDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listAssembliesNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listAssembliesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the specified schema from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the schema. + * @param schemaName The name of the schema. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the USqlSchema object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getSchema(String databaseName, String schemaName, String accountName) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (schemaName == null) { + throw new IllegalArgumentException("Parameter schemaName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.getSchema(databaseName, schemaName, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return getSchemaDelegate(call.execute()); + } + + /** + * Retrieves the specified schema from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the schema. + * @param schemaName The name of the schema. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getSchemaAsync(String databaseName, String schemaName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (schemaName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.getSchema(databaseName, schemaName, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getSchemaDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getSchemaDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the list of schemas from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the schema. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlSchema> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listSchemas(final String databaseName, final String accountName) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + String filter = null; + Integer top = null; + Integer skip = null; + String expand = null; + String select = null; + String orderby = null; + Boolean count = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listSchemas(databaseName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + ServiceResponse> response = listSchemasDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listSchemasNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Retrieves the list of schemas from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the schema. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listSchemasAsync(final String databaseName, final String accountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String expand = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listSchemas(databaseName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listSchemasDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listSchemasNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Retrieves the list of schemas from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the schema. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlSchema> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listSchemas(final String databaseName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listSchemas(databaseName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + ServiceResponse> response = listSchemasDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listSchemasNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Retrieves the list of schemas from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database containing the schema. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listSchemasAsync(final String databaseName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listSchemas(databaseName, filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listSchemasDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listSchemasNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listSchemasDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the specified database from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the USqlDatabase object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getDatabase(String databaseName, String accountName) throws CloudException, IOException, IllegalArgumentException { + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.getDatabase(databaseName, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return getDatabaseDelegate(call.execute()); + } + + /** + * Retrieves the specified database from the Data Lake Analytics catalog. + * + * @param databaseName The name of the database. + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getDatabaseAsync(String databaseName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (databaseName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.getDatabase(databaseName, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getDatabaseDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getDatabaseDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the list of databases from the Data Lake Analytics catalog. + * + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlDatabase> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listDatabases(final String accountName) throws CloudException, IOException, IllegalArgumentException { + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + String filter = null; + Integer top = null; + Integer skip = null; + String expand = null; + String select = null; + String orderby = null; + Boolean count = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listDatabases(filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + ServiceResponse> response = listDatabasesDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listDatabasesNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Retrieves the list of databases from the Data Lake Analytics catalog. + * + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listDatabasesAsync(final String accountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String expand = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listDatabases(filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listDatabasesDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listDatabasesNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Retrieves the list of databases from the Data Lake Analytics catalog. + * + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlDatabase> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listDatabases(final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count) throws CloudException, IOException, IllegalArgumentException { + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listDatabases(filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + ServiceResponse> response = listDatabasesDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listDatabasesNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Retrieves the list of databases from the Data Lake Analytics catalog. + * + * @param accountName The Azure Data Lake Analytics account to execute catalog operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listDatabasesAsync(final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaCatalogDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaCatalogDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaCatalogDnsSuffix}", this.client.getAdlaCatalogDnsSuffix()); + Call call = service.listDatabases(filter, top, skip, expand, select, orderby, count, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listDatabasesDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listDatabasesNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listDatabasesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the list of external data sources from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlExternalDataSource> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listExternalDataSourcesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + Call call = service.listExternalDataSourcesNext(nextPageLink, this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return listExternalDataSourcesNextDelegate(call.execute()); + } + + /** + * Retrieves the list of external data sources from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listExternalDataSourcesNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (nextPageLink == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + Call call = service.listExternalDataSourcesNext(nextPageLink, this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + serviceCall.newCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listExternalDataSourcesNextDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listExternalDataSourcesNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listExternalDataSourcesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the list of credentials from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlCredential> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listCredentialsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + Call call = service.listCredentialsNext(nextPageLink, this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return listCredentialsNextDelegate(call.execute()); + } + + /** + * Retrieves the list of credentials from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listCredentialsNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (nextPageLink == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + Call call = service.listCredentialsNext(nextPageLink, this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + serviceCall.newCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listCredentialsNextDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listCredentialsNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listCredentialsNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the list of procedures from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlProcedure> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listProceduresNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + Call call = service.listProceduresNext(nextPageLink, this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return listProceduresNextDelegate(call.execute()); + } + + /** + * Retrieves the list of procedures from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listProceduresNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (nextPageLink == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + Call call = service.listProceduresNext(nextPageLink, this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + serviceCall.newCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listProceduresNextDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listProceduresNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listProceduresNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the list of tables from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlTable> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listTablesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + Call call = service.listTablesNext(nextPageLink, this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return listTablesNextDelegate(call.execute()); + } + + /** + * Retrieves the list of tables from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listTablesNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (nextPageLink == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + Call call = service.listTablesNext(nextPageLink, this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + serviceCall.newCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listTablesNextDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listTablesNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listTablesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the list of views from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlView> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listViewsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + Call call = service.listViewsNext(nextPageLink, this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return listViewsNextDelegate(call.execute()); + } + + /** + * Retrieves the list of views from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listViewsNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (nextPageLink == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + Call call = service.listViewsNext(nextPageLink, this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + serviceCall.newCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listViewsNextDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listViewsNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listViewsNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the list of tables from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlTableStatistics> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listTableStatisticsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + Call call = service.listTableStatisticsNext(nextPageLink, this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return listTableStatisticsNextDelegate(call.execute()); + } + + /** + * Retrieves the list of tables from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listTableStatisticsNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (nextPageLink == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + Call call = service.listTableStatisticsNext(nextPageLink, this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + serviceCall.newCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listTableStatisticsNextDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listTableStatisticsNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listTableStatisticsNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the list of types within the specified database and schema from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlType> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listTypesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + Call call = service.listTypesNext(nextPageLink, this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return listTypesNextDelegate(call.execute()); + } + + /** + * Retrieves the list of types within the specified database and schema from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listTypesNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (nextPageLink == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + Call call = service.listTypesNext(nextPageLink, this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + serviceCall.newCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listTypesNextDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listTypesNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listTypesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the list of table valued functions from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlTableValuedFunction> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listTableValuedFunctionsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + Call call = service.listTableValuedFunctionsNext(nextPageLink, this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return listTableValuedFunctionsNextDelegate(call.execute()); + } + + /** + * Retrieves the list of table valued functions from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listTableValuedFunctionsNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (nextPageLink == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + Call call = service.listTableValuedFunctionsNext(nextPageLink, this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + serviceCall.newCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listTableValuedFunctionsNextDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listTableValuedFunctionsNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listTableValuedFunctionsNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the list of assemblies from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlAssemblyClr> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listAssembliesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + Call call = service.listAssembliesNext(nextPageLink, this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return listAssembliesNextDelegate(call.execute()); + } + + /** + * Retrieves the list of assemblies from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listAssembliesNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (nextPageLink == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + Call call = service.listAssembliesNext(nextPageLink, this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + serviceCall.newCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listAssembliesNextDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listAssembliesNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listAssembliesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the list of schemas from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlSchema> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listSchemasNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + Call call = service.listSchemasNext(nextPageLink, this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return listSchemasNextDelegate(call.execute()); + } + + /** + * Retrieves the list of schemas from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listSchemasNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (nextPageLink == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + Call call = service.listSchemasNext(nextPageLink, this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + serviceCall.newCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listSchemasNextDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listSchemasNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listSchemasNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves the list of databases from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<USqlDatabase> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listDatabasesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + Call call = service.listDatabasesNext(nextPageLink, this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return listDatabasesNextDelegate(call.execute()); + } + + /** + * Retrieves the list of databases from the Data Lake Analytics catalog. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listDatabasesNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (nextPageLink == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + Call call = service.listDatabasesNext(nextPageLink, this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + serviceCall.newCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listDatabasesNextDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listDatabasesNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listDatabasesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsAccountManagementClient.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsAccountManagementClient.java new file mode 100644 index 000000000000..daf1d8ab6e34 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsAccountManagementClient.java @@ -0,0 +1,135 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics; + +import com.microsoft.azure.AzureClient; +import com.microsoft.rest.AutoRestBaseUrl; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.serializer.JacksonMapperAdapter; +import java.util.List; +import okhttp3.Interceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; + +/** + * The interface for DataLakeAnalyticsAccountManagementClient class. + */ +public interface DataLakeAnalyticsAccountManagementClient { + /** + * Gets the URL used as the base for all cloud service requests. + * + * @return the BaseUrl object. + */ + AutoRestBaseUrl getBaseUrl(); + + /** + * Gets the list of interceptors the OkHttp client will execute. + * @return the list of interceptors. + */ + List getClientInterceptors(); + + /** + * Sets the logging level for OkHttp client. + * + * @param logLevel the logging level enum. + */ + void setLogLevel(Level logLevel); + + /** + * Gets the adapter for {@link com.fasterxml.jackson.databind.ObjectMapper} for serialization + * and deserialization operations.. + * + * @return the adapter. + */ + JacksonMapperAdapter getMapperAdapter(); + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + AzureClient getAzureClient(); + + /** + * Gets Gets Azure subscription credentials.. + * + * @return the credentials value. + */ + ServiceClientCredentials getCredentials(); + + /** + * Gets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Sets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.. + * + * @param subscriptionId the subscriptionId value. + */ + void setSubscriptionId(String subscriptionId); + + /** + * Gets Client Api Version.. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets Gets or sets the preferred language for the response.. + * + * @return the acceptLanguage value. + */ + String getAcceptLanguage(); + + /** + * Sets Gets or sets the preferred language for the response.. + * + * @param acceptLanguage the acceptLanguage value. + */ + void setAcceptLanguage(String acceptLanguage); + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @return the longRunningOperationRetryTimeout value. + */ + int getLongRunningOperationRetryTimeout(); + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + */ + void setLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout); + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @return the generateClientRequestId value. + */ + boolean getGenerateClientRequestId(); + + /** + * 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. + */ + void setGenerateClientRequestId(boolean generateClientRequestId); + + /** + * Gets the AccountOperations object to access its operations. + * @return the AccountOperations object. + */ + AccountOperations getAccountOperations(); + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsAccountManagementClientImpl.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsAccountManagementClientImpl.java new file mode 100644 index 000000000000..2d3d45337fc6 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsAccountManagementClientImpl.java @@ -0,0 +1,216 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.CustomHeaderInterceptor; +import com.microsoft.rest.AutoRestBaseUrl; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import java.util.UUID; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; + +/** + * Initializes a new instance of the DataLakeAnalyticsAccountManagementClient class. + */ +public final class DataLakeAnalyticsAccountManagementClientImpl extends AzureServiceClient implements DataLakeAnalyticsAccountManagementClient { + /** The URL used as the base for all cloud service requests. */ + private final AutoRestBaseUrl baseUrl; + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the URL used as the base for all cloud service requests. + * + * @return The BaseUrl value. + */ + public AutoRestBaseUrl getBaseUrl() { + return this.baseUrl; + } + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets Azure subscription credentials. */ + private ServiceClientCredentials credentials; + + /** + * Gets Gets Azure subscription credentials. + * + * @return the credentials value. + */ + public ServiceClientCredentials getCredentials() { + return this.credentials; + } + + /** Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + */ + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + /** Client Api Version. */ + private String apiVersion; + + /** + * Gets Client Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** 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 getAcceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + */ + public void setAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + } + + /** 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 getLongRunningOperationRetryTimeout() { + 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. + */ + public void setLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + } + + /** 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 getGenerateClientRequestId() { + 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. + */ + public void setGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + } + + /** + * Gets the AccountOperations object to access its operations. + * @return the AccountOperations object. + */ + public AccountOperations getAccountOperations() { + return new AccountOperationsImpl(this.retrofitBuilder.client(clientBuilder.build()).build(), this); + } + + /** + * Initializes an instance of DataLakeAnalyticsAccountManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public DataLakeAnalyticsAccountManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of DataLakeAnalyticsAccountManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public DataLakeAnalyticsAccountManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(); + this.baseUrl = new AutoRestBaseUrl(baseUrl); + this.credentials = credentials; + initialize(); + } + + /** + * Initializes an instance of DataLakeAnalyticsAccountManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + * @param clientBuilder the builder for building up an {@link OkHttpClient} + * @param retrofitBuilder the builder for building up a {@link Retrofit} + */ + public DataLakeAnalyticsAccountManagementClientImpl(String baseUrl, ServiceClientCredentials credentials, OkHttpClient.Builder clientBuilder, Retrofit.Builder retrofitBuilder) { + super(clientBuilder, retrofitBuilder); + this.baseUrl = new AutoRestBaseUrl(baseUrl); + this.credentials = credentials; + initialize(); + } + + @Override + protected void initialize() { + this.apiVersion = "2015-10-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.clientBuilder.interceptors().add(new CustomHeaderInterceptor("x-ms-client-request-id", UUID.randomUUID().toString())); + if (this.credentials != null) { + this.credentials.applyCredentialsFilter(clientBuilder); + } + super.initialize(); + this.azureClient = new AzureClient(clientBuilder, retrofitBuilder, mapperAdapter); + this.azureClient.setCredentials(this.credentials); + this.retrofitBuilder.baseUrl(baseUrl); + } +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsCatalogManagementClient.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsCatalogManagementClient.java new file mode 100644 index 000000000000..3f2524eb5f2d --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsCatalogManagementClient.java @@ -0,0 +1,149 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics; + +import com.microsoft.azure.AzureClient; +import com.microsoft.rest.AutoRestBaseUrl; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.serializer.JacksonMapperAdapter; +import java.util.List; +import okhttp3.Interceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; + +/** + * The interface for DataLakeAnalyticsCatalogManagementClient class. + */ +public interface DataLakeAnalyticsCatalogManagementClient { + /** + * Gets the URL used as the base for all cloud service requests. + * + * @return the BaseUrl object. + */ + AutoRestBaseUrl getBaseUrl(); + + /** + * Gets the list of interceptors the OkHttp client will execute. + * @return the list of interceptors. + */ + List getClientInterceptors(); + + /** + * Sets the logging level for OkHttp client. + * + * @param logLevel the logging level enum. + */ + void setLogLevel(Level logLevel); + + /** + * Gets the adapter for {@link com.fasterxml.jackson.databind.ObjectMapper} for serialization + * and deserialization operations.. + * + * @return the adapter. + */ + JacksonMapperAdapter getMapperAdapter(); + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + AzureClient getAzureClient(); + + /** + * Gets Gets Azure subscription credentials.. + * + * @return the credentials value. + */ + ServiceClientCredentials getCredentials(); + + /** + * Gets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Sets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.. + * + * @param subscriptionId the subscriptionId value. + */ + void setSubscriptionId(String subscriptionId); + + /** + * Gets Client Api Version.. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets Gets the DNS suffix used as the base for all Azure Data Lake Analytics Catalog service requests.. + * + * @return the adlaCatalogDnsSuffix value. + */ + String getAdlaCatalogDnsSuffix(); + + /** + * Sets Gets the DNS suffix used as the base for all Azure Data Lake Analytics Catalog service requests.. + * + * @param adlaCatalogDnsSuffix the adlaCatalogDnsSuffix value. + */ + void setAdlaCatalogDnsSuffix(String adlaCatalogDnsSuffix); + + /** + * Gets Gets or sets the preferred language for the response.. + * + * @return the acceptLanguage value. + */ + String getAcceptLanguage(); + + /** + * Sets Gets or sets the preferred language for the response.. + * + * @param acceptLanguage the acceptLanguage value. + */ + void setAcceptLanguage(String acceptLanguage); + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @return the longRunningOperationRetryTimeout value. + */ + int getLongRunningOperationRetryTimeout(); + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + */ + void setLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout); + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @return the generateClientRequestId value. + */ + boolean getGenerateClientRequestId(); + + /** + * 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. + */ + void setGenerateClientRequestId(boolean generateClientRequestId); + + /** + * Gets the CatalogOperations object to access its operations. + * @return the CatalogOperations object. + */ + CatalogOperations getCatalogOperations(); + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsCatalogManagementClientImpl.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsCatalogManagementClientImpl.java new file mode 100644 index 000000000000..e278937ff66c --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsCatalogManagementClientImpl.java @@ -0,0 +1,237 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.CustomHeaderInterceptor; +import com.microsoft.rest.AutoRestBaseUrl; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import java.util.UUID; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; + +/** + * Initializes a new instance of the DataLakeAnalyticsCatalogManagementClient class. + */ +public final class DataLakeAnalyticsCatalogManagementClientImpl extends AzureServiceClient implements DataLakeAnalyticsCatalogManagementClient { + /** The URL used as the base for all cloud service requests. */ + private final AutoRestBaseUrl baseUrl; + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the URL used as the base for all cloud service requests. + * + * @return The BaseUrl value. + */ + public AutoRestBaseUrl getBaseUrl() { + return this.baseUrl; + } + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets Azure subscription credentials. */ + private ServiceClientCredentials credentials; + + /** + * Gets Gets Azure subscription credentials. + * + * @return the credentials value. + */ + public ServiceClientCredentials getCredentials() { + return this.credentials; + } + + /** Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + */ + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + /** Client Api Version. */ + private String apiVersion; + + /** + * Gets Client Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** Gets the DNS suffix used as the base for all Azure Data Lake Analytics Catalog service requests. */ + private String adlaCatalogDnsSuffix; + + /** + * Gets Gets the DNS suffix used as the base for all Azure Data Lake Analytics Catalog service requests. + * + * @return the adlaCatalogDnsSuffix value. + */ + public String getAdlaCatalogDnsSuffix() { + return this.adlaCatalogDnsSuffix; + } + + /** + * Sets Gets the DNS suffix used as the base for all Azure Data Lake Analytics Catalog service requests. + * + * @param adlaCatalogDnsSuffix the adlaCatalogDnsSuffix value. + */ + public void setAdlaCatalogDnsSuffix(String adlaCatalogDnsSuffix) { + this.adlaCatalogDnsSuffix = adlaCatalogDnsSuffix; + } + + /** 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 getAcceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + */ + public void setAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + } + + /** 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 getLongRunningOperationRetryTimeout() { + 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. + */ + public void setLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + } + + /** 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 getGenerateClientRequestId() { + 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. + */ + public void setGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + } + + /** + * Gets the CatalogOperations object to access its operations. + * @return the CatalogOperations object. + */ + public CatalogOperations getCatalogOperations() { + return new CatalogOperationsImpl(this.retrofitBuilder.client(clientBuilder.build()).build(), this); + } + + /** + * Initializes an instance of DataLakeAnalyticsCatalogManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public DataLakeAnalyticsCatalogManagementClientImpl(ServiceClientCredentials credentials) { + this("https://{accountName}.{adlaCatalogDnsSuffix}", credentials); + } + + /** + * Initializes an instance of DataLakeAnalyticsCatalogManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + private DataLakeAnalyticsCatalogManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(); + this.baseUrl = new AutoRestBaseUrl(baseUrl); + this.credentials = credentials; + initialize(); + } + + /** + * Initializes an instance of DataLakeAnalyticsCatalogManagementClient client. + * + * @param credentials the management credentials for Azure + * @param clientBuilder the builder for building up an {@link OkHttpClient} + * @param retrofitBuilder the builder for building up a {@link Retrofit} + */ + public DataLakeAnalyticsCatalogManagementClientImpl(ServiceClientCredentials credentials, OkHttpClient.Builder clientBuilder, Retrofit.Builder retrofitBuilder) { + super(clientBuilder, retrofitBuilder); + this.baseUrl = new AutoRestBaseUrl("https://{accountName}.{adlaCatalogDnsSuffix}"); + this.credentials = credentials; + initialize(); + } + + @Override + protected void initialize() { + this.apiVersion = "2015-10-01-preview"; + this.adlaCatalogDnsSuffix = "azuredatalakeanalytics.net"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.clientBuilder.interceptors().add(new CustomHeaderInterceptor("x-ms-client-request-id", UUID.randomUUID().toString())); + if (this.credentials != null) { + this.credentials.applyCredentialsFilter(clientBuilder); + } + super.initialize(); + this.azureClient = new AzureClient(clientBuilder, retrofitBuilder, mapperAdapter); + this.azureClient.setCredentials(this.credentials); + this.retrofitBuilder.baseUrl(baseUrl); + } +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsJobManagementClient.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsJobManagementClient.java new file mode 100644 index 000000000000..01d122b6cef8 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsJobManagementClient.java @@ -0,0 +1,149 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics; + +import com.microsoft.azure.AzureClient; +import com.microsoft.rest.AutoRestBaseUrl; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.serializer.JacksonMapperAdapter; +import java.util.List; +import okhttp3.Interceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; + +/** + * The interface for DataLakeAnalyticsJobManagementClient class. + */ +public interface DataLakeAnalyticsJobManagementClient { + /** + * Gets the URL used as the base for all cloud service requests. + * + * @return the BaseUrl object. + */ + AutoRestBaseUrl getBaseUrl(); + + /** + * Gets the list of interceptors the OkHttp client will execute. + * @return the list of interceptors. + */ + List getClientInterceptors(); + + /** + * Sets the logging level for OkHttp client. + * + * @param logLevel the logging level enum. + */ + void setLogLevel(Level logLevel); + + /** + * Gets the adapter for {@link com.fasterxml.jackson.databind.ObjectMapper} for serialization + * and deserialization operations.. + * + * @return the adapter. + */ + JacksonMapperAdapter getMapperAdapter(); + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + AzureClient getAzureClient(); + + /** + * Gets Gets Azure subscription credentials.. + * + * @return the credentials value. + */ + ServiceClientCredentials getCredentials(); + + /** + * Gets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Sets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.. + * + * @param subscriptionId the subscriptionId value. + */ + void setSubscriptionId(String subscriptionId); + + /** + * Gets Client Api Version.. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets Gets the DNS suffix used as the base for all Azure Data Lake Analytics Job service requests.. + * + * @return the adlaJobDnsSuffix value. + */ + String getAdlaJobDnsSuffix(); + + /** + * Sets Gets the DNS suffix used as the base for all Azure Data Lake Analytics Job service requests.. + * + * @param adlaJobDnsSuffix the adlaJobDnsSuffix value. + */ + void setAdlaJobDnsSuffix(String adlaJobDnsSuffix); + + /** + * Gets Gets or sets the preferred language for the response.. + * + * @return the acceptLanguage value. + */ + String getAcceptLanguage(); + + /** + * Sets Gets or sets the preferred language for the response.. + * + * @param acceptLanguage the acceptLanguage value. + */ + void setAcceptLanguage(String acceptLanguage); + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @return the longRunningOperationRetryTimeout value. + */ + int getLongRunningOperationRetryTimeout(); + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + */ + void setLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout); + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @return the generateClientRequestId value. + */ + boolean getGenerateClientRequestId(); + + /** + * 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. + */ + void setGenerateClientRequestId(boolean generateClientRequestId); + + /** + * Gets the JobOperations object to access its operations. + * @return the JobOperations object. + */ + JobOperations getJobOperations(); + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsJobManagementClientImpl.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsJobManagementClientImpl.java new file mode 100644 index 000000000000..30f6ea227073 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsJobManagementClientImpl.java @@ -0,0 +1,237 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.CustomHeaderInterceptor; +import com.microsoft.rest.AutoRestBaseUrl; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import java.util.UUID; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; + +/** + * Initializes a new instance of the DataLakeAnalyticsJobManagementClient class. + */ +public final class DataLakeAnalyticsJobManagementClientImpl extends AzureServiceClient implements DataLakeAnalyticsJobManagementClient { + /** The URL used as the base for all cloud service requests. */ + private final AutoRestBaseUrl baseUrl; + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the URL used as the base for all cloud service requests. + * + * @return The BaseUrl value. + */ + public AutoRestBaseUrl getBaseUrl() { + return this.baseUrl; + } + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets Azure subscription credentials. */ + private ServiceClientCredentials credentials; + + /** + * Gets Gets Azure subscription credentials. + * + * @return the credentials value. + */ + public ServiceClientCredentials getCredentials() { + return this.credentials; + } + + /** Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + */ + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + /** Client Api Version. */ + private String apiVersion; + + /** + * Gets Client Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** Gets the DNS suffix used as the base for all Azure Data Lake Analytics Job service requests. */ + private String adlaJobDnsSuffix; + + /** + * Gets Gets the DNS suffix used as the base for all Azure Data Lake Analytics Job service requests. + * + * @return the adlaJobDnsSuffix value. + */ + public String getAdlaJobDnsSuffix() { + return this.adlaJobDnsSuffix; + } + + /** + * Sets Gets the DNS suffix used as the base for all Azure Data Lake Analytics Job service requests. + * + * @param adlaJobDnsSuffix the adlaJobDnsSuffix value. + */ + public void setAdlaJobDnsSuffix(String adlaJobDnsSuffix) { + this.adlaJobDnsSuffix = adlaJobDnsSuffix; + } + + /** 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 getAcceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + */ + public void setAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + } + + /** 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 getLongRunningOperationRetryTimeout() { + 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. + */ + public void setLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + } + + /** 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 getGenerateClientRequestId() { + 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. + */ + public void setGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + } + + /** + * Gets the JobOperations object to access its operations. + * @return the JobOperations object. + */ + public JobOperations getJobOperations() { + return new JobOperationsImpl(this.retrofitBuilder.client(clientBuilder.build()).build(), this); + } + + /** + * Initializes an instance of DataLakeAnalyticsJobManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public DataLakeAnalyticsJobManagementClientImpl(ServiceClientCredentials credentials) { + this("https://{accountName}.{adlaJobDnsSuffix}", credentials); + } + + /** + * Initializes an instance of DataLakeAnalyticsJobManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + private DataLakeAnalyticsJobManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(); + this.baseUrl = new AutoRestBaseUrl(baseUrl); + this.credentials = credentials; + initialize(); + } + + /** + * Initializes an instance of DataLakeAnalyticsJobManagementClient client. + * + * @param credentials the management credentials for Azure + * @param clientBuilder the builder for building up an {@link OkHttpClient} + * @param retrofitBuilder the builder for building up a {@link Retrofit} + */ + public DataLakeAnalyticsJobManagementClientImpl(ServiceClientCredentials credentials, OkHttpClient.Builder clientBuilder, Retrofit.Builder retrofitBuilder) { + super(clientBuilder, retrofitBuilder); + this.baseUrl = new AutoRestBaseUrl("https://{accountName}.{adlaJobDnsSuffix}"); + this.credentials = credentials; + initialize(); + } + + @Override + protected void initialize() { + this.apiVersion = "2015-11-01-preview"; + this.adlaJobDnsSuffix = "azuredatalakeanalytics.net"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.clientBuilder.interceptors().add(new CustomHeaderInterceptor("x-ms-client-request-id", UUID.randomUUID().toString())); + if (this.credentials != null) { + this.credentials.applyCredentialsFilter(clientBuilder); + } + super.initialize(); + this.azureClient = new AzureClient(clientBuilder, retrofitBuilder, mapperAdapter); + this.azureClient.setCredentials(this.credentials); + this.retrofitBuilder.baseUrl(baseUrl); + } +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/JobOperations.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/JobOperations.java new file mode 100644 index 000000000000..734034473dec --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/JobOperations.java @@ -0,0 +1,252 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics; + +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.datalake.analytics.models.JobDataPath; +import com.microsoft.azure.management.datalake.analytics.models.JobInformation; +import com.microsoft.azure.management.datalake.analytics.models.JobStatistics; +import com.microsoft.azure.management.datalake.analytics.models.PageImpl; +import com.microsoft.rest.ServiceCall; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import java.util.UUID; + +/** + * An instance of this class provides access to all the operations defined + * in JobOperations. + */ +public interface JobOperations { + /** + * Gets statistics of the specified job. + * + * @param jobIdentity JobInfo ID. + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the JobStatistics object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getStatistics(UUID jobIdentity, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets statistics of the specified job. + * + * @param jobIdentity JobInfo ID. + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getStatisticsAsync(UUID jobIdentity, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Gets the U-SQL job debug data information specified by the job ID. + * + * @param jobIdentity JobInfo ID. + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the JobDataPath object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getDebugDataPath(UUID jobIdentity, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the U-SQL job debug data information specified by the job ID. + * + * @param jobIdentity JobInfo ID. + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getDebugDataPathAsync(UUID jobIdentity, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Builds (compiles) the specified job in the specified Data Lake Analytics account for job correctness and validation. + * + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @param parameters The parameters to build a job. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the JobInformation object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse build(String accountName, JobInformation parameters) throws CloudException, IOException, IllegalArgumentException; + + /** + * Builds (compiles) the specified job in the specified Data Lake Analytics account for job correctness and validation. + * + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @param parameters The parameters to build a job. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall buildAsync(String accountName, JobInformation parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Cancels the running job specified by the job ID. + * + * @param jobIdentity JobInfo ID to cancel. + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse cancel(UUID jobIdentity, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Cancels the running job specified by the job ID. + * + * @param jobIdentity JobInfo ID to cancel. + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall cancelAsync(UUID jobIdentity, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Gets the job information for the specified job ID. + * + * @param jobIdentity JobInfo ID. + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the JobInformation object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse get(UUID jobIdentity, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the job information for the specified job ID. + * + * @param jobIdentity JobInfo ID. + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getAsync(UUID jobIdentity, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Submits a job to the specified Data Lake Analytics account. + * + * @param jobIdentity The job ID (a GUID) for the job being submitted. + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @param parameters The parameters to submit a job. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the JobInformation object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse create(UUID jobIdentity, String accountName, JobInformation parameters) throws CloudException, IOException, IllegalArgumentException; + + /** + * Submits a job to the specified Data Lake Analytics account. + * + * @param jobIdentity The job ID (a GUID) for the job being submitted. + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @param parameters The parameters to submit a job. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall createAsync(UUID jobIdentity, String accountName, JobInformation parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Lists the jobs, if any, associated with the specified Data Lake Analytics account. The response includes a link to the next page of results, if any. + * + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<JobInformation> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> list(final String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Lists the jobs, if any, associated with the specified Data Lake Analytics account. The response includes a link to the next page of results, if any. + * + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listAsync(final String accountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + /** + * Lists the jobs, if any, associated with the specified Data Lake Analytics account. The response includes a link to the next page of results, if any. + * + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<JobInformation> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> list(final String accountName, final JobInformation filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) throws CloudException, IOException, IllegalArgumentException; + + /** + * Lists the jobs, if any, associated with the specified Data Lake Analytics account. The response includes a link to the next page of results, if any. + * + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listAsync(final String accountName, final JobInformation filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Lists the jobs, if any, associated with the specified Data Lake Analytics account. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<JobInformation> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException; + + /** + * Lists the jobs, if any, associated with the specified Data Lake Analytics account. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/JobOperationsImpl.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/JobOperationsImpl.java new file mode 100644 index 000000000000..3bfea469dde2 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/JobOperationsImpl.java @@ -0,0 +1,936 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics; + +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceResponseBuilder; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.datalake.analytics.models.JobDataPath; +import com.microsoft.azure.management.datalake.analytics.models.JobInformation; +import com.microsoft.azure.management.datalake.analytics.models.JobStatistics; +import com.microsoft.azure.management.datalake.analytics.models.PageImpl; +import com.microsoft.rest.ServiceCall; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseCallback; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.UUID; +import okhttp3.ResponseBody; +import retrofit2.Call; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import retrofit2.Retrofit; + +/** + * An instance of this class provides access to all the operations defined + * in JobOperations. + */ +public final class JobOperationsImpl implements JobOperations { + /** The Retrofit service to perform REST calls. */ + private JobService service; + /** The service client containing this operation class. */ + private DataLakeAnalyticsJobManagementClient client; + + /** + * Initializes an instance of JobOperations. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public JobOperationsImpl(Retrofit retrofit, DataLakeAnalyticsJobManagementClient client) { + this.service = retrofit.create(JobService.class); + this.client = client; + } + + /** + * The interface defining all the services for JobOperations to be + * used by Retrofit to perform actually REST calls. + */ + interface JobService { + @Headers("Content-Type: application/json; charset=utf-8") + @POST("Jobs/{jobIdentity}/GetStatistics") + Call getStatistics(@Path("jobIdentity") UUID jobIdentity, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @POST("Jobs/{jobIdentity}/GetDebugDataPath") + Call getDebugDataPath(@Path("jobIdentity") UUID jobIdentity, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @POST("BuildJob") + Call build(@Body JobInformation parameters, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @POST("Jobs/{jobIdentity}/CancelJob") + Call cancel(@Path("jobIdentity") UUID jobIdentity, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("Jobs/{jobIdentity}") + Call get(@Path("jobIdentity") UUID jobIdentity, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @PUT("Jobs/{jobIdentity}") + Call create(@Path("jobIdentity") UUID jobIdentity, @Body JobInformation parameters, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("Jobs") + Call list(@Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$expand") String expand, @Query("$select") String select, @Query("$orderby") String orderby, @Query("$count") Boolean count, @Query("$search") String search, @Query("$format") String format, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET + Call listNext(@Url String nextPageLink, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + } + + /** + * Gets statistics of the specified job. + * + * @param jobIdentity JobInfo ID. + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the JobStatistics object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getStatistics(UUID jobIdentity, String accountName) throws CloudException, IOException, IllegalArgumentException { + if (jobIdentity == null) { + throw new IllegalArgumentException("Parameter jobIdentity is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaJobDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaJobDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaJobDnsSuffix}", this.client.getAdlaJobDnsSuffix()); + Call call = service.getStatistics(jobIdentity, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return getStatisticsDelegate(call.execute()); + } + + /** + * Gets statistics of the specified job. + * + * @param jobIdentity JobInfo ID. + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getStatisticsAsync(UUID jobIdentity, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (jobIdentity == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter jobIdentity is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaJobDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaJobDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaJobDnsSuffix}", this.client.getAdlaJobDnsSuffix()); + Call call = service.getStatistics(jobIdentity, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getStatisticsDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getStatisticsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the U-SQL job debug data information specified by the job ID. + * + * @param jobIdentity JobInfo ID. + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the JobDataPath object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getDebugDataPath(UUID jobIdentity, String accountName) throws CloudException, IOException, IllegalArgumentException { + if (jobIdentity == null) { + throw new IllegalArgumentException("Parameter jobIdentity is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaJobDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaJobDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaJobDnsSuffix}", this.client.getAdlaJobDnsSuffix()); + Call call = service.getDebugDataPath(jobIdentity, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return getDebugDataPathDelegate(call.execute()); + } + + /** + * Gets the U-SQL job debug data information specified by the job ID. + * + * @param jobIdentity JobInfo ID. + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getDebugDataPathAsync(UUID jobIdentity, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (jobIdentity == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter jobIdentity is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaJobDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaJobDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaJobDnsSuffix}", this.client.getAdlaJobDnsSuffix()); + Call call = service.getDebugDataPath(jobIdentity, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getDebugDataPathDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getDebugDataPathDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Builds (compiles) the specified job in the specified Data Lake Analytics account for job correctness and validation. + * + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @param parameters The parameters to build a job. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the JobInformation object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse build(String accountName, JobInformation parameters) throws CloudException, IOException, IllegalArgumentException { + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaJobDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaJobDnsSuffix() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + Validator.validate(parameters); + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaJobDnsSuffix}", this.client.getAdlaJobDnsSuffix()); + Call call = service.build(parameters, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return buildDelegate(call.execute()); + } + + /** + * Builds (compiles) the specified job in the specified Data Lake Analytics account for job correctness and validation. + * + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @param parameters The parameters to build a job. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall buildAsync(String accountName, JobInformation parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaJobDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaJobDnsSuffix() is required and cannot be null.")); + return null; + } + if (parameters == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + Validator.validate(parameters, serviceCallback); + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaJobDnsSuffix}", this.client.getAdlaJobDnsSuffix()); + Call call = service.build(parameters, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(buildDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse buildDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Cancels the running job specified by the job ID. + * + * @param jobIdentity JobInfo ID to cancel. + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse cancel(UUID jobIdentity, String accountName) throws CloudException, IOException, IllegalArgumentException { + if (jobIdentity == null) { + throw new IllegalArgumentException("Parameter jobIdentity is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaJobDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaJobDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaJobDnsSuffix}", this.client.getAdlaJobDnsSuffix()); + Call call = service.cancel(jobIdentity, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return cancelDelegate(call.execute()); + } + + /** + * Cancels the running job specified by the job ID. + * + * @param jobIdentity JobInfo ID to cancel. + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall cancelAsync(UUID jobIdentity, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (jobIdentity == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter jobIdentity is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaJobDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaJobDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaJobDnsSuffix}", this.client.getAdlaJobDnsSuffix()); + Call call = service.cancel(jobIdentity, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(cancelDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse cancelDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Gets the job information for the specified job ID. + * + * @param jobIdentity JobInfo ID. + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the JobInformation object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse get(UUID jobIdentity, String accountName) throws CloudException, IOException, IllegalArgumentException { + if (jobIdentity == null) { + throw new IllegalArgumentException("Parameter jobIdentity is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaJobDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaJobDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaJobDnsSuffix}", this.client.getAdlaJobDnsSuffix()); + Call call = service.get(jobIdentity, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return getDelegate(call.execute()); + } + + /** + * Gets the job information for the specified job ID. + * + * @param jobIdentity JobInfo ID. + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getAsync(UUID jobIdentity, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (jobIdentity == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter jobIdentity is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaJobDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaJobDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaJobDnsSuffix}", this.client.getAdlaJobDnsSuffix()); + Call call = service.get(jobIdentity, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Submits a job to the specified Data Lake Analytics account. + * + * @param jobIdentity The job ID (a GUID) for the job being submitted. + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @param parameters The parameters to submit a job. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the JobInformation object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse create(UUID jobIdentity, String accountName, JobInformation parameters) throws CloudException, IOException, IllegalArgumentException { + if (jobIdentity == null) { + throw new IllegalArgumentException("Parameter jobIdentity is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaJobDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaJobDnsSuffix() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + Validator.validate(parameters); + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaJobDnsSuffix}", this.client.getAdlaJobDnsSuffix()); + Call call = service.create(jobIdentity, parameters, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return createDelegate(call.execute()); + } + + /** + * Submits a job to the specified Data Lake Analytics account. + * + * @param jobIdentity The job ID (a GUID) for the job being submitted. + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @param parameters The parameters to submit a job. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall createAsync(UUID jobIdentity, String accountName, JobInformation parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (jobIdentity == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter jobIdentity is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaJobDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaJobDnsSuffix() is required and cannot be null.")); + return null; + } + if (parameters == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + Validator.validate(parameters, serviceCallback); + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaJobDnsSuffix}", this.client.getAdlaJobDnsSuffix()); + Call call = service.create(jobIdentity, parameters, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(createDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse createDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the jobs, if any, associated with the specified Data Lake Analytics account. The response includes a link to the next page of results, if any. + * + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<JobInformation> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> list(final String accountName) throws CloudException, IOException, IllegalArgumentException { + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaJobDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaJobDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + JobInformation filter = null; + Integer top = null; + Integer skip = null; + String expand = null; + String select = null; + String orderby = null; + Boolean count = null; + String search = null; + String format = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaJobDnsSuffix}", this.client.getAdlaJobDnsSuffix()); + Call call = service.list(this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, search, format, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + ServiceResponse> response = listDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Lists the jobs, if any, associated with the specified Data Lake Analytics account. The response includes a link to the next page of results, if any. + * + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listAsync(final String accountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaJobDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaJobDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final JobInformation filter = null; + final Integer top = null; + final Integer skip = null; + final String expand = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + final String search = null; + final String format = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaJobDnsSuffix}", this.client.getAdlaJobDnsSuffix()); + Call call = service.list(this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, search, format, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Lists the jobs, if any, associated with the specified Data Lake Analytics account. The response includes a link to the next page of results, if any. + * + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<JobInformation> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> list(final String accountName, final JobInformation filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) throws CloudException, IOException, IllegalArgumentException { + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlaJobDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlaJobDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + Validator.validate(filter); + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaJobDnsSuffix}", this.client.getAdlaJobDnsSuffix()); + Call call = service.list(this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, search, format, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + ServiceResponse> response = listDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Lists the jobs, if any, associated with the specified Data Lake Analytics account. The response includes a link to the next page of results, if any. + * + * @param accountName The Azure Data Lake Analytics account to execute job operations on. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listAsync(final String accountName, final JobInformation filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlaJobDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlaJobDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + Validator.validate(filter, serviceCallback); + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlaJobDnsSuffix}", this.client.getAdlaJobDnsSuffix()); + Call call = service.list(this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, search, format, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the jobs, if any, associated with the specified Data Lake Analytics account. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<JobInformation> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + Call call = service.listNext(nextPageLink, this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return listNextDelegate(call.execute()); + } + + /** + * Lists the jobs, if any, associated with the specified Data Lake Analytics account. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (nextPageLink == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + Call call = service.listNext(nextPageLink, this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + serviceCall.newCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/AddDataLakeStoreParameters.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/AddDataLakeStoreParameters.java new file mode 100644 index 000000000000..7912d8ea8518 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/AddDataLakeStoreParameters.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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional Data Lake Store parameters. + */ +public class AddDataLakeStoreParameters { + /** + * Gets or sets the properties for the Data Lake Store account being added. + */ + @JsonProperty(required = true) + private DataLakeStoreAccountInfoProperties properties; + + /** + * Get the properties value. + * + * @return the properties value + */ + public DataLakeStoreAccountInfoProperties getProperties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + */ + public void setProperties(DataLakeStoreAccountInfoProperties properties) { + this.properties = properties; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/AddStorageAccountParameters.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/AddStorageAccountParameters.java new file mode 100644 index 000000000000..3cb858cef566 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/AddStorageAccountParameters.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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional Azure Storage account parameters. + */ +public class AddStorageAccountParameters { + /** + * Gets or sets the properties for the Azure Storage account being added. + */ + @JsonProperty(required = true) + private StorageAccountProperties properties; + + /** + * Get the properties value. + * + * @return the properties value + */ + public StorageAccountProperties getProperties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + */ + public void setProperties(StorageAccountProperties properties) { + this.properties = properties; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/AzureAsyncOperationResult.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/AzureAsyncOperationResult.java new file mode 100644 index 000000000000..4014993ff193 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/AzureAsyncOperationResult.java @@ -0,0 +1,57 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response body contains the status of the specified asynchronous + * operation, indicating whether it has succeeded, is inprogress, or has + * failed. Note that this status is distinct from the HTTP status code + * returned for the Get Operation Status operation itself. If the + * asynchronous operation succeeded, the response body includes the HTTP + * status code for the successful request. If the asynchronous operation + * failed, the response body includes the HTTP status code for the failed + * request and error information regarding the failure. + */ +public class AzureAsyncOperationResult { + /** + * Gets or sets the status of the AzureAsuncOperation. Possible values + * include: 'InProgress', 'Succeeded', 'Failed'. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private OperationStatus status; + + /** + * The error property. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Error error; + + /** + * Get the status value. + * + * @return the status value + */ + public OperationStatus getStatus() { + return this.status; + } + + /** + * Get the error value. + * + * @return the error value + */ + public Error getError() { + return this.error; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/BlobContainer.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/BlobContainer.java new file mode 100644 index 000000000000..02f930b3748e --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/BlobContainer.java @@ -0,0 +1,79 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure Storage blob container information. + */ +public class BlobContainer { + /** + * Gets or sets the name of the blob container. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Gets or sets the unique identifier of the blob container. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Gets or sets the type of the blob container. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Gets or sets the properties of the blob container. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private BlobContainerProperties properties; + + /** + * Get the name value. + * + * @return the name value + */ + public String getName() { + return this.name; + } + + /** + * Get the id value. + * + * @return the id value + */ + public String getId() { + return this.id; + } + + /** + * Get the type value. + * + * @return the type value + */ + public String getType() { + return this.type; + } + + /** + * Get the properties value. + * + * @return the properties value + */ + public BlobContainerProperties getProperties() { + return this.properties; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/BlobContainerProperties.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/BlobContainerProperties.java new file mode 100644 index 000000000000..f2f2c5765053 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/BlobContainerProperties.java @@ -0,0 +1,35 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure Storage blob container properties information. + */ +public class BlobContainerProperties { + /** + * Gets or sets the last modified time of the blob container. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModifiedTime; + + /** + * Get the lastModifiedTime value. + * + * @return the lastModifiedTime value + */ + public DateTime getLastModifiedTime() { + return this.lastModifiedTime; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/CatalogItem.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/CatalogItem.java new file mode 100644 index 000000000000..ddb453d36c38 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/CatalogItem.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import java.util.UUID; + +/** + * A Data Lake Analytics catalog item. + */ +public class CatalogItem { + /** + * Gets or sets the name of the Data Lake Analytics account. + */ + private String computeAccountName; + + /** + * Gets or sets the version of the catalog item. + */ + private UUID version; + + /** + * Get the computeAccountName value. + * + * @return the computeAccountName value + */ + public String getComputeAccountName() { + return this.computeAccountName; + } + + /** + * Set the computeAccountName value. + * + * @param computeAccountName the computeAccountName value to set + */ + public void setComputeAccountName(String computeAccountName) { + this.computeAccountName = computeAccountName; + } + + /** + * Get the version value. + * + * @return the version value + */ + public UUID getVersion() { + return this.version; + } + + /** + * Set the version value. + * + * @param version the version value to set + */ + public void setVersion(UUID version) { + this.version = version; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/CatalogItemList.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/CatalogItemList.java new file mode 100644 index 000000000000..9b96b0c5d695 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/CatalogItemList.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + + +/** + * A Data Lake Analytics catalog item list. + */ +public class CatalogItemList { + /** + * Gets or sets the count of items in the list. + */ + private Integer count; + + /** + * Gets or sets the link to the next page of results. + */ + private String nextLink; + + /** + * Get the count value. + * + * @return the count value + */ + public Integer getCount() { + return this.count; + } + + /** + * Set the count value. + * + * @param count the count value to set + */ + public void setCount(Integer count) { + this.count = count; + } + + /** + * Get the nextLink value. + * + * @return the nextLink value + */ + public String getNextLink() { + return this.nextLink; + } + + /** + * Set the nextLink value. + * + * @param nextLink the nextLink value to set + */ + public void setNextLink(String nextLink) { + this.nextLink = nextLink; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DataLakeAnalyticsAccount.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DataLakeAnalyticsAccount.java new file mode 100644 index 000000000000..25a3142e591e --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DataLakeAnalyticsAccount.java @@ -0,0 +1,144 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * A Data Lake Analytics account object, containing all information associated + * with the named Data Lake Analytics account. + */ +public class DataLakeAnalyticsAccount { + /** + * Gets or sets the account regional location. + */ + private String location; + + /** + * Gets or sets the account name. + */ + private String name; + + /** + * Gets or sets the namespace and type of the account. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Gets or sets the account subscription ID. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Gets or sets the value of custom properties. + */ + private Map tags; + + /** + * Gets or sets the properties defined by Data Lake Analytics all + * properties are specific to each resource provider. + */ + private DataLakeAnalyticsAccountProperties properties; + + /** + * Get the location value. + * + * @return the location value + */ + public String getLocation() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + */ + public void setLocation(String location) { + this.location = location; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String getName() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * Get the type value. + * + * @return the type value + */ + public String getType() { + return this.type; + } + + /** + * Get the id value. + * + * @return the id value + */ + public String getId() { + return this.id; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map getTags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + */ + public void setTags(Map tags) { + this.tags = tags; + } + + /** + * Get the properties value. + * + * @return the properties value + */ + public DataLakeAnalyticsAccountProperties getProperties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + */ + public void setProperties(DataLakeAnalyticsAccountProperties properties) { + this.properties = properties; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DataLakeAnalyticsAccountProperties.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DataLakeAnalyticsAccountProperties.java new file mode 100644 index 000000000000..1668945a443a --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DataLakeAnalyticsAccountProperties.java @@ -0,0 +1,220 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import org.joda.time.DateTime; + +/** + * The account specific properties that are associated with an underlying Data + * Lake Analytics account. + */ +public class DataLakeAnalyticsAccountProperties { + /** + * Gets the provisioning status of the Data Lake Analytics account. + * Possible values include: 'Failed', 'Creating', 'Running', 'Succeeded', + * 'Patching', 'Suspending', 'Resuming', 'Deleting', 'Deleted'. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private DataLakeAnalyticsAccountStatus provisioningState; + + /** + * Gets the state of the Data Lake Analytics account. Possible values + * include: 'active', 'suspended'. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private DataLakeAnalyticsAccountState state; + + /** + * Gets or sets the default data lake storage account associated with this + * Data Lake Analytics account. + */ + private String defaultDataLakeStoreAccount; + + /** + * Gets or sets the maximum supported degree of parallelism for this + * acocunt. + */ + private Integer maxDegreeOfParallelism; + + /** + * Gets or sets the maximum supported jobs running under the account at + * the same time. + */ + private Integer maxJobCount; + + /** + * Gets or sets the list of Data Lake storage accounts associated with + * this account. + */ + private List dataLakeStoreAccounts; + + /** + * Gets or sets the list of Azure Blob storage accounts associated with + * this account. + */ + private List storageAccounts; + + /** + * Gets or sets the account creation time. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationTime; + + /** + * Gets or sets the account last modified time. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModifiedTime; + + /** + * Gets or sets the full CName endpoint for this account. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String endpoint; + + /** + * Get the provisioningState value. + * + * @return the provisioningState value + */ + public DataLakeAnalyticsAccountStatus getProvisioningState() { + return this.provisioningState; + } + + /** + * Get the state value. + * + * @return the state value + */ + public DataLakeAnalyticsAccountState getState() { + return this.state; + } + + /** + * Get the defaultDataLakeStoreAccount value. + * + * @return the defaultDataLakeStoreAccount value + */ + public String getDefaultDataLakeStoreAccount() { + return this.defaultDataLakeStoreAccount; + } + + /** + * Set the defaultDataLakeStoreAccount value. + * + * @param defaultDataLakeStoreAccount the defaultDataLakeStoreAccount value to set + */ + public void setDefaultDataLakeStoreAccount(String defaultDataLakeStoreAccount) { + this.defaultDataLakeStoreAccount = defaultDataLakeStoreAccount; + } + + /** + * Get the maxDegreeOfParallelism value. + * + * @return the maxDegreeOfParallelism value + */ + public Integer getMaxDegreeOfParallelism() { + return this.maxDegreeOfParallelism; + } + + /** + * Set the maxDegreeOfParallelism value. + * + * @param maxDegreeOfParallelism the maxDegreeOfParallelism value to set + */ + public void setMaxDegreeOfParallelism(Integer maxDegreeOfParallelism) { + this.maxDegreeOfParallelism = maxDegreeOfParallelism; + } + + /** + * Get the maxJobCount value. + * + * @return the maxJobCount value + */ + public Integer getMaxJobCount() { + return this.maxJobCount; + } + + /** + * Set the maxJobCount value. + * + * @param maxJobCount the maxJobCount value to set + */ + public void setMaxJobCount(Integer maxJobCount) { + this.maxJobCount = maxJobCount; + } + + /** + * Get the dataLakeStoreAccounts value. + * + * @return the dataLakeStoreAccounts value + */ + public List getDataLakeStoreAccounts() { + return this.dataLakeStoreAccounts; + } + + /** + * Set the dataLakeStoreAccounts value. + * + * @param dataLakeStoreAccounts the dataLakeStoreAccounts value to set + */ + public void setDataLakeStoreAccounts(List dataLakeStoreAccounts) { + this.dataLakeStoreAccounts = dataLakeStoreAccounts; + } + + /** + * Get the storageAccounts value. + * + * @return the storageAccounts value + */ + public List getStorageAccounts() { + return this.storageAccounts; + } + + /** + * Set the storageAccounts value. + * + * @param storageAccounts the storageAccounts value to set + */ + public void setStorageAccounts(List storageAccounts) { + this.storageAccounts = storageAccounts; + } + + /** + * Get the creationTime value. + * + * @return the creationTime value + */ + public DateTime getCreationTime() { + return this.creationTime; + } + + /** + * Get the lastModifiedTime value. + * + * @return the lastModifiedTime value + */ + public DateTime getLastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the endpoint value. + * + * @return the endpoint value + */ + public String getEndpoint() { + return this.endpoint; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DataLakeAnalyticsAccountState.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DataLakeAnalyticsAccountState.java new file mode 100644 index 000000000000..5f62e8677281 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DataLakeAnalyticsAccountState.java @@ -0,0 +1,59 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DataLakeAnalyticsAccountState. + */ +public enum DataLakeAnalyticsAccountState { + /** Enum value active. */ + ACTIVE("active"), + + /** Enum value suspended. */ + SUSPENDED("suspended"); + + /** The actual serialized value for a DataLakeAnalyticsAccountState instance. */ + private String value; + + DataLakeAnalyticsAccountState(String value) { + this.value = value; + } + + /** + * Gets the serialized value for a DataLakeAnalyticsAccountState instance. + * + * @return the serialized value. + */ + @JsonValue + public String toValue() { + return this.value; + } + + /** + * Parses a serialized value to a DataLakeAnalyticsAccountState instance. + * + * @param value the serialized value to parse. + * @return the parsed DataLakeAnalyticsAccountState object, or null if unable to parse. + */ + @JsonCreator + public static DataLakeAnalyticsAccountState fromValue(String value) { + DataLakeAnalyticsAccountState[] items = DataLakeAnalyticsAccountState.values(); + for (DataLakeAnalyticsAccountState item : items) { + if (item.toValue().equals(value)) { + return item; + } + } + return null; + } +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DataLakeAnalyticsAccountStatus.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DataLakeAnalyticsAccountStatus.java new file mode 100644 index 000000000000..06229889fc0f --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DataLakeAnalyticsAccountStatus.java @@ -0,0 +1,80 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DataLakeAnalyticsAccountStatus. + */ +public enum DataLakeAnalyticsAccountStatus { + /** Enum value Failed. */ + FAILED("Failed"), + + /** Enum value Creating. */ + CREATING("Creating"), + + /** Enum value Running. */ + RUNNING("Running"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Patching. */ + PATCHING("Patching"), + + /** Enum value Suspending. */ + SUSPENDING("Suspending"), + + /** Enum value Resuming. */ + RESUMING("Resuming"), + + /** Enum value Deleting. */ + DELETING("Deleting"), + + /** Enum value Deleted. */ + DELETED("Deleted"); + + /** The actual serialized value for a DataLakeAnalyticsAccountStatus instance. */ + private String value; + + DataLakeAnalyticsAccountStatus(String value) { + this.value = value; + } + + /** + * Gets the serialized value for a DataLakeAnalyticsAccountStatus instance. + * + * @return the serialized value. + */ + @JsonValue + public String toValue() { + return this.value; + } + + /** + * Parses a serialized value to a DataLakeAnalyticsAccountStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed DataLakeAnalyticsAccountStatus object, or null if unable to parse. + */ + @JsonCreator + public static DataLakeAnalyticsAccountStatus fromValue(String value) { + DataLakeAnalyticsAccountStatus[] items = DataLakeAnalyticsAccountStatus.values(); + for (DataLakeAnalyticsAccountStatus item : items) { + if (item.toValue().equals(value)) { + return item; + } + } + return null; + } +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters.java new file mode 100644 index 000000000000..e233a5df856b --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * DataLakeAnalytics DataLakeAnalyticsAccount information. + */ +public class DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters { + /** + * Gets or sets the password for the secret to pass in. + */ + @JsonProperty(required = true) + private String password; + + /** + * Gets or sets the URI identifier for the secret in the format + * <hostname>:<port>. + */ + private String uri; + + /** + * Get the password value. + * + * @return the password value + */ + public String getPassword() { + return this.password; + } + + /** + * Set the password value. + * + * @param password the password value to set + */ + public void setPassword(String password) { + this.password = password; + } + + /** + * Get the uri value. + * + * @return the uri value + */ + public String getUri() { + return this.uri; + } + + /** + * Set the uri value. + * + * @param uri the uri value to set + */ + public void setUri(String uri) { + this.uri = uri; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DataLakeStoreAccountInfo.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DataLakeStoreAccountInfo.java new file mode 100644 index 000000000000..48947f662028 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DataLakeStoreAccountInfo.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data Lake Store account information. + */ +public class DataLakeStoreAccountInfo { + /** + * Gets or sets the account name of the Data Lake Store account. + */ + @JsonProperty(required = true) + private String name; + + /** + * Gets or sets the properties associated with this Data Lake Store + * account. + */ + private DataLakeStoreAccountInfoProperties properties; + + /** + * Get the name value. + * + * @return the name value + */ + public String getName() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * Get the properties value. + * + * @return the properties value + */ + public DataLakeStoreAccountInfoProperties getProperties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + */ + public void setProperties(DataLakeStoreAccountInfoProperties properties) { + this.properties = properties; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DataLakeStoreAccountInfoProperties.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DataLakeStoreAccountInfoProperties.java new file mode 100644 index 000000000000..0f1f292285e3 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DataLakeStoreAccountInfoProperties.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + + +/** + * Data Lake Store account properties information. + */ +public class DataLakeStoreAccountInfoProperties { + /** + * Gets or sets the optional suffix for the Data Lake Store account. + */ + private String suffix; + + /** + * Get the suffix value. + * + * @return the suffix value + */ + public String getSuffix() { + return this.suffix; + } + + /** + * Set the suffix value. + * + * @param suffix the suffix value to set + */ + public void setSuffix(String suffix) { + this.suffix = suffix; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DdlName.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DdlName.java new file mode 100644 index 000000000000..4b7adf7b31e5 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DdlName.java @@ -0,0 +1,114 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + + +/** + * A Data Lake Analytics DDL name item. + */ +public class DdlName { + /** + * Gets or sets the name of the table associated with this database and + * schema. + */ + private String firstPart; + + /** + * Gets or sets the name of the table associated with this database and + * schema. + */ + private String secondPart; + + /** + * Gets or sets the name of the table associated with this database and + * schema. + */ + private String thirdPart; + + /** + * Gets or sets the name of the table associated with this database and + * schema. + */ + private String server; + + /** + * Get the firstPart value. + * + * @return the firstPart value + */ + public String getFirstPart() { + return this.firstPart; + } + + /** + * Set the firstPart value. + * + * @param firstPart the firstPart value to set + */ + public void setFirstPart(String firstPart) { + this.firstPart = firstPart; + } + + /** + * Get the secondPart value. + * + * @return the secondPart value + */ + public String getSecondPart() { + return this.secondPart; + } + + /** + * Set the secondPart value. + * + * @param secondPart the secondPart value to set + */ + public void setSecondPart(String secondPart) { + this.secondPart = secondPart; + } + + /** + * Get the thirdPart value. + * + * @return the thirdPart value + */ + public String getThirdPart() { + return this.thirdPart; + } + + /** + * Set the thirdPart value. + * + * @param thirdPart the thirdPart value to set + */ + public void setThirdPart(String thirdPart) { + this.thirdPart = thirdPart; + } + + /** + * Get the server value. + * + * @return the server value + */ + public String getServer() { + return this.server; + } + + /** + * Set the server value. + * + * @param server the server value to set + */ + public void setServer(String server) { + this.server = server; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/EntityId.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/EntityId.java new file mode 100644 index 000000000000..a744a8ef75dc --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/EntityId.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import java.util.UUID; + +/** + * A Data Lake Analytics catalog entity identifier object. + */ +public class EntityId { + /** + * Gets or sets the name of the external table associated with this + * database, schema and table. + */ + private DdlName name; + + /** + * Gets or sets the version of the external data source. + */ + private UUID version; + + /** + * Get the name value. + * + * @return the name value + */ + public DdlName getName() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + */ + public void setName(DdlName name) { + this.name = name; + } + + /** + * Get the version value. + * + * @return the version value + */ + public UUID getVersion() { + return this.version; + } + + /** + * Set the version value. + * + * @param version the version value to set + */ + public void setVersion(UUID version) { + this.version = version; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/Error.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/Error.java new file mode 100644 index 000000000000..923ed0168954 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/Error.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Generic resource error information. + */ +public class Error { + /** + * Gets or sets the HTTP status code or error code associated with this + * error. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * Gets or sets the error message to display. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Gets or sets the target of the error. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /** + * Gets or sets the list of error details. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /** + * Gets or sets the inner exceptions or errors, if any. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private InnerError innerError; + + /** + * Get the code value. + * + * @return the code value + */ + public String getCode() { + return this.code; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String getMessage() { + return this.message; + } + + /** + * Get the target value. + * + * @return the target value + */ + public String getTarget() { + return this.target; + } + + /** + * Get the details value. + * + * @return the details value + */ + public List getDetails() { + return this.details; + } + + /** + * Get the innerError value. + * + * @return the innerError value + */ + public InnerError getInnerError() { + return this.innerError; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/ErrorDetails.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/ErrorDetails.java new file mode 100644 index 000000000000..4da38e6e5291 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/ErrorDetails.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Generic resource error details information. + */ +public class ErrorDetails { + /** + * Gets or sets the HTTP status code or error code associated with this + * error. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * Gets or sets the error message localized based on Accept-Language. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Gets or sets the target of the particular error (for example, the name + * of the property in error). + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /** + * Get the code value. + * + * @return the code value + */ + public String getCode() { + return this.code; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String getMessage() { + return this.message; + } + + /** + * Get the target value. + * + * @return the target value + */ + public String getTarget() { + return this.target; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/ExternalTable.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/ExternalTable.java new file mode 100644 index 000000000000..c9e86b1160e5 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/ExternalTable.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + + +/** + * A Data Lake Analytics catalog external table item. + */ +public class ExternalTable { + /** + * Gets or sets the name of the table associated with this database and + * schema. + */ + private String tableName; + + /** + * Gets or sets the data source associated with this external table. + */ + private EntityId dataSource; + + /** + * Get the tableName value. + * + * @return the tableName value + */ + public String getTableName() { + return this.tableName; + } + + /** + * Set the tableName value. + * + * @param tableName the tableName value to set + */ + public void setTableName(String tableName) { + this.tableName = tableName; + } + + /** + * Get the dataSource value. + * + * @return the dataSource value + */ + public EntityId getDataSource() { + return this.dataSource; + } + + /** + * Set the dataSource value. + * + * @param dataSource the dataSource value to set + */ + public void setDataSource(EntityId dataSource) { + this.dataSource = dataSource; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/FileType.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/FileType.java new file mode 100644 index 000000000000..80f25ce1547d --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/FileType.java @@ -0,0 +1,59 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for FileType. + */ +public enum FileType { + /** Enum value Assembly. */ + ASSEMBLY("Assembly"), + + /** Enum value Resource. */ + RESOURCE("Resource"); + + /** The actual serialized value for a FileType instance. */ + private String value; + + FileType(String value) { + this.value = value; + } + + /** + * Gets the serialized value for a FileType instance. + * + * @return the serialized value. + */ + @JsonValue + public String toValue() { + return this.value; + } + + /** + * Parses a serialized value to a FileType instance. + * + * @param value the serialized value to parse. + * @return the parsed FileType object, or null if unable to parse. + */ + @JsonCreator + public static FileType fromValue(String value) { + FileType[] items = FileType.values(); + for (FileType item : items) { + if (item.toValue().equals(value)) { + return item; + } + } + return null; + } +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/HiveJobProperties.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/HiveJobProperties.java new file mode 100644 index 000000000000..d2c61365db75 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/HiveJobProperties.java @@ -0,0 +1,140 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The HiveJobProperties model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("Hive") +public class HiveJobProperties extends JobProperties { + /** + * Gets or sets the statement information for each statement in the script. + */ + private List statementInfo; + + /** + * Gets or sets the Hive logs location. + */ + private String logsLocation; + + /** + * Gets or sets the runtime version of the U-SQL engine to use. + */ + private String warehouseLocation; + + /** + * Gets or sets the number of statements that will be run based on the + * script. + */ + private Integer statementCount; + + /** + * Gets or sets the number of statements that have been run based on the + * script. + */ + private Integer executedStatementCount; + + /** + * Get the statementInfo value. + * + * @return the statementInfo value + */ + public List getStatementInfo() { + return this.statementInfo; + } + + /** + * Set the statementInfo value. + * + * @param statementInfo the statementInfo value to set + */ + public void setStatementInfo(List statementInfo) { + this.statementInfo = statementInfo; + } + + /** + * Get the logsLocation value. + * + * @return the logsLocation value + */ + public String getLogsLocation() { + return this.logsLocation; + } + + /** + * Set the logsLocation value. + * + * @param logsLocation the logsLocation value to set + */ + public void setLogsLocation(String logsLocation) { + this.logsLocation = logsLocation; + } + + /** + * Get the warehouseLocation value. + * + * @return the warehouseLocation value + */ + public String getWarehouseLocation() { + return this.warehouseLocation; + } + + /** + * Set the warehouseLocation value. + * + * @param warehouseLocation the warehouseLocation value to set + */ + public void setWarehouseLocation(String warehouseLocation) { + this.warehouseLocation = warehouseLocation; + } + + /** + * Get the statementCount value. + * + * @return the statementCount value + */ + public Integer getStatementCount() { + return this.statementCount; + } + + /** + * Set the statementCount value. + * + * @param statementCount the statementCount value to set + */ + public void setStatementCount(Integer statementCount) { + this.statementCount = statementCount; + } + + /** + * Get the executedStatementCount value. + * + * @return the executedStatementCount value + */ + public Integer getExecutedStatementCount() { + return this.executedStatementCount; + } + + /** + * Set the executedStatementCount value. + * + * @param executedStatementCount the executedStatementCount value to set + */ + public void setExecutedStatementCount(Integer executedStatementCount) { + this.executedStatementCount = executedStatementCount; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/HiveJobStatementInfo.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/HiveJobStatementInfo.java new file mode 100644 index 000000000000..4dc4f22a664e --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/HiveJobStatementInfo.java @@ -0,0 +1,110 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + + +/** + * The HiveJobStatementInfo model. + */ +public class HiveJobStatementInfo { + /** + * Gets or sets the log location for this statement. + */ + private String logLocation; + + /** + * Gets or sets the result preview location for this statement. + */ + private String resultPreviewLocation; + + /** + * Gets or sets the result location for this statement. + */ + private String resultLocation; + + /** + * Gets or sets the error message for this statement. + */ + private String errorMessage; + + /** + * Get the logLocation value. + * + * @return the logLocation value + */ + public String getLogLocation() { + return this.logLocation; + } + + /** + * Set the logLocation value. + * + * @param logLocation the logLocation value to set + */ + public void setLogLocation(String logLocation) { + this.logLocation = logLocation; + } + + /** + * Get the resultPreviewLocation value. + * + * @return the resultPreviewLocation value + */ + public String getResultPreviewLocation() { + return this.resultPreviewLocation; + } + + /** + * Set the resultPreviewLocation value. + * + * @param resultPreviewLocation the resultPreviewLocation value to set + */ + public void setResultPreviewLocation(String resultPreviewLocation) { + this.resultPreviewLocation = resultPreviewLocation; + } + + /** + * Get the resultLocation value. + * + * @return the resultLocation value + */ + public String getResultLocation() { + return this.resultLocation; + } + + /** + * Set the resultLocation value. + * + * @param resultLocation the resultLocation value to set + */ + public void setResultLocation(String resultLocation) { + this.resultLocation = resultLocation; + } + + /** + * Get the errorMessage value. + * + * @return the errorMessage value + */ + public String getErrorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage value. + * + * @param errorMessage the errorMessage value to set + */ + public void setErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/InnerError.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/InnerError.java new file mode 100644 index 000000000000..898d7d18db8f --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/InnerError.java @@ -0,0 +1,49 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Generic resource inner error information. + */ +public class InnerError { + /** + * Gets or sets the stack trace for the error. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String trace; + + /** + * Gets or sets the context for the error message. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String context; + + /** + * Get the trace value. + * + * @return the trace value + */ + public String getTrace() { + return this.trace; + } + + /** + * Get the context value. + * + * @return the context value + */ + public String getContext() { + return this.context; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobDataPath.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobDataPath.java new file mode 100644 index 000000000000..78ba3b7e18d8 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobDataPath.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A Data Lake Analytics U-SQL job data path item. + */ +public class JobDataPath { + /** + * Gets the id of the job this data is for. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private UUID jobId; + + /** + * Gets the command that this job data relates to. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String command; + + /** + * Gets the list of paths to all of the job data. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private List paths; + + /** + * Get the jobId value. + * + * @return the jobId value + */ + public UUID getJobId() { + return this.jobId; + } + + /** + * Get the command value. + * + * @return the command value + */ + public String getCommand() { + return this.command; + } + + /** + * Get the paths value. + * + * @return the paths value + */ + public List getPaths() { + return this.paths; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobErrorDetails.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobErrorDetails.java new file mode 100644 index 000000000000..e3f29be643cc --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobErrorDetails.java @@ -0,0 +1,233 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Data Lake Analytics job error details. + */ +public class JobErrorDetails { + /** + * Gets the error message description. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Gets the details of the error message. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String details; + + /** + * Gets the end offset in the job where the error was found. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Integer endOffset; + + /** + * Gets the specific identifier for the type of error encountered in the + * job. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String errorId; + + /** + * Gets the path to any supplemental error files, if any. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String filePath; + + /** + * Gets the link to MSDN or Azure help for this type of error, if any. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String helpLink; + + /** + * Gets the internal diagnostic stack trace if the user requesting the job + * error details has sufficient permissions it will be retrieved, + * otherwise it will be empty. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String internalDiagnostics; + + /** + * Gets the specific line number in the job where the error occured. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Integer lineNumber; + + /** + * Gets the user friendly error message for the failure. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Gets the recommended resolution for the failure, if any. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String resolution; + + /** + * Gets the inner error of this specific job error message, if any. + */ + @JsonProperty(value = "InnerError", access = JsonProperty.Access.WRITE_ONLY) + private JobInnerError innerError; + + /** + * Gets the severity level of the failure. Possible values include: + * 'Warning', 'Error'. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String severity; + + /** + * Gets the ultimate source of the failure (usually either SYSTEM or USER). + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String source; + + /** + * Gets the start offset in the job where the error was found. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Integer startOffset; + + /** + * Get the description value. + * + * @return the description value + */ + public String getDescription() { + return this.description; + } + + /** + * Get the details value. + * + * @return the details value + */ + public String getDetails() { + return this.details; + } + + /** + * Get the endOffset value. + * + * @return the endOffset value + */ + public Integer getEndOffset() { + return this.endOffset; + } + + /** + * Get the errorId value. + * + * @return the errorId value + */ + public String getErrorId() { + return this.errorId; + } + + /** + * Get the filePath value. + * + * @return the filePath value + */ + public String getFilePath() { + return this.filePath; + } + + /** + * Get the helpLink value. + * + * @return the helpLink value + */ + public String getHelpLink() { + return this.helpLink; + } + + /** + * Get the internalDiagnostics value. + * + * @return the internalDiagnostics value + */ + public String getInternalDiagnostics() { + return this.internalDiagnostics; + } + + /** + * Get the lineNumber value. + * + * @return the lineNumber value + */ + public Integer getLineNumber() { + return this.lineNumber; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String getMessage() { + return this.message; + } + + /** + * Get the resolution value. + * + * @return the resolution value + */ + public String getResolution() { + return this.resolution; + } + + /** + * Get the innerError value. + * + * @return the innerError value + */ + public JobInnerError getInnerError() { + return this.innerError; + } + + /** + * Get the severity value. + * + * @return the severity value + */ + public String getSeverity() { + return this.severity; + } + + /** + * Get the source value. + * + * @return the source value + */ + public String getSource() { + return this.source; + } + + /** + * Get the startOffset value. + * + * @return the startOffset value + */ + public Integer getStartOffset() { + return this.startOffset; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobInformation.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobInformation.java new file mode 100644 index 000000000000..1ce54b31a2e9 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobInformation.java @@ -0,0 +1,301 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import org.joda.time.DateTime; + +/** + * The common Data Lake Analytics job information properties. + */ +public class JobInformation { + /** + * Gets or sets the job's unique identifier (a GUID). + */ + private UUID jobId; + + /** + * Gets or sets the friendly name of the job. + */ + @JsonProperty(required = true) + private String name; + + /** + * Gets or sets the job type of the current job (Hive or USql). Possible + * values include: 'USql', 'Hive'. + */ + @JsonProperty(required = true) + private JobType type; + + /** + * Gets or sets the user or account that submitted the job. + */ + private String submitter; + + /** + * Gets the error message details for the job, if the job failed. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private List errorMessage; + + /** + * Gets or sets the degree of parallelism used for this job. This must be + * greater than 0. + */ + private Integer degreeOfParallelism; + + /** + * Gets or sets the priority value for the current job. Lower numbers have + * a higher priority. By default, a job has a priority of 1000. This must + * be greater than 0. + */ + private Integer priority; + + /** + * Gets the time the job was submitted to the service. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private DateTime submitTime; + + /** + * Gets the start time of the job. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private DateTime startTime; + + /** + * Gets the completion time of the job. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private DateTime endTime; + + /** + * Gets the job state. When the job is in the Ended state, refer to Result + * and ErrorMessage for details. Possible values include: 'Accepted', + * 'Compiling', 'Ended', 'New', 'Queued', 'Running', 'Scheduling', + * 'Starting', 'Paused', 'WaitingForCapacity'. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private JobState state; + + /** + * Gets the result of job execution or the current result of the running + * job. Possible values include: 'None', 'Succeeded', 'Cancelled', + * 'Failed'. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private JobResult result; + + /** + * Gets the job state audit records, indicating when various operations + * have been performed on this job. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private List stateAuditRecords; + + /** + * Gets or sets the job specific properties. + */ + @JsonProperty(required = true) + private JobProperties properties; + + /** + * Get the jobId value. + * + * @return the jobId value + */ + public UUID getJobId() { + return this.jobId; + } + + /** + * Set the jobId value. + * + * @param jobId the jobId value to set + */ + public void setJobId(UUID jobId) { + this.jobId = jobId; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String getName() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * Get the type value. + * + * @return the type value + */ + public JobType getType() { + return this.type; + } + + /** + * Set the type value. + * + * @param type the type value to set + */ + public void setType(JobType type) { + this.type = type; + } + + /** + * Get the submitter value. + * + * @return the submitter value + */ + public String getSubmitter() { + return this.submitter; + } + + /** + * Set the submitter value. + * + * @param submitter the submitter value to set + */ + public void setSubmitter(String submitter) { + this.submitter = submitter; + } + + /** + * Get the errorMessage value. + * + * @return the errorMessage value + */ + public List getErrorMessage() { + return this.errorMessage; + } + + /** + * Get the degreeOfParallelism value. + * + * @return the degreeOfParallelism value + */ + public Integer getDegreeOfParallelism() { + return this.degreeOfParallelism; + } + + /** + * Set the degreeOfParallelism value. + * + * @param degreeOfParallelism the degreeOfParallelism value to set + */ + public void setDegreeOfParallelism(Integer degreeOfParallelism) { + this.degreeOfParallelism = degreeOfParallelism; + } + + /** + * Get the priority value. + * + * @return the priority value + */ + public Integer getPriority() { + return this.priority; + } + + /** + * Set the priority value. + * + * @param priority the priority value to set + */ + public void setPriority(Integer priority) { + this.priority = priority; + } + + /** + * Get the submitTime value. + * + * @return the submitTime value + */ + public DateTime getSubmitTime() { + return this.submitTime; + } + + /** + * Get the startTime value. + * + * @return the startTime value + */ + public DateTime getStartTime() { + return this.startTime; + } + + /** + * Get the endTime value. + * + * @return the endTime value + */ + public DateTime getEndTime() { + return this.endTime; + } + + /** + * Get the state value. + * + * @return the state value + */ + public JobState getState() { + return this.state; + } + + /** + * Get the result value. + * + * @return the result value + */ + public JobResult getResult() { + return this.result; + } + + /** + * Get the stateAuditRecords value. + * + * @return the stateAuditRecords value + */ + public List getStateAuditRecords() { + return this.stateAuditRecords; + } + + /** + * Get the properties value. + * + * @return the properties value + */ + public JobProperties getProperties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + */ + public void setProperties(JobProperties properties) { + this.properties = properties; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobInnerError.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobInnerError.java new file mode 100644 index 000000000000..e7527301b392 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobInnerError.java @@ -0,0 +1,188 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Data Lake Analytics job error details. + */ +public class JobInnerError { + /** + * Gets the diagnostic error code. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Integer diagnosticCode; + + /** + * Gets the severity level of the failure. Possible values include: + * 'Warning', 'Error'. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String severity; + + /** + * Gets the details of the error message. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String details; + + /** + * Gets the component that failed. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String component; + + /** + * Gets the specific identifier for the type of error encountered in the + * job. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String errorId; + + /** + * Gets the link to MSDN or Azure help for this type of error, if any. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String helpLink; + + /** + * Gets the internal diagnostic stack trace if the user requesting the job + * error details has sufficient permissions it will be retrieved, + * otherwise it will be empty. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String internalDiagnostics; + + /** + * Gets the user friendly error message for the failure. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Gets the recommended resolution for the failure, if any. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String resolution; + + /** + * Gets the ultimate source of the failure (usually either SYSTEM or USER). + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String source; + + /** + * Gets the error message description. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get the diagnosticCode value. + * + * @return the diagnosticCode value + */ + public Integer getDiagnosticCode() { + return this.diagnosticCode; + } + + /** + * Get the severity value. + * + * @return the severity value + */ + public String getSeverity() { + return this.severity; + } + + /** + * Get the details value. + * + * @return the details value + */ + public String getDetails() { + return this.details; + } + + /** + * Get the component value. + * + * @return the component value + */ + public String getComponent() { + return this.component; + } + + /** + * Get the errorId value. + * + * @return the errorId value + */ + public String getErrorId() { + return this.errorId; + } + + /** + * Get the helpLink value. + * + * @return the helpLink value + */ + public String getHelpLink() { + return this.helpLink; + } + + /** + * Get the internalDiagnostics value. + * + * @return the internalDiagnostics value + */ + public String getInternalDiagnostics() { + return this.internalDiagnostics; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String getMessage() { + return this.message; + } + + /** + * Get the resolution value. + * + * @return the resolution value + */ + public String getResolution() { + return this.resolution; + } + + /** + * Get the source value. + * + * @return the source value + */ + public String getSource() { + return this.source; + } + + /** + * Get the description value. + * + * @return the description value + */ + public String getDescription() { + return this.description; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobProperties.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobProperties.java new file mode 100644 index 000000000000..4b57029307af --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobProperties.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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The common Data Lake Analytics job properties. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("JobProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "USql", value = USqlJobProperties.class), + @JsonSubTypes.Type(name = "Hive", value = HiveJobProperties.class) +}) +public class JobProperties { + /** + * Gets or sets the runtime version of the U-SQL engine to use. + */ + private String runtimeVersion; + + /** + * Gets or sets the U-SQL script to run. + */ + @JsonProperty(required = true) + private String script; + + /** + * Get the runtimeVersion value. + * + * @return the runtimeVersion value + */ + public String getRuntimeVersion() { + return this.runtimeVersion; + } + + /** + * Set the runtimeVersion value. + * + * @param runtimeVersion the runtimeVersion value to set + */ + public void setRuntimeVersion(String runtimeVersion) { + this.runtimeVersion = runtimeVersion; + } + + /** + * Get the script value. + * + * @return the script value + */ + public String getScript() { + return this.script; + } + + /** + * Set the script value. + * + * @param script the script value to set + */ + public void setScript(String script) { + this.script = script; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobResource.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobResource.java new file mode 100644 index 000000000000..78d58444319d --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobResource.java @@ -0,0 +1,88 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + + +/** + * The Data Lake Analytics U-SQL job resources. + */ +public class JobResource { + /** + * Gets or set the name of the resource. + */ + private String name; + + /** + * Gets or sets the path to the resource. + */ + private String resourcePath; + + /** + * Gets or sets the job resource type. Possible values include: + * 'VertexResource', 'StatisticsResource'. + */ + private String type; + + /** + * Get the name value. + * + * @return the name value + */ + public String getName() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * Get the resourcePath value. + * + * @return the resourcePath value + */ + public String getResourcePath() { + return this.resourcePath; + } + + /** + * Set the resourcePath value. + * + * @param resourcePath the resourcePath value to set + */ + public void setResourcePath(String resourcePath) { + this.resourcePath = resourcePath; + } + + /** + * Get the type value. + * + * @return the type value + */ + public String getType() { + return this.type; + } + + /** + * Set the type value. + * + * @param type the type value to set + */ + public void setType(String type) { + this.type = type; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobResult.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobResult.java new file mode 100644 index 000000000000..6efbab0d8120 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobResult.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JobResult. + */ +public enum JobResult { + /** Enum value None. */ + NONE("None"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Cancelled. */ + CANCELLED("Cancelled"), + + /** Enum value Failed. */ + FAILED("Failed"); + + /** The actual serialized value for a JobResult instance. */ + private String value; + + JobResult(String value) { + this.value = value; + } + + /** + * Gets the serialized value for a JobResult instance. + * + * @return the serialized value. + */ + @JsonValue + public String toValue() { + return this.value; + } + + /** + * Parses a serialized value to a JobResult instance. + * + * @param value the serialized value to parse. + * @return the parsed JobResult object, or null if unable to parse. + */ + @JsonCreator + public static JobResult fromValue(String value) { + JobResult[] items = JobResult.values(); + for (JobResult item : items) { + if (item.toValue().equals(value)) { + return item; + } + } + return null; + } +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobState.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobState.java new file mode 100644 index 000000000000..65b7c7a135d3 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobState.java @@ -0,0 +1,83 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JobState. + */ +public enum JobState { + /** Enum value Accepted. */ + ACCEPTED("Accepted"), + + /** Enum value Compiling. */ + COMPILING("Compiling"), + + /** Enum value Ended. */ + ENDED("Ended"), + + /** Enum value New. */ + NEW("New"), + + /** Enum value Queued. */ + QUEUED("Queued"), + + /** Enum value Running. */ + RUNNING("Running"), + + /** Enum value Scheduling. */ + SCHEDULING("Scheduling"), + + /** Enum value Starting. */ + STARTING("Starting"), + + /** Enum value Paused. */ + PAUSED("Paused"), + + /** Enum value WaitingForCapacity. */ + WAITINGFORCAPACITY("WaitingForCapacity"); + + /** The actual serialized value for a JobState instance. */ + private String value; + + JobState(String value) { + this.value = value; + } + + /** + * Gets the serialized value for a JobState instance. + * + * @return the serialized value. + */ + @JsonValue + public String toValue() { + return this.value; + } + + /** + * Parses a serialized value to a JobState instance. + * + * @param value the serialized value to parse. + * @return the parsed JobState object, or null if unable to parse. + */ + @JsonCreator + public static JobState fromValue(String value) { + JobState[] items = JobState.values(); + for (JobState item : items) { + if (item.toValue().equals(value)) { + return item; + } + } + return null; + } +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobStateAuditRecord.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobStateAuditRecord.java new file mode 100644 index 000000000000..8755e70f5ecf --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobStateAuditRecord.java @@ -0,0 +1,81 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import org.joda.time.DateTime; + +/** + * The Data Lake Analytics U-SQL job state audit records for tracking the + * lifecycle of a job. + */ +public class JobStateAuditRecord { + /** + * Gets the new state the job is in. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String newState; + + /** + * Gets the time stamp that the state change took place. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private DateTime timeStamp; + + /** + * Gets the user who requests the change. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String requestedByUser; + + /** + * Gets the details of the audit log. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String details; + + /** + * Get the newState value. + * + * @return the newState value + */ + public String getNewState() { + return this.newState; + } + + /** + * Get the timeStamp value. + * + * @return the timeStamp value + */ + public DateTime getTimeStamp() { + return this.timeStamp; + } + + /** + * Get the requestedByUser value. + * + * @return the requestedByUser value + */ + public String getRequestedByUser() { + return this.requestedByUser; + } + + /** + * Get the details value. + * + * @return the details value + */ + public String getDetails() { + return this.details; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobStatistics.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobStatistics.java new file mode 100644 index 000000000000..7286d00f9ad8 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobStatistics.java @@ -0,0 +1,51 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The Data Lake Analytics U-SQL job execution statistics. + */ +public class JobStatistics { + /** + * Gets the last update time for the statistics. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastUpdateTimeUtc; + + /** + * Gets the list of stages for the job. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private List stages; + + /** + * Get the lastUpdateTimeUtc value. + * + * @return the lastUpdateTimeUtc value + */ + public DateTime getLastUpdateTimeUtc() { + return this.lastUpdateTimeUtc; + } + + /** + * Get the stages value. + * + * @return the stages value + */ + public List getStages() { + return this.stages; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobStatisticsVertexStage.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobStatisticsVertexStage.java new file mode 100644 index 000000000000..d0c1d509c442 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobStatisticsVertexStage.java @@ -0,0 +1,319 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Data Lake Analytics U-SQL job statistics vertex stage information. + */ +public class JobStatisticsVertexStage { + /** + * Gets the amount of data read, in bytes. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Long dataRead; + + /** + * Gets the amount of data read across multiple pods, in bytes. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Long dataReadCrossPod; + + /** + * Gets the amount of data read in one pod, in bytes. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Long dataReadIntraPod; + + /** + * Gets the amount of data remaining to be read, in bytes. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Long dataToRead; + + /** + * Gets the amount of data written, in bytes. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Long dataWritten; + + /** + * Gets the number of duplicates that were discarded. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Integer duplicateDiscardCount; + + /** + * Gets the number of failures that occured in this stage. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Integer failedCount; + + /** + * Gets the maximum amount of data read in a single vertex, in bytes. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Long maxVertexDataRead; + + /** + * Gets the minimum amount of data read in a single vertex, in bytes. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Long minVertexDataRead; + + /** + * Gets the number of read failures in this stage. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Integer readFailureCount; + + /** + * Gets the number of vertices that were revoked during this stage. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Integer revocationCount; + + /** + * Gets the number of currently running vertices in this stage. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Integer runningCount; + + /** + * Gets the number of currently scheduled vertices in this stage. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Integer scheduledCount; + + /** + * Gets the name of this stage in job execution. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String stageName; + + /** + * Gets the number of vertices that succeeded in this stage. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Integer succeededCount; + + /** + * Gets the amount of temporary data written, in bytes. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Long tempDataWritten; + + /** + * Gets the total vertex count for this stage. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Integer totalCount; + + /** + * Gets the amount of time that failed vertices took up in this stage. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String totalFailedTime; + + /** + * Gets the current progress of this stage, as a percentage. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Integer totalProgress; + + /** + * Gets the amount of time all successful vertices took in this stage. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String totalSucceededTime; + + /** + * Get the dataRead value. + * + * @return the dataRead value + */ + public Long getDataRead() { + return this.dataRead; + } + + /** + * Get the dataReadCrossPod value. + * + * @return the dataReadCrossPod value + */ + public Long getDataReadCrossPod() { + return this.dataReadCrossPod; + } + + /** + * Get the dataReadIntraPod value. + * + * @return the dataReadIntraPod value + */ + public Long getDataReadIntraPod() { + return this.dataReadIntraPod; + } + + /** + * Get the dataToRead value. + * + * @return the dataToRead value + */ + public Long getDataToRead() { + return this.dataToRead; + } + + /** + * Get the dataWritten value. + * + * @return the dataWritten value + */ + public Long getDataWritten() { + return this.dataWritten; + } + + /** + * Get the duplicateDiscardCount value. + * + * @return the duplicateDiscardCount value + */ + public Integer getDuplicateDiscardCount() { + return this.duplicateDiscardCount; + } + + /** + * Get the failedCount value. + * + * @return the failedCount value + */ + public Integer getFailedCount() { + return this.failedCount; + } + + /** + * Get the maxVertexDataRead value. + * + * @return the maxVertexDataRead value + */ + public Long getMaxVertexDataRead() { + return this.maxVertexDataRead; + } + + /** + * Get the minVertexDataRead value. + * + * @return the minVertexDataRead value + */ + public Long getMinVertexDataRead() { + return this.minVertexDataRead; + } + + /** + * Get the readFailureCount value. + * + * @return the readFailureCount value + */ + public Integer getReadFailureCount() { + return this.readFailureCount; + } + + /** + * Get the revocationCount value. + * + * @return the revocationCount value + */ + public Integer getRevocationCount() { + return this.revocationCount; + } + + /** + * Get the runningCount value. + * + * @return the runningCount value + */ + public Integer getRunningCount() { + return this.runningCount; + } + + /** + * Get the scheduledCount value. + * + * @return the scheduledCount value + */ + public Integer getScheduledCount() { + return this.scheduledCount; + } + + /** + * Get the stageName value. + * + * @return the stageName value + */ + public String getStageName() { + return this.stageName; + } + + /** + * Get the succeededCount value. + * + * @return the succeededCount value + */ + public Integer getSucceededCount() { + return this.succeededCount; + } + + /** + * Get the tempDataWritten value. + * + * @return the tempDataWritten value + */ + public Long getTempDataWritten() { + return this.tempDataWritten; + } + + /** + * Get the totalCount value. + * + * @return the totalCount value + */ + public Integer getTotalCount() { + return this.totalCount; + } + + /** + * Get the totalFailedTime value. + * + * @return the totalFailedTime value + */ + public String getTotalFailedTime() { + return this.totalFailedTime; + } + + /** + * Get the totalProgress value. + * + * @return the totalProgress value + */ + public Integer getTotalProgress() { + return this.totalProgress; + } + + /** + * Get the totalSucceededTime value. + * + * @return the totalSucceededTime value + */ + public String getTotalSucceededTime() { + return this.totalSucceededTime; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobType.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobType.java new file mode 100644 index 000000000000..6c401da2a707 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobType.java @@ -0,0 +1,59 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JobType. + */ +public enum JobType { + /** Enum value USql. */ + USQL("USql"), + + /** Enum value Hive. */ + HIVE("Hive"); + + /** The actual serialized value for a JobType instance. */ + private String value; + + JobType(String value) { + this.value = value; + } + + /** + * Gets the serialized value for a JobType instance. + * + * @return the serialized value. + */ + @JsonValue + public String toValue() { + return this.value; + } + + /** + * Parses a serialized value to a JobType instance. + * + * @param value the serialized value to parse. + * @return the parsed JobType object, or null if unable to parse. + */ + @JsonCreator + public static JobType fromValue(String value) { + JobType[] items = JobType.values(); + for (JobType item : items) { + if (item.toValue().equals(value)) { + return item; + } + } + return null; + } +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/OperationStatus.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/OperationStatus.java new file mode 100644 index 000000000000..0a1c5249c8fa --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/OperationStatus.java @@ -0,0 +1,62 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for OperationStatus. + */ +public enum OperationStatus { + /** Enum value InProgress. */ + INPROGRESS("InProgress"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Failed. */ + FAILED("Failed"); + + /** The actual serialized value for a OperationStatus instance. */ + private String value; + + OperationStatus(String value) { + this.value = value; + } + + /** + * Gets the serialized value for a OperationStatus instance. + * + * @return the serialized value. + */ + @JsonValue + public String toValue() { + return this.value; + } + + /** + * Parses a serialized value to a OperationStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed OperationStatus object, or null if unable to parse. + */ + @JsonCreator + public static OperationStatus fromValue(String value) { + OperationStatus[] items = OperationStatus.values(); + for (OperationStatus item : items) { + if (item.toValue().equals(value)) { + return item; + } + } + return null; + } +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/PageImpl.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/PageImpl.java new file mode 100644 index 000000000000..ea298a8d5a02 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/PageImpl.java @@ -0,0 +1,55 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +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 getNextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List getItems() { + return items; + } +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/SasTokenInfo.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/SasTokenInfo.java new file mode 100644 index 000000000000..ae2689092ca0 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/SasTokenInfo.java @@ -0,0 +1,35 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SAS token information. + */ +public class SasTokenInfo { + /** + * Gets or sets the access token for the associated Azure Storage + * Container. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String accessToken; + + /** + * Get the accessToken value. + * + * @return the accessToken value + */ + public String getAccessToken() { + return this.accessToken; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/StorageAccountInfo.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/StorageAccountInfo.java new file mode 100644 index 000000000000..1879f3a067d3 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/StorageAccountInfo.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure Storage account information. + */ +public class StorageAccountInfo { + /** + * Gets or sets the account name associated with the Azure storage account. + */ + @JsonProperty(required = true) + private String name; + + /** + * Gets or sets the properties associated with this storage account. + */ + @JsonProperty(required = true) + private StorageAccountProperties properties; + + /** + * Get the name value. + * + * @return the name value + */ + public String getName() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * Get the properties value. + * + * @return the properties value + */ + public StorageAccountProperties getProperties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + */ + public void setProperties(StorageAccountProperties properties) { + this.properties = properties; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/StorageAccountProperties.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/StorageAccountProperties.java new file mode 100644 index 000000000000..5c52a2f5c697 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/StorageAccountProperties.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure Storage account properties information. + */ +public class StorageAccountProperties { + /** + * Gets or sets the access key associated with this Azure Storage account + * that will be used to connect to it. + */ + @JsonProperty(required = true) + private String accessKey; + + /** + * Gets or sets the optional suffix for the Data Lake account. + */ + private String suffix; + + /** + * Get the accessKey value. + * + * @return the accessKey value + */ + public String getAccessKey() { + return this.accessKey; + } + + /** + * Set the accessKey value. + * + * @param accessKey the accessKey value to set + */ + public void setAccessKey(String accessKey) { + this.accessKey = accessKey; + } + + /** + * Get the suffix value. + * + * @return the suffix value + */ + public String getSuffix() { + return this.suffix; + } + + /** + * Set the suffix value. + * + * @param suffix the suffix value to set + */ + public void setSuffix(String suffix) { + this.suffix = suffix; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlAssembly.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlAssembly.java new file mode 100644 index 000000000000..8be1584ef963 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlAssembly.java @@ -0,0 +1,183 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A Data Lake Analytics catalog U-SQL Assembly. + */ +public class USqlAssembly extends CatalogItem { + /** + * Gets or sets the name of the database. + */ + private String databaseName; + + /** + * Gets or sets the name of the assembly. + */ + @JsonProperty(value = "assemblyName") + private String name; + + /** + * Gets or sets the name of the CLR. + */ + private String clrName; + + /** + * Gets or sets the switch indicating if this assembly is visible or not. + */ + private Boolean isVisible; + + /** + * Gets or sets the switch indicating if this assembly is user defined or + * not. + */ + private Boolean isUserDefined; + + /** + * Gets or sets the list of files associated with the assembly. + */ + private List files; + + /** + * Gets or sets the list of dependencies associated with the assembly. + */ + private List dependencies; + + /** + * Get the databaseName value. + * + * @return the databaseName value + */ + public String getDatabaseName() { + return this.databaseName; + } + + /** + * Set the databaseName value. + * + * @param databaseName the databaseName value to set + */ + public void setDatabaseName(String databaseName) { + this.databaseName = databaseName; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String getName() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * Get the clrName value. + * + * @return the clrName value + */ + public String getClrName() { + return this.clrName; + } + + /** + * Set the clrName value. + * + * @param clrName the clrName value to set + */ + public void setClrName(String clrName) { + this.clrName = clrName; + } + + /** + * Get the isVisible value. + * + * @return the isVisible value + */ + public Boolean getIsVisible() { + return this.isVisible; + } + + /** + * Set the isVisible value. + * + * @param isVisible the isVisible value to set + */ + public void setIsVisible(Boolean isVisible) { + this.isVisible = isVisible; + } + + /** + * Get the isUserDefined value. + * + * @return the isUserDefined value + */ + public Boolean getIsUserDefined() { + return this.isUserDefined; + } + + /** + * Set the isUserDefined value. + * + * @param isUserDefined the isUserDefined value to set + */ + public void setIsUserDefined(Boolean isUserDefined) { + this.isUserDefined = isUserDefined; + } + + /** + * Get the files value. + * + * @return the files value + */ + public List getFiles() { + return this.files; + } + + /** + * Set the files value. + * + * @param files the files value to set + */ + public void setFiles(List files) { + this.files = files; + } + + /** + * Get the dependencies value. + * + * @return the dependencies value + */ + public List getDependencies() { + return this.dependencies; + } + + /** + * Set the dependencies value. + * + * @param dependencies the dependencies value to set + */ + public void setDependencies(List dependencies) { + this.dependencies = dependencies; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlAssemblyClr.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlAssemblyClr.java new file mode 100644 index 000000000000..224ddc1234e5 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlAssemblyClr.java @@ -0,0 +1,89 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A Data Lake Analytics catalog U-SQL assembly CLR item. + */ +public class USqlAssemblyClr extends CatalogItem { + /** + * Gets or sets the name of the database. + */ + private String databaseName; + + /** + * Gets or sets the name of the assembly. + */ + @JsonProperty(value = "assemblyClrName") + private String name; + + /** + * Gets or sets the name of the CLR. + */ + private String clrName; + + /** + * Get the databaseName value. + * + * @return the databaseName value + */ + public String getDatabaseName() { + return this.databaseName; + } + + /** + * Set the databaseName value. + * + * @param databaseName the databaseName value to set + */ + public void setDatabaseName(String databaseName) { + this.databaseName = databaseName; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String getName() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * Get the clrName value. + * + * @return the clrName value + */ + public String getClrName() { + return this.clrName; + } + + /** + * Set the clrName value. + * + * @param clrName the clrName value to set + */ + public void setClrName(String clrName) { + this.clrName = clrName; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlAssemblyDependencyInfo.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlAssemblyDependencyInfo.java new file mode 100644 index 000000000000..ea99672fadf1 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlAssemblyDependencyInfo.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + + +/** + * A Data Lake Analytics catalog U-SQL dependency information item. + */ +public class USqlAssemblyDependencyInfo { + /** + * Gets or sets the EntityId of the dependency. + */ + private EntityId entityId; + + /** + * Get the entityId value. + * + * @return the entityId value + */ + public EntityId getEntityId() { + return this.entityId; + } + + /** + * Set the entityId value. + * + * @param entityId the entityId value to set + */ + public void setEntityId(EntityId entityId) { + this.entityId = entityId; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlAssemblyFileInfo.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlAssemblyFileInfo.java new file mode 100644 index 000000000000..38c9fd495fcc --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlAssemblyFileInfo.java @@ -0,0 +1,88 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + + +/** + * A Data Lake Analytics catalog U-SQL assembly file information item. + */ +public class USqlAssemblyFileInfo { + /** + * Gets or sets the assembly file type. Possible values include: + * 'Assembly', 'Resource'. + */ + private FileType type; + + /** + * Gets or sets the the original path to the assembly file. + */ + private String originalPath; + + /** + * Gets or sets the the content path to the assembly file. + */ + private String contentPath; + + /** + * Get the type value. + * + * @return the type value + */ + public FileType getType() { + return this.type; + } + + /** + * Set the type value. + * + * @param type the type value to set + */ + public void setType(FileType type) { + this.type = type; + } + + /** + * Get the originalPath value. + * + * @return the originalPath value + */ + public String getOriginalPath() { + return this.originalPath; + } + + /** + * Set the originalPath value. + * + * @param originalPath the originalPath value to set + */ + public void setOriginalPath(String originalPath) { + this.originalPath = originalPath; + } + + /** + * Get the contentPath value. + * + * @return the contentPath value + */ + public String getContentPath() { + return this.contentPath; + } + + /** + * Set the contentPath value. + * + * @param contentPath the contentPath value to set + */ + public void setContentPath(String contentPath) { + this.contentPath = contentPath; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlCredential.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlCredential.java new file mode 100644 index 000000000000..6ec28ee2d5a5 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlCredential.java @@ -0,0 +1,112 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A Data Lake Analytics catalog U-SQL credential item. + */ +public class USqlCredential extends CatalogItem { + /** + * Gets or sets the name of the database the credential is in. + */ + private String databaseName; + + /** + * Gets or sets the name of the secret associated with the credential. + */ + private String identity; + + /** + * Gets or sets the name of the credential. + */ + @JsonProperty(value = "credentialName") + private String name; + + /** + * Gets or sets the user name associated with the credential. + */ + private String userName; + + /** + * Get the databaseName value. + * + * @return the databaseName value + */ + public String getDatabaseName() { + return this.databaseName; + } + + /** + * Set the databaseName value. + * + * @param databaseName the databaseName value to set + */ + public void setDatabaseName(String databaseName) { + this.databaseName = databaseName; + } + + /** + * Get the identity value. + * + * @return the identity value + */ + public String getIdentity() { + return this.identity; + } + + /** + * Set the identity value. + * + * @param identity the identity value to set + */ + public void setIdentity(String identity) { + this.identity = identity; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String getName() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * Get the userName value. + * + * @return the userName value + */ + public String getUserName() { + return this.userName; + } + + /** + * Set the userName value. + * + * @param userName the userName value to set + */ + public void setUserName(String userName) { + this.userName = userName; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlDatabase.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlDatabase.java new file mode 100644 index 000000000000..36e1c93c0607 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlDatabase.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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A Data Lake Analytics catalog U-SQL database item. + */ +public class USqlDatabase extends CatalogItem { + /** + * Gets or sets the name of the database. + */ + @JsonProperty(value = "databaseName") + private String name; + + /** + * Get the name value. + * + * @return the name value + */ + public String getName() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + */ + public void setName(String name) { + this.name = name; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlDirectedColumn.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlDirectedColumn.java new file mode 100644 index 000000000000..eb5c7aa6fab3 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlDirectedColumn.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + + +/** + * A Data Lake Analytics catalog U-SQL directed column item. + */ +public class USqlDirectedColumn { + /** + * Gets or sets the name of the index in the table. + */ + private String name; + + /** + * Gets or sets the switch indicating if the index is descending or not. + */ + private Boolean descending; + + /** + * Get the name value. + * + * @return the name value + */ + public String getName() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * Get the descending value. + * + * @return the descending value + */ + public Boolean getDescending() { + return this.descending; + } + + /** + * Set the descending value. + * + * @param descending the descending value to set + */ + public void setDescending(Boolean descending) { + this.descending = descending; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlDistributionInfo.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlDistributionInfo.java new file mode 100644 index 000000000000..d848ed5c455b --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlDistributionInfo.java @@ -0,0 +1,111 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import java.util.List; + +/** + * A Data Lake Analytics catalog U-SQL distribution information object. + */ +public class USqlDistributionInfo { + /** + * Gets or sets the type of this distribution. + */ + private Integer type; + + /** + * Gets or sets the list of directed columns in the distribution. + */ + private List keys; + + /** + * Gets or sets the count of indices using this distribution. + */ + private Integer count; + + /** + * Gets or sets the dynamic count of indices using this distribution. + */ + private Integer dynamicCount; + + /** + * Get the type value. + * + * @return the type value + */ + public Integer getType() { + return this.type; + } + + /** + * Set the type value. + * + * @param type the type value to set + */ + public void setType(Integer type) { + this.type = type; + } + + /** + * Get the keys value. + * + * @return the keys value + */ + public List getKeys() { + return this.keys; + } + + /** + * Set the keys value. + * + * @param keys the keys value to set + */ + public void setKeys(List keys) { + this.keys = keys; + } + + /** + * Get the count value. + * + * @return the count value + */ + public Integer getCount() { + return this.count; + } + + /** + * Set the count value. + * + * @param count the count value to set + */ + public void setCount(Integer count) { + this.count = count; + } + + /** + * Get the dynamicCount value. + * + * @return the dynamicCount value + */ + public Integer getDynamicCount() { + return this.dynamicCount; + } + + /** + * Set the dynamicCount value. + * + * @param dynamicCount the dynamicCount value to set + */ + public void setDynamicCount(Integer dynamicCount) { + this.dynamicCount = dynamicCount; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlExternalDataSource.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlExternalDataSource.java new file mode 100644 index 000000000000..a225d11e8a32 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlExternalDataSource.java @@ -0,0 +1,138 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A Data Lake Analytics catalog U-SQL external datasource item. + */ +public class USqlExternalDataSource extends CatalogItem { + /** + * Gets or sets the name of the database. + */ + private String databaseName; + + /** + * Gets or sets the name of the external data source. + */ + @JsonProperty(value = "externalDataSourceName") + private String name; + + /** + * Gets or sets the name of the provider for the external data source. + */ + private String provider; + + /** + * Gets or sets the name of the provider string for the external data + * source. + */ + private String providerString; + + /** + * Gets or sets the list of types to push down from the external data + * source. + */ + private List pushdownTypes; + + /** + * Get the databaseName value. + * + * @return the databaseName value + */ + public String getDatabaseName() { + return this.databaseName; + } + + /** + * Set the databaseName value. + * + * @param databaseName the databaseName value to set + */ + public void setDatabaseName(String databaseName) { + this.databaseName = databaseName; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String getName() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * Get the provider value. + * + * @return the provider value + */ + public String getProvider() { + return this.provider; + } + + /** + * Set the provider value. + * + * @param provider the provider value to set + */ + public void setProvider(String provider) { + this.provider = provider; + } + + /** + * Get the providerString value. + * + * @return the providerString value + */ + public String getProviderString() { + return this.providerString; + } + + /** + * Set the providerString value. + * + * @param providerString the providerString value to set + */ + public void setProviderString(String providerString) { + this.providerString = providerString; + } + + /** + * Get the pushdownTypes value. + * + * @return the pushdownTypes value + */ + public List getPushdownTypes() { + return this.pushdownTypes; + } + + /** + * Set the pushdownTypes value. + * + * @param pushdownTypes the pushdownTypes value to set + */ + public void setPushdownTypes(List pushdownTypes) { + this.pushdownTypes = pushdownTypes; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlIndex.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlIndex.java new file mode 100644 index 000000000000..138b6cbd16be --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlIndex.java @@ -0,0 +1,251 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import java.util.List; +import java.util.UUID; + +/** + * A Data Lake Analytics catalog U-SQL table index item. + */ +public class USqlIndex { + /** + * Gets or sets the name of the index in the table. + */ + private String name; + + /** + * Gets or sets the list of directed columns in the index. + */ + private List indexKeys; + + /** + * Gets or sets the list of columns in the index. + */ + private List columns; + + /** + * Gets or sets the distributions info of the index. + */ + private USqlDistributionInfo distributionInfo; + + /** + * Gets or sets partition function ID for the index. + */ + private UUID partitionFunction; + + /** + * Gets or sets the list of partion keys in the index. + */ + private List partitionKeyList; + + /** + * Gets or sets the list of full paths to the streams that contain this + * index in the DataLake account. + */ + private List streamNames; + + /** + * Gets or sets the switch indicating if this index is a columnstore index. + */ + private Boolean isColumnstore; + + /** + * Gets or sets the ID of this index within the table. + */ + private Integer indexId; + + /** + * Gets or sets the switch indicating if this index is a unique index. + */ + private Boolean isUnique; + + /** + * Get the name value. + * + * @return the name value + */ + public String getName() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * Get the indexKeys value. + * + * @return the indexKeys value + */ + public List getIndexKeys() { + return this.indexKeys; + } + + /** + * Set the indexKeys value. + * + * @param indexKeys the indexKeys value to set + */ + public void setIndexKeys(List indexKeys) { + this.indexKeys = indexKeys; + } + + /** + * Get the columns value. + * + * @return the columns value + */ + public List getColumns() { + return this.columns; + } + + /** + * Set the columns value. + * + * @param columns the columns value to set + */ + public void setColumns(List columns) { + this.columns = columns; + } + + /** + * Get the distributionInfo value. + * + * @return the distributionInfo value + */ + public USqlDistributionInfo getDistributionInfo() { + return this.distributionInfo; + } + + /** + * Set the distributionInfo value. + * + * @param distributionInfo the distributionInfo value to set + */ + public void setDistributionInfo(USqlDistributionInfo distributionInfo) { + this.distributionInfo = distributionInfo; + } + + /** + * Get the partitionFunction value. + * + * @return the partitionFunction value + */ + public UUID getPartitionFunction() { + return this.partitionFunction; + } + + /** + * Set the partitionFunction value. + * + * @param partitionFunction the partitionFunction value to set + */ + public void setPartitionFunction(UUID partitionFunction) { + this.partitionFunction = partitionFunction; + } + + /** + * Get the partitionKeyList value. + * + * @return the partitionKeyList value + */ + public List getPartitionKeyList() { + return this.partitionKeyList; + } + + /** + * Set the partitionKeyList value. + * + * @param partitionKeyList the partitionKeyList value to set + */ + public void setPartitionKeyList(List partitionKeyList) { + this.partitionKeyList = partitionKeyList; + } + + /** + * Get the streamNames value. + * + * @return the streamNames value + */ + public List getStreamNames() { + return this.streamNames; + } + + /** + * Set the streamNames value. + * + * @param streamNames the streamNames value to set + */ + public void setStreamNames(List streamNames) { + this.streamNames = streamNames; + } + + /** + * Get the isColumnstore value. + * + * @return the isColumnstore value + */ + public Boolean getIsColumnstore() { + return this.isColumnstore; + } + + /** + * Set the isColumnstore value. + * + * @param isColumnstore the isColumnstore value to set + */ + public void setIsColumnstore(Boolean isColumnstore) { + this.isColumnstore = isColumnstore; + } + + /** + * Get the indexId value. + * + * @return the indexId value + */ + public Integer getIndexId() { + return this.indexId; + } + + /** + * Set the indexId value. + * + * @param indexId the indexId value to set + */ + public void setIndexId(Integer indexId) { + this.indexId = indexId; + } + + /** + * Get the isUnique value. + * + * @return the isUnique value + */ + public Boolean getIsUnique() { + return this.isUnique; + } + + /** + * Set the isUnique value. + * + * @param isUnique the isUnique value to set + */ + public void setIsUnique(Boolean isUnique) { + this.isUnique = isUnique; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlJobProperties.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlJobProperties.java new file mode 100644 index 000000000000..00db240b0443 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlJobProperties.java @@ -0,0 +1,246 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The USqlJobProperties model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("USql") +public class USqlJobProperties extends JobProperties { + /** + * Gets or sets the list of resources that are required by the job. + */ + private List resources; + + /** + * Gets or sets the job specific statistics. + */ + private JobStatistics statistics; + + /** + * Gets or sets the job specific debug data locations. + */ + private JobDataPath debugData; + + /** + * Gets the U-SQL algebra file path after the job has completed. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String algebraFilePath; + + /** + * Gets the total time this job spent compiling. This value should not be + * set by the user and will be ignored if it is. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String totalCompilationTime; + + /** + * Gets the total time this job spent paused. This value should not be set + * by the user and will be ignored if it is. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String totalPauseTime; + + /** + * Gets the total time this job spent queued. This value should not be set + * by the user and will be ignored if it is. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String totalQueuedTime; + + /** + * Gets the total time this job spent executing. This value should not be + * set by the user and will be ignored if it is. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String totalRunningTime; + + /** + * Gets the ID used to identify the job manager coordinating job + * execution. This value should not be set by the user and will be + * ignored if it is. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String rootProcessNodeId; + + /** + * Gets the ID used to identify the yarn application executing the job. + * This value should not be set by the user and will be ignored if it is. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String yarnApplicationId; + + /** + * Gets the timestamp (in ticks) for the yarn application executing the + * job. This value should not be set by the user and will be ignored if + * it is. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Long yarnApplicationTimeStamp; + + /** + * Gets or sets the compile mode for the job. Possible values include: + * 'Semantic', 'Full', 'SingleBox'. + */ + private String compileMode; + + /** + * Get the resources value. + * + * @return the resources value + */ + public List getResources() { + return this.resources; + } + + /** + * Set the resources value. + * + * @param resources the resources value to set + */ + public void setResources(List resources) { + this.resources = resources; + } + + /** + * Get the statistics value. + * + * @return the statistics value + */ + public JobStatistics getStatistics() { + return this.statistics; + } + + /** + * Set the statistics value. + * + * @param statistics the statistics value to set + */ + public void setStatistics(JobStatistics statistics) { + this.statistics = statistics; + } + + /** + * Get the debugData value. + * + * @return the debugData value + */ + public JobDataPath getDebugData() { + return this.debugData; + } + + /** + * Set the debugData value. + * + * @param debugData the debugData value to set + */ + public void setDebugData(JobDataPath debugData) { + this.debugData = debugData; + } + + /** + * Get the algebraFilePath value. + * + * @return the algebraFilePath value + */ + public String getAlgebraFilePath() { + return this.algebraFilePath; + } + + /** + * Get the totalCompilationTime value. + * + * @return the totalCompilationTime value + */ + public String getTotalCompilationTime() { + return this.totalCompilationTime; + } + + /** + * Get the totalPauseTime value. + * + * @return the totalPauseTime value + */ + public String getTotalPauseTime() { + return this.totalPauseTime; + } + + /** + * Get the totalQueuedTime value. + * + * @return the totalQueuedTime value + */ + public String getTotalQueuedTime() { + return this.totalQueuedTime; + } + + /** + * Get the totalRunningTime value. + * + * @return the totalRunningTime value + */ + public String getTotalRunningTime() { + return this.totalRunningTime; + } + + /** + * Get the rootProcessNodeId value. + * + * @return the rootProcessNodeId value + */ + public String getRootProcessNodeId() { + return this.rootProcessNodeId; + } + + /** + * Get the yarnApplicationId value. + * + * @return the yarnApplicationId value + */ + public String getYarnApplicationId() { + return this.yarnApplicationId; + } + + /** + * Get the yarnApplicationTimeStamp value. + * + * @return the yarnApplicationTimeStamp value + */ + public Long getYarnApplicationTimeStamp() { + return this.yarnApplicationTimeStamp; + } + + /** + * Get the compileMode value. + * + * @return the compileMode value + */ + public String getCompileMode() { + return this.compileMode; + } + + /** + * Set the compileMode value. + * + * @param compileMode the compileMode value to set + */ + public void setCompileMode(String compileMode) { + this.compileMode = compileMode; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlProcedure.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlProcedure.java new file mode 100644 index 000000000000..66e72c1860e3 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlProcedure.java @@ -0,0 +1,113 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A Data Lake Analytics catalog U-SQL procedure item. + */ +public class USqlProcedure extends CatalogItem { + /** + * Gets or sets the name of the database. + */ + private String databaseName; + + /** + * Gets or sets the name of the schema associated with this procedure and + * database. + */ + private String schemaName; + + /** + * Gets or sets the name of the procedure. + */ + @JsonProperty(value = "procName") + private String name; + + /** + * Gets or sets the defined query of the procedure. + */ + private String definition; + + /** + * Get the databaseName value. + * + * @return the databaseName value + */ + public String getDatabaseName() { + return this.databaseName; + } + + /** + * Set the databaseName value. + * + * @param databaseName the databaseName value to set + */ + public void setDatabaseName(String databaseName) { + this.databaseName = databaseName; + } + + /** + * Get the schemaName value. + * + * @return the schemaName value + */ + public String getSchemaName() { + return this.schemaName; + } + + /** + * Set the schemaName value. + * + * @param schemaName the schemaName value to set + */ + public void setSchemaName(String schemaName) { + this.schemaName = schemaName; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String getName() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * Get the definition value. + * + * @return the definition value + */ + public String getDefinition() { + return this.definition; + } + + /** + * Set the definition value. + * + * @param definition the definition value to set + */ + public void setDefinition(String definition) { + this.definition = definition; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlSchema.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlSchema.java new file mode 100644 index 000000000000..dbc96cfe6b42 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlSchema.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A Data Lake Analytics catalog U-SQL schema item. + */ +public class USqlSchema extends CatalogItem { + /** + * Gets or sets the name of the database. + */ + private String databaseName; + + /** + * Gets or sets the name of the schema. + */ + @JsonProperty(value = "schemaName") + private String name; + + /** + * Get the databaseName value. + * + * @return the databaseName value + */ + public String getDatabaseName() { + return this.databaseName; + } + + /** + * Set the databaseName value. + * + * @param databaseName the databaseName value to set + */ + public void setDatabaseName(String databaseName) { + this.databaseName = databaseName; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String getName() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + */ + public void setName(String name) { + this.name = name; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlSecret.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlSecret.java new file mode 100644 index 000000000000..cee443122fa3 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlSecret.java @@ -0,0 +1,138 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import org.joda.time.DateTime; + +/** + * A Data Lake Analytics catalog U-SQL secret item. + */ +public class USqlSecret extends CatalogItem { + /** + * Gets or sets the name of the database. + */ + private String databaseName; + + /** + * Gets or sets the name of the secret. + */ + @JsonProperty(value = "secretName") + private String name; + + /** + * Gets or sets the creation time of the credential object. This is the + * only information returned about a secret from a GET. + */ + private DateTime creationTime; + + /** + * Gets or sets the URI identifier for the secret in the format + * <hostname>:<port>. + */ + private String uri; + + /** + * Gets or sets the password for the secret to pass in. + */ + private String password; + + /** + * Get the databaseName value. + * + * @return the databaseName value + */ + public String getDatabaseName() { + return this.databaseName; + } + + /** + * Set the databaseName value. + * + * @param databaseName the databaseName value to set + */ + public void setDatabaseName(String databaseName) { + this.databaseName = databaseName; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String getName() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * Get the creationTime value. + * + * @return the creationTime value + */ + public DateTime getCreationTime() { + return this.creationTime; + } + + /** + * Set the creationTime value. + * + * @param creationTime the creationTime value to set + */ + public void setCreationTime(DateTime creationTime) { + this.creationTime = creationTime; + } + + /** + * Get the uri value. + * + * @return the uri value + */ + public String getUri() { + return this.uri; + } + + /** + * Set the uri value. + * + * @param uri the uri value to set + */ + public void setUri(String uri) { + this.uri = uri; + } + + /** + * Get the password value. + * + * @return the password value + */ + public String getPassword() { + return this.password; + } + + /** + * Set the password value. + * + * @param password the password value to set + */ + public void setPassword(String password) { + this.password = password; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlTable.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlTable.java new file mode 100644 index 000000000000..e83c0fba83f0 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlTable.java @@ -0,0 +1,183 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A Data Lake Analytics catalog U-SQL table item. + */ +public class USqlTable extends CatalogItem { + /** + * Gets or sets the name of the database. + */ + private String databaseName; + + /** + * Gets or sets the name of the schema associated with this table and + * database. + */ + private String schemaName; + + /** + * Gets or sets the name of the table. + */ + @JsonProperty(value = "tableName") + private String name; + + /** + * Gets or sets the list of columns in this table. + */ + private List columnList; + + /** + * Gets or sets the list of indices in this table. + */ + private List indexList; + + /** + * Gets or sets the list of partition keys in the table. + */ + private List partitionKeyList; + + /** + * Gets or sets the external table associated with the table. + */ + private ExternalTable externalTable; + + /** + * Get the databaseName value. + * + * @return the databaseName value + */ + public String getDatabaseName() { + return this.databaseName; + } + + /** + * Set the databaseName value. + * + * @param databaseName the databaseName value to set + */ + public void setDatabaseName(String databaseName) { + this.databaseName = databaseName; + } + + /** + * Get the schemaName value. + * + * @return the schemaName value + */ + public String getSchemaName() { + return this.schemaName; + } + + /** + * Set the schemaName value. + * + * @param schemaName the schemaName value to set + */ + public void setSchemaName(String schemaName) { + this.schemaName = schemaName; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String getName() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * Get the columnList value. + * + * @return the columnList value + */ + public List getColumnList() { + return this.columnList; + } + + /** + * Set the columnList value. + * + * @param columnList the columnList value to set + */ + public void setColumnList(List columnList) { + this.columnList = columnList; + } + + /** + * Get the indexList value. + * + * @return the indexList value + */ + public List getIndexList() { + return this.indexList; + } + + /** + * Set the indexList value. + * + * @param indexList the indexList value to set + */ + public void setIndexList(List indexList) { + this.indexList = indexList; + } + + /** + * Get the partitionKeyList value. + * + * @return the partitionKeyList value + */ + public List getPartitionKeyList() { + return this.partitionKeyList; + } + + /** + * Set the partitionKeyList value. + * + * @param partitionKeyList the partitionKeyList value to set + */ + public void setPartitionKeyList(List partitionKeyList) { + this.partitionKeyList = partitionKeyList; + } + + /** + * Get the externalTable value. + * + * @return the externalTable value + */ + public ExternalTable getExternalTable() { + return this.externalTable; + } + + /** + * Set the externalTable value. + * + * @param externalTable the externalTable value to set + */ + public void setExternalTable(ExternalTable externalTable) { + this.externalTable = externalTable; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlTableColumn.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlTableColumn.java new file mode 100644 index 000000000000..27ce6b41f2d0 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlTableColumn.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + + +/** + * A Data Lake Analytics catalog U-SQL table column item. + */ +public class USqlTableColumn { + /** + * Gets or sets the name of the column in the table. + */ + private String name; + + /** + * Gets or sets the object type of the specified column (such as + * System.String). + */ + private String type; + + /** + * Get the name value. + * + * @return the name value + */ + public String getName() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * Get the type value. + * + * @return the type value + */ + public String getType() { + return this.type; + } + + /** + * Set the type value. + * + * @param type the type value to set + */ + public void setType(String type) { + this.type = type; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlTableStatistics.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlTableStatistics.java new file mode 100644 index 000000000000..07581bcf141b --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlTableStatistics.java @@ -0,0 +1,323 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import org.joda.time.DateTime; +import java.util.List; + +/** + * A Data Lake Analytics catalog U-SQL table statistics item. + */ +public class USqlTableStatistics extends CatalogItem { + /** + * Gets or sets the name of the database. + */ + private String databaseName; + + /** + * Gets or sets the name of the schema associated with this table and + * database. + */ + private String schemaName; + + /** + * Gets or sets the name of the table. + */ + private String tableName; + + /** + * Gets or sets the name of the table statistics. + */ + @JsonProperty(value = "statisticsName") + private String name; + + /** + * Gets or sets the name of the user statistics. + */ + private String userStatName; + + /** + * Gets or sets the path to the statistics data. + */ + private String statDataPath; + + /** + * Gets or sets the creation time of the statistics. + */ + private DateTime createTime; + + /** + * Gets or sets the last time the statistics were updated. + */ + private DateTime updateTime; + + /** + * Gets or sets the switch indicating if these statistics are user created. + */ + private Boolean isUserCreated; + + /** + * Gets or sets the switch indicating if these statistics are + * automatically created. + */ + private Boolean isAutoCreated; + + /** + * Gets or sets the switch indicating if these statistics have a filter. + */ + private Boolean hasFilter; + + /** + * Gets or sets the filter definition for the statistics. + */ + private String filterDefinition; + + /** + * Gets or sets the list of column names associated with these statistics. + */ + private List colNames; + + /** + * Get the databaseName value. + * + * @return the databaseName value + */ + public String getDatabaseName() { + return this.databaseName; + } + + /** + * Set the databaseName value. + * + * @param databaseName the databaseName value to set + */ + public void setDatabaseName(String databaseName) { + this.databaseName = databaseName; + } + + /** + * Get the schemaName value. + * + * @return the schemaName value + */ + public String getSchemaName() { + return this.schemaName; + } + + /** + * Set the schemaName value. + * + * @param schemaName the schemaName value to set + */ + public void setSchemaName(String schemaName) { + this.schemaName = schemaName; + } + + /** + * Get the tableName value. + * + * @return the tableName value + */ + public String getTableName() { + return this.tableName; + } + + /** + * Set the tableName value. + * + * @param tableName the tableName value to set + */ + public void setTableName(String tableName) { + this.tableName = tableName; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String getName() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * Get the userStatName value. + * + * @return the userStatName value + */ + public String getUserStatName() { + return this.userStatName; + } + + /** + * Set the userStatName value. + * + * @param userStatName the userStatName value to set + */ + public void setUserStatName(String userStatName) { + this.userStatName = userStatName; + } + + /** + * Get the statDataPath value. + * + * @return the statDataPath value + */ + public String getStatDataPath() { + return this.statDataPath; + } + + /** + * Set the statDataPath value. + * + * @param statDataPath the statDataPath value to set + */ + public void setStatDataPath(String statDataPath) { + this.statDataPath = statDataPath; + } + + /** + * Get the createTime value. + * + * @return the createTime value + */ + public DateTime getCreateTime() { + return this.createTime; + } + + /** + * Set the createTime value. + * + * @param createTime the createTime value to set + */ + public void setCreateTime(DateTime createTime) { + this.createTime = createTime; + } + + /** + * Get the updateTime value. + * + * @return the updateTime value + */ + public DateTime getUpdateTime() { + return this.updateTime; + } + + /** + * Set the updateTime value. + * + * @param updateTime the updateTime value to set + */ + public void setUpdateTime(DateTime updateTime) { + this.updateTime = updateTime; + } + + /** + * Get the isUserCreated value. + * + * @return the isUserCreated value + */ + public Boolean getIsUserCreated() { + return this.isUserCreated; + } + + /** + * Set the isUserCreated value. + * + * @param isUserCreated the isUserCreated value to set + */ + public void setIsUserCreated(Boolean isUserCreated) { + this.isUserCreated = isUserCreated; + } + + /** + * Get the isAutoCreated value. + * + * @return the isAutoCreated value + */ + public Boolean getIsAutoCreated() { + return this.isAutoCreated; + } + + /** + * Set the isAutoCreated value. + * + * @param isAutoCreated the isAutoCreated value to set + */ + public void setIsAutoCreated(Boolean isAutoCreated) { + this.isAutoCreated = isAutoCreated; + } + + /** + * Get the hasFilter value. + * + * @return the hasFilter value + */ + public Boolean getHasFilter() { + return this.hasFilter; + } + + /** + * Set the hasFilter value. + * + * @param hasFilter the hasFilter value to set + */ + public void setHasFilter(Boolean hasFilter) { + this.hasFilter = hasFilter; + } + + /** + * Get the filterDefinition value. + * + * @return the filterDefinition value + */ + public String getFilterDefinition() { + return this.filterDefinition; + } + + /** + * Set the filterDefinition value. + * + * @param filterDefinition the filterDefinition value to set + */ + public void setFilterDefinition(String filterDefinition) { + this.filterDefinition = filterDefinition; + } + + /** + * Get the colNames value. + * + * @return the colNames value + */ + public List getColNames() { + return this.colNames; + } + + /** + * Set the colNames value. + * + * @param colNames the colNames value to set + */ + public void setColNames(List colNames) { + this.colNames = colNames; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlTableValuedFunction.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlTableValuedFunction.java new file mode 100644 index 000000000000..024afd5bbe07 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlTableValuedFunction.java @@ -0,0 +1,112 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A Data Lake Analytics catalog U-SQL table valued function item. + */ +public class USqlTableValuedFunction extends CatalogItem { + /** + * Gets or sets the name of the database. + */ + private String databaseName; + + /** + * Gets or sets the name of the schema associated with this database. + */ + private String schemaName; + + /** + * Gets or sets the name of the table valued function. + */ + @JsonProperty(value = "tvfName") + private String name; + + /** + * Gets or sets the definition of the table valued function. + */ + private String definition; + + /** + * Get the databaseName value. + * + * @return the databaseName value + */ + public String getDatabaseName() { + return this.databaseName; + } + + /** + * Set the databaseName value. + * + * @param databaseName the databaseName value to set + */ + public void setDatabaseName(String databaseName) { + this.databaseName = databaseName; + } + + /** + * Get the schemaName value. + * + * @return the schemaName value + */ + public String getSchemaName() { + return this.schemaName; + } + + /** + * Set the schemaName value. + * + * @param schemaName the schemaName value to set + */ + public void setSchemaName(String schemaName) { + this.schemaName = schemaName; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String getName() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * Get the definition value. + * + * @return the definition value + */ + public String getDefinition() { + return this.definition; + } + + /** + * Set the definition value. + * + * @param definition the definition value to set + */ + public void setDefinition(String definition) { + this.definition = definition; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlType.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlType.java new file mode 100644 index 000000000000..8abe187f8fd8 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlType.java @@ -0,0 +1,366 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A Data Lake Analytics catalog U-SQL type item. + */ +public class USqlType extends CatalogItem { + /** + * Gets or sets the name of the database. + */ + private String databaseName; + + /** + * Gets or sets the name of the schema associated with this table and + * database. + */ + private String schemaName; + + /** + * Gets or sets the name of type for this type. + */ + @JsonProperty(value = "typeName") + private String name; + + /** + * Gets or sets the type family for this type. + */ + private String typeFamily; + + /** + * Gets or sets the C# name for this type. + */ + private String cSharpName; + + /** + * Gets or sets the fully qualified C# name for this type. + */ + private String fullCSharpName; + + /** + * Gets or sets the system type ID for this type. + */ + private Integer systemTypeId; + + /** + * Gets or sets the user type ID for this type. + */ + private Integer userTypeId; + + /** + * Gets or sets the schema ID for this type. + */ + private Integer schemaId; + + /** + * Gets or sets the principal ID for this type. + */ + private Integer principalId; + + /** + * Gets or sets the the switch indicating if this type is nullable. + */ + private Boolean isNullable; + + /** + * Gets or sets the the switch indicating if this type is user defined. + */ + private Boolean isUserDefined; + + /** + * Gets or sets the the switch indicating if this type is an assembly type. + */ + private Boolean isAssemblyType; + + /** + * Gets or sets the the switch indicating if this type is a table type. + */ + private Boolean isTableType; + + /** + * Gets or sets the the switch indicating if this type is a complex type. + */ + private Boolean isComplexType; + + /** + * Get the databaseName value. + * + * @return the databaseName value + */ + public String getDatabaseName() { + return this.databaseName; + } + + /** + * Set the databaseName value. + * + * @param databaseName the databaseName value to set + */ + public void setDatabaseName(String databaseName) { + this.databaseName = databaseName; + } + + /** + * Get the schemaName value. + * + * @return the schemaName value + */ + public String getSchemaName() { + return this.schemaName; + } + + /** + * Set the schemaName value. + * + * @param schemaName the schemaName value to set + */ + public void setSchemaName(String schemaName) { + this.schemaName = schemaName; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String getName() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * Get the typeFamily value. + * + * @return the typeFamily value + */ + public String getTypeFamily() { + return this.typeFamily; + } + + /** + * Set the typeFamily value. + * + * @param typeFamily the typeFamily value to set + */ + public void setTypeFamily(String typeFamily) { + this.typeFamily = typeFamily; + } + + /** + * Get the cSharpName value. + * + * @return the cSharpName value + */ + public String getCSharpName() { + return this.cSharpName; + } + + /** + * Set the cSharpName value. + * + * @param cSharpName the cSharpName value to set + */ + public void setCSharpName(String cSharpName) { + this.cSharpName = cSharpName; + } + + /** + * Get the fullCSharpName value. + * + * @return the fullCSharpName value + */ + public String getFullCSharpName() { + return this.fullCSharpName; + } + + /** + * Set the fullCSharpName value. + * + * @param fullCSharpName the fullCSharpName value to set + */ + public void setFullCSharpName(String fullCSharpName) { + this.fullCSharpName = fullCSharpName; + } + + /** + * Get the systemTypeId value. + * + * @return the systemTypeId value + */ + public Integer getSystemTypeId() { + return this.systemTypeId; + } + + /** + * Set the systemTypeId value. + * + * @param systemTypeId the systemTypeId value to set + */ + public void setSystemTypeId(Integer systemTypeId) { + this.systemTypeId = systemTypeId; + } + + /** + * Get the userTypeId value. + * + * @return the userTypeId value + */ + public Integer getUserTypeId() { + return this.userTypeId; + } + + /** + * Set the userTypeId value. + * + * @param userTypeId the userTypeId value to set + */ + public void setUserTypeId(Integer userTypeId) { + this.userTypeId = userTypeId; + } + + /** + * Get the schemaId value. + * + * @return the schemaId value + */ + public Integer getSchemaId() { + return this.schemaId; + } + + /** + * Set the schemaId value. + * + * @param schemaId the schemaId value to set + */ + public void setSchemaId(Integer schemaId) { + this.schemaId = schemaId; + } + + /** + * Get the principalId value. + * + * @return the principalId value + */ + public Integer getPrincipalId() { + return this.principalId; + } + + /** + * Set the principalId value. + * + * @param principalId the principalId value to set + */ + public void setPrincipalId(Integer principalId) { + this.principalId = principalId; + } + + /** + * Get the isNullable value. + * + * @return the isNullable value + */ + public Boolean getIsNullable() { + return this.isNullable; + } + + /** + * Set the isNullable value. + * + * @param isNullable the isNullable value to set + */ + public void setIsNullable(Boolean isNullable) { + this.isNullable = isNullable; + } + + /** + * Get the isUserDefined value. + * + * @return the isUserDefined value + */ + public Boolean getIsUserDefined() { + return this.isUserDefined; + } + + /** + * Set the isUserDefined value. + * + * @param isUserDefined the isUserDefined value to set + */ + public void setIsUserDefined(Boolean isUserDefined) { + this.isUserDefined = isUserDefined; + } + + /** + * Get the isAssemblyType value. + * + * @return the isAssemblyType value + */ + public Boolean getIsAssemblyType() { + return this.isAssemblyType; + } + + /** + * Set the isAssemblyType value. + * + * @param isAssemblyType the isAssemblyType value to set + */ + public void setIsAssemblyType(Boolean isAssemblyType) { + this.isAssemblyType = isAssemblyType; + } + + /** + * Get the isTableType value. + * + * @return the isTableType value + */ + public Boolean getIsTableType() { + return this.isTableType; + } + + /** + * Set the isTableType value. + * + * @param isTableType the isTableType value to set + */ + public void setIsTableType(Boolean isTableType) { + this.isTableType = isTableType; + } + + /** + * Get the isComplexType value. + * + * @return the isComplexType value + */ + public Boolean getIsComplexType() { + return this.isComplexType; + } + + /** + * Set the isComplexType value. + * + * @param isComplexType the isComplexType value to set + */ + public void setIsComplexType(Boolean isComplexType) { + this.isComplexType = isComplexType; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlView.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlView.java new file mode 100644 index 000000000000..0406b55c4e6c --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlView.java @@ -0,0 +1,113 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.analytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A Data Lake Analytics catalog U-SQL view item. + */ +public class USqlView extends CatalogItem { + /** + * Gets or sets the name of the database. + */ + private String databaseName; + + /** + * Gets or sets the name of the schema associated with this view and + * database. + */ + private String schemaName; + + /** + * Gets or sets the name of the view. + */ + @JsonProperty(value = "viewName") + private String name; + + /** + * Gets or sets the defined query of the view. + */ + private String definition; + + /** + * Get the databaseName value. + * + * @return the databaseName value + */ + public String getDatabaseName() { + return this.databaseName; + } + + /** + * Set the databaseName value. + * + * @param databaseName the databaseName value to set + */ + public void setDatabaseName(String databaseName) { + this.databaseName = databaseName; + } + + /** + * Get the schemaName value. + * + * @return the schemaName value + */ + public String getSchemaName() { + return this.schemaName; + } + + /** + * Set the schemaName value. + * + * @param schemaName the schemaName value to set + */ + public void setSchemaName(String schemaName) { + this.schemaName = schemaName; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String getName() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * Get the definition value. + * + * @return the definition value + */ + public String getDefinition() { + return this.definition; + } + + /** + * Set the definition value. + * + * @param definition the definition value to set + */ + public void setDefinition(String definition) { + this.definition = definition; + } + +} diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/package-info.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/package-info.java new file mode 100644 index 000000000000..cf09f9019c63 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/package-info.java @@ -0,0 +1,13 @@ +// 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 0.16.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the model classes for DataLakeAnalyticsJobManagementClient. + * Creates an Azure Data Lake Analytics job client. + */ +package com.microsoft.azure.management.datalake.analytics.models; diff --git a/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/package-info.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/package-info.java new file mode 100644 index 000000000000..6be25ff10f99 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/package-info.java @@ -0,0 +1,13 @@ +// 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 0.16.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for DataLakeAnalyticsJobManagementClient. + * Creates an Azure Data Lake Analytics job client. + */ +package com.microsoft.azure.management.datalake.analytics; diff --git a/azure-mgmt-datalake-analytics/src/test/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsAccountOperationsTests.java b/azure-mgmt-datalake-analytics/src/test/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsAccountOperationsTests.java new file mode 100644 index 000000000000..93a2f99f5d2d --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/test/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsAccountOperationsTests.java @@ -0,0 +1,206 @@ +package com.microsoft.azure.management.datalake.analytics; + +import com.microsoft.azure.management.datalake.analytics.models.AddDataLakeStoreParameters; +import com.microsoft.azure.management.datalake.analytics.models.AddStorageAccountParameters; +import com.microsoft.azure.management.datalake.analytics.models.DataLakeAnalyticsAccount; +import com.microsoft.azure.management.datalake.analytics.models.DataLakeAnalyticsAccountProperties; +import com.microsoft.azure.management.datalake.analytics.models.DataLakeStoreAccountInfo; +import com.microsoft.azure.management.datalake.analytics.models.DataLakeStoreAccountInfoProperties; +import com.microsoft.azure.management.datalake.analytics.models.StorageAccountInfo; +import com.microsoft.azure.management.datalake.analytics.models.StorageAccountProperties; +import com.microsoft.azure.management.datalake.store.models.DataLakeStoreAccount; +import com.microsoft.azure.management.resources.models.ResourceGroup; +import com.microsoft.azure.management.storage.models.AccountType; +import com.microsoft.azure.management.storage.models.StorageAccountCreateParameters; + +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +public class DataLakeAnalyticsAccountOperationsTests extends DataLakeAnalyticsManagementTestBase { + private static String rgName = generateName("javaadlarg"); + private static String location = "eastus2"; + private static String storageAcct = generateName("javasto"); + private static String adlsAcct = generateName("javaadlsacct"); + private static String adlsAcct2 = generateName("javaadlsacct2"); + private static String adlaAcct = generateName("javaadlaacct"); + private static String storageAccessKey = ""; + + @BeforeClass + public static void setup() throws Exception { + createClients(); + ResourceGroup group = new ResourceGroup(); + group.setLocation(location); + resourceManagementClient.getResourceGroupsOperations().createOrUpdate(rgName, group); + // create storage and ADLS accounts, setting the accessKey + DataLakeStoreAccount adlsAccount = new DataLakeStoreAccount(); + adlsAccount.setLocation(location); + adlsAccount.setName(adlsAcct); + dataLakeStoreAccountManagementClient.getAccountOperations().create(rgName, adlsAcct, adlsAccount); + adlsAccount.setName(adlsAcct2); + dataLakeStoreAccountManagementClient.getAccountOperations().create(rgName, adlsAcct2, adlsAccount); + + StorageAccountCreateParameters createParams = new StorageAccountCreateParameters(); + createParams.setLocation(location); + createParams.setAccountType(AccountType.STANDARD_LRS); + storageManagementClient.getStorageAccountsOperations().create(rgName, storageAcct, createParams); + storageAccessKey = storageManagementClient.getStorageAccountsOperations().listKeys(rgName, storageAcct).getBody().getKey1(); + } + + @AfterClass + public static void cleanup() throws Exception { + try { + dataLakeAnalyticsAccountManagementClient.getAccountOperations().delete(rgName, adlaAcct); + resourceManagementClient.getResourceGroupsOperations().delete(rgName); + } + catch (Exception e) { + // ignore failures during cleanup, as it is best effort + } + } + @Test + public void canCreateGetUpdateDeleteAdlaAccount() throws Exception { + // Create + DataLakeAnalyticsAccountProperties createProperties = new DataLakeAnalyticsAccountProperties(); + List adlsAccts = new ArrayList(); + DataLakeStoreAccountInfo adlsInfo = new DataLakeStoreAccountInfo(); + adlsInfo.setName(adlsAcct); + adlsAccts.add(adlsInfo); + + createProperties.setDataLakeStoreAccounts(adlsAccts); + createProperties.setDefaultDataLakeStoreAccount(adlsAcct); + + DataLakeAnalyticsAccount createParams = new DataLakeAnalyticsAccount(); + createParams.setLocation(location); + createParams.setName(adlaAcct); + createParams.setProperties(createProperties); + createParams.setTags(new HashMap()); + createParams.getTags().put("testkey", "testvalue"); + + DataLakeAnalyticsAccount createResponse = dataLakeAnalyticsAccountManagementClient.getAccountOperations().create(rgName, adlaAcct, createParams).getBody(); + Assert.assertEquals(location, createResponse.getLocation()); + Assert.assertEquals("Microsoft.DataLakeAnalytics/accounts", createResponse.getType()); + Assert.assertNotNull(createResponse.getId()); + Assert.assertTrue(createResponse.getId().contains(adlaAcct)); + Assert.assertEquals(1, createResponse.getTags().size()); + Assert.assertEquals(1, createResponse.getProperties().getDataLakeStoreAccounts().size()); + Assert.assertEquals(adlsAcct, createResponse.getProperties().getDataLakeStoreAccounts().get(0).getName()); + + // update the tags + createParams.getTags().put("testkey2", "testvalue2"); + createParams.setProperties(null); + DataLakeAnalyticsAccount updateResponse = dataLakeAnalyticsAccountManagementClient.getAccountOperations().update(rgName, adlaAcct, createParams).getBody(); + Assert.assertEquals(location, updateResponse.getLocation()); + Assert.assertEquals("Microsoft.DataLakeAnalytics/accounts", updateResponse.getType()); + Assert.assertNotNull(updateResponse.getId()); + Assert.assertTrue(updateResponse.getId().contains(adlaAcct)); + Assert.assertEquals(2, updateResponse.getTags().size()); + Assert.assertEquals(1, updateResponse.getProperties().getDataLakeStoreAccounts().size()); + Assert.assertEquals(adlsAcct, updateResponse.getProperties().getDataLakeStoreAccounts().get(0).getName()); + + // get the account + DataLakeAnalyticsAccount getResponse = dataLakeAnalyticsAccountManagementClient.getAccountOperations().get(rgName, adlaAcct).getBody(); + Assert.assertEquals(location, getResponse.getLocation()); + Assert.assertEquals("Microsoft.DataLakeAnalytics/accounts", getResponse.getType()); + Assert.assertNotNull(getResponse.getId()); + Assert.assertTrue(getResponse.getId().contains(adlaAcct)); + Assert.assertEquals(2, getResponse.getTags().size()); + Assert.assertEquals(1, getResponse.getProperties().getDataLakeStoreAccounts().size()); + Assert.assertEquals(adlsAcct, getResponse.getProperties().getDataLakeStoreAccounts().get(0).getName()); + + // list all accounts and make sure there is one. + List listResult = dataLakeAnalyticsAccountManagementClient.getAccountOperations().list().getBody(); + DataLakeAnalyticsAccount discoveredAcct = null; + for (DataLakeAnalyticsAccount acct : listResult) { + if (acct.getName().equals(adlaAcct)) { + discoveredAcct = acct; + break; + } + } + + Assert.assertNotNull(discoveredAcct); + Assert.assertEquals(location, discoveredAcct.getLocation()); + Assert.assertEquals("Microsoft.DataLakeAnalytics/accounts", discoveredAcct.getType()); + Assert.assertNotNull(discoveredAcct.getId()); + Assert.assertTrue(discoveredAcct.getId().contains(adlaAcct)); + Assert.assertEquals(2, discoveredAcct.getTags().size()); + + // the properties should be empty when we do list calls + Assert.assertNull(discoveredAcct.getProperties().getDataLakeStoreAccounts()); + + // list within a resource group + listResult = dataLakeAnalyticsAccountManagementClient.getAccountOperations().listByResourceGroup(rgName).getBody(); + discoveredAcct = null; + for (DataLakeAnalyticsAccount acct : listResult) { + if (acct.getName().equals(adlaAcct)) { + discoveredAcct = acct; + break; + } + } + + Assert.assertNotNull(discoveredAcct); + Assert.assertEquals(location, discoveredAcct.getLocation()); + Assert.assertEquals("Microsoft.DataLakeAnalytics/accounts", discoveredAcct.getType()); + Assert.assertNotNull(discoveredAcct.getId()); + Assert.assertTrue(discoveredAcct.getId().contains(adlaAcct)); + Assert.assertEquals(2, discoveredAcct.getTags().size()); + + // the properties should be empty when we do list calls + Assert.assertNull(discoveredAcct.getProperties().getDataLakeStoreAccounts()); + + // Add, list, get and remove a data lake store account + AddDataLakeStoreParameters addAdlsParams = new AddDataLakeStoreParameters(); + + // This needs to be set and empty for now due to the front end expecting a valid json body + addAdlsParams.setProperties(new DataLakeStoreAccountInfoProperties()); + dataLakeAnalyticsAccountManagementClient.getAccountOperations().addDataLakeStoreAccount(rgName, adlaAcct, adlsAcct2, addAdlsParams); + + // list ADLS accounts + List adlsListResult = dataLakeAnalyticsAccountManagementClient.getAccountOperations().listDataLakeStoreAccounts(rgName, adlaAcct).getBody(); + Assert.assertEquals(2, adlsListResult.size()); + + // get the one we just added + DataLakeStoreAccountInfo adlsGetResult = dataLakeAnalyticsAccountManagementClient.getAccountOperations().getDataLakeStoreAccount(rgName, adlaAcct, adlsAcct2).getBody(); + Assert.assertEquals(adlsAcct2, adlsGetResult.getName()); + + // Remove the data source + dataLakeAnalyticsAccountManagementClient.getAccountOperations().deleteDataLakeStoreAccount(rgName, adlaAcct, adlsAcct2); + + // list again, confirming there is only one ADLS account + adlsListResult = dataLakeAnalyticsAccountManagementClient.getAccountOperations().listDataLakeStoreAccounts(rgName, adlaAcct).getBody(); + Assert.assertEquals(1, adlsListResult.size()); + + // Add, list get and remove an azure blob account + AddStorageAccountParameters addStoreParams = new AddStorageAccountParameters(); + + StorageAccountProperties storageAccountProperties = new StorageAccountProperties(); + storageAccountProperties.setAccessKey(storageAccessKey); + addStoreParams.setProperties(storageAccountProperties); + dataLakeAnalyticsAccountManagementClient.getAccountOperations().addStorageAccount(rgName, adlaAcct, storageAcct, addStoreParams); + + // list ADLS accounts + List storeListResult = dataLakeAnalyticsAccountManagementClient.getAccountOperations().listStorageAccounts(rgName, adlaAcct).getBody(); + Assert.assertEquals(1, storeListResult.size()); + + // get the one we just added + StorageAccountInfo storageGetResult = dataLakeAnalyticsAccountManagementClient.getAccountOperations().getStorageAccount(rgName, adlaAcct, storageAcct).getBody(); + Assert.assertEquals(storageAcct, storageGetResult.getName()); + + // Remove the data source + dataLakeAnalyticsAccountManagementClient.getAccountOperations().deleteStorageAccount(rgName, adlaAcct, storageAcct); + + // list again, confirming there is only one ADLS account + storeListResult = dataLakeAnalyticsAccountManagementClient.getAccountOperations().listStorageAccounts(rgName, adlaAcct).getBody(); + Assert.assertEquals(0, storeListResult.size()); + + // Delete the ADLA account + dataLakeAnalyticsAccountManagementClient.getAccountOperations().delete(rgName, adlaAcct); + + // Do it again, it should not throw + dataLakeAnalyticsAccountManagementClient.getAccountOperations().delete(rgName, adlaAcct); + } +} diff --git a/azure-mgmt-datalake-analytics/src/test/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsCatalogOperationsTests.java b/azure-mgmt-datalake-analytics/src/test/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsCatalogOperationsTests.java new file mode 100644 index 000000000000..3d98f9e7ca25 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/test/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsCatalogOperationsTests.java @@ -0,0 +1,401 @@ +package com.microsoft.azure.management.datalake.analytics; + +import com.microsoft.azure.management.datalake.analytics.models.DataLakeAnalyticsAccount; +import com.microsoft.azure.management.datalake.analytics.models.DataLakeAnalyticsAccountProperties; +import com.microsoft.azure.management.datalake.analytics.models.DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters; +import com.microsoft.azure.management.datalake.analytics.models.DataLakeStoreAccountInfo; +import com.microsoft.azure.management.datalake.analytics.models.USqlCredential; +import com.microsoft.azure.management.datalake.analytics.models.USqlDatabase; +import com.microsoft.azure.management.datalake.analytics.models.USqlProcedure; +import com.microsoft.azure.management.datalake.analytics.models.USqlSecret; +import com.microsoft.azure.management.datalake.analytics.models.USqlTable; +import com.microsoft.azure.management.datalake.analytics.models.USqlTableValuedFunction; +import com.microsoft.azure.management.datalake.analytics.models.USqlType; +import com.microsoft.azure.management.datalake.analytics.models.USqlView; +import com.microsoft.azure.management.datalake.store.models.DataLakeStoreAccount; +import com.microsoft.azure.management.resources.models.ResourceGroup; + +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +public class DataLakeAnalyticsCatalogOperationsTests extends DataLakeAnalyticsManagementTestBase { + private static String rgName = generateName("javaadlarg"); + private static String location = "eastus2"; + private static String adlsAcct = generateName("javaadlsacct"); + private static String adlaAcct = generateName("javaadlaacct"); + + // catalog names + private static String dbName = generateName("testdb1"); + private static String tableName = generateName("testtable1"); + private static String tvfName = generateName("testtvf1"); + private static String procName = generateName("testproc1"); + private static String viewName = generateName("testview1"); + private static String credentialName = generateName("testcred1"); + private static String secretName = generateName("testsecret1"); + private static String secretPwd = generateName("testsecretpwd1"); + + private static String catalogCreationScript = String.format("\n" + + "DROP DATABASE IF EXISTS %s; CREATE DATABASE %s; \n" + + "//Create Table\n" + + "CREATE TABLE %s.dbo.%s\n" + + "(\n" + + " //Define schema of table\n" + + " UserId int, \n" + + " Start DateTime, \n" + + " Region string, \n" + + " Query string, \n" + + " Duration int, \n" + + " Urls string, \n" + + " ClickedUrls string,\n" + + " INDEX idx1 //Name of index\n" + + " CLUSTERED (Region ASC) //Column to cluster by\n" + + " PARTITIONED BY HASH (Region) //Column to partition by\n" + + ");\n" + + "DROP FUNCTION IF EXISTS %s.dbo.%s;\n" + + "\n" + + "//create table weblogs on space-delimited website log data\n" + + "CREATE FUNCTION %s.dbo.%s()\n" + + "RETURNS @result TABLE\n" + + "(\n" + + " s_date DateTime,\n" + + " s_time string,\n" + + " s_sitename string,\n" + + " cs_method string, \n" + + " cs_uristem string,\n" + + " cs_uriquery string,\n" + + " s_port int,\n" + + " cs_username string, \n" + + " c_ip string,\n" + + " cs_useragent string,\n" + + " cs_cookie string,\n" + + " cs_referer string, \n" + + " cs_host string,\n" + + " sc_status int,\n" + + " sc_substatus int,\n" + + " sc_win32status int, \n" + + " sc_bytes int,\n" + + " cs_bytes int,\n" + + " s_timetaken int\n" + + ")\n" + + "AS\n" + + "BEGIN\n" + + "\n" + + " @result = EXTRACT\n" + + " s_date DateTime,\n" + + " s_time string,\n" + + " s_sitename string,\n" + + " cs_method string,\n" + + " cs_uristem string,\n" + + " cs_uriquery string,\n" + + " s_port int,\n" + + " cs_username string,\n" + + " c_ip string,\n" + + " cs_useragent string,\n" + + " cs_cookie string,\n" + + " cs_referer string,\n" + + " cs_host string,\n" + + " sc_status int,\n" + + " sc_substatus int,\n" + + " sc_win32status int,\n" + + " sc_bytes int,\n" + + " cs_bytes int,\n" + + " s_timetaken int\n" + + " FROM @\"\"/Samples/Data/WebLog.log\"\"\n" + + " USING Extractors.Text(delimiter:' ');\n" + + "\n" + + "RETURN;\n" + + "END;\n" + + "CREATE VIEW %s.dbo.%s \n" + + "AS \n" + + " SELECT * FROM \n" + + " (\n" + + " VALUES(1,2),(2,4)\n" + + " ) \n" + + "AS \n" + + "T(a, b);\n" + + "CREATE PROCEDURE %s.dbo.%s()\n" + + "AS BEGIN\n" + + " CREATE VIEW %s.dbo.%s \n" + + " AS \n" + + " SELECT * FROM \n" + + " (\n" + + " VALUES(1,2),(2,4)\n" + + " ) \n" + + " AS \n" + + " T(a, b);\n" + + "END;", dbName, tableName, tvfName, viewName, procName); + + @BeforeClass + public static void setup() throws Exception { + createClients(); + ResourceGroup group = new ResourceGroup(); + group.setLocation(location); + resourceManagementClient.getResourceGroupsOperations().createOrUpdate(rgName, group); + // create storage and ADLS accounts, setting the accessKey + DataLakeStoreAccount adlsAccount = new DataLakeStoreAccount(); + adlsAccount.setLocation(location); + adlsAccount.setName(adlsAcct); + dataLakeStoreAccountManagementClient.getAccountOperations().create(rgName, adlsAcct, adlsAccount); + + // Create the ADLA acct to use. + DataLakeAnalyticsAccountProperties createProperties = new DataLakeAnalyticsAccountProperties(); + List adlsAccts = new ArrayList(); + DataLakeStoreAccountInfo adlsInfo = new DataLakeStoreAccountInfo(); + adlsInfo.setName(adlsAcct); + adlsAccts.add(adlsInfo); + + createProperties.setDataLakeStoreAccounts(adlsAccts); + createProperties.setDefaultDataLakeStoreAccount(adlsAcct); + + DataLakeAnalyticsAccount createParams = new DataLakeAnalyticsAccount(); + createParams.setLocation(location); + createParams.setName(adlaAcct); + createParams.setProperties(createProperties); + dataLakeAnalyticsAccountManagementClient.getAccountOperations().create(rgName, adlaAcct, createParams); + // Sleep for two minutes to ensure the account is totally provisioned. + Thread.sleep(120000); + + // create the catalog + runJobToCompletion(dataLakeAnalyticsJobManagementClient, adlaAcct, UUID.randomUUID(), catalogCreationScript); + } + + @AfterClass + public static void cleanup() throws Exception { + // delete the ADLA account first + try { + dataLakeAnalyticsAccountManagementClient.getAccountOperations().delete(rgName, adlaAcct); + resourceManagementClient.getResourceGroupsOperations().delete(rgName); + } + catch (Exception e) { + // ignore failures during cleanup, as it is best effort + } + } + @Test + public void canGetCatalogItems() throws Exception { + List dbListResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().listDatabases(adlaAcct).getBody(); + Assert.assertTrue(dbListResponse.size() >= 1); + + // look for the DB we created + boolean foundCatalogElement = false; + for (USqlDatabase db: dbListResponse) { + if (db.getName().equals(dbName)) { + foundCatalogElement = true; + break; + } + } + Assert.assertTrue(foundCatalogElement); + + // Get the specific Database as well + USqlDatabase dbGetResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().getDatabase(dbName, adlaAcct).getBody(); + + Assert.assertEquals(dbName, dbGetResponse.getName()); + + // Get the table list + List tableListResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().listTables(dbName, "dbo", adlaAcct).getBody(); + + Assert.assertTrue(tableListResponse.size() >= 1); + + // look for the table we created + foundCatalogElement = false; + for (USqlTable table: tableListResponse) { + if (table.getName().equals(tableName)) { + foundCatalogElement = true; + break; + } + } + Assert.assertTrue(foundCatalogElement); + + // Get the specific table as well + USqlTable tableGetResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().getTable( + dbName, "dbo", tableName, adlaAcct).getBody(); + + Assert.assertEquals(tableName, tableGetResponse.getName()); + + // Get the TVF list + List tvfListResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().listTableValuedFunctions(dbName, "dbo", adlaAcct).getBody(); + + Assert.assertTrue(tvfListResponse.size() >= 1); + + // look for the tvf we created + foundCatalogElement = false; + for (USqlTableValuedFunction tvf: tvfListResponse) { + if (tvf.getName().equals(tvfName)) { + foundCatalogElement = true; + break; + } + } + Assert.assertTrue(foundCatalogElement); + + // Get the specific TVF as well + USqlTableValuedFunction tvfGetResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().getTableValuedFunction( + dbName, "dbo", tvfName, adlaAcct).getBody(); + + Assert.assertEquals(tvfName, tvfGetResponse.getName()); + + // Get the View list + List viewListResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().listViews(dbName, "dbo", adlaAcct).getBody(); + + Assert.assertTrue(viewListResponse.size() >= 1); + + // look for the view we created + foundCatalogElement = false; + for (USqlView view: viewListResponse) { + if (view.getName().equals(viewName)) { + foundCatalogElement = true; + break; + } + } + Assert.assertTrue(foundCatalogElement); + + // Get the specific view as well + USqlView viewGetResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().getView( + dbName, "dbo", viewName, adlaAcct).getBody(); + + Assert.assertEquals(viewName, viewGetResponse.getName()); + + // Get the Procedure list + List procListResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().listProcedures( + dbName, "dbo", adlaAcct).getBody(); + + Assert.assertTrue(procListResponse.size() >= 1); + + // look for the procedure we created + foundCatalogElement = false; + for (USqlProcedure proc: procListResponse) { + if (proc.getName().equals(procName)) { + foundCatalogElement = true; + break; + } + } + Assert.assertTrue(foundCatalogElement); + + // Get the specific procedure as well + USqlProcedure procGetResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().getProcedure( + dbName, "dbo", procName, adlaAcct).getBody(); + + Assert.assertEquals(procName, procGetResponse.getName()); + + // Get all the types + List typeGetResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().listTypes( + dbName, "dbo", adlaAcct).getBody(); + + + Assert.assertNotNull(typeGetResponse); + Assert.assertTrue(typeGetResponse.size() > 0); + + // Get all the types that are not complex + USqlType filterOn = new USqlType(); + filterOn.setIsComplexType(false); + typeGetResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().listTypes( + dbName, "dbo", adlaAcct, filterOn, null, null, null, null, null, null).getBody(); + + + Assert.assertNotNull(typeGetResponse); + Assert.assertTrue(typeGetResponse.size() > 0); + foundCatalogElement = false; + for (USqlType type: typeGetResponse) { + if (type.getIsComplexType()) { + foundCatalogElement = true; + break; + } + } + Assert.assertFalse(foundCatalogElement); + } + + @Test + public void canCreateUpdateDeleteSecretsAndCredentials() throws Exception { + // create the secret + DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters createParams = new DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters(); + createParams.setPassword(secretPwd); + createParams.setUri("https://adlasecrettest.contoso.com:443"); + USqlSecret secretCreateResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().createSecret( + dbName, secretName, + adlaAcct, + createParams).getBody(); + try { + + } + catch(Exception e) { + + } + /* + * TODO: Enable once confirmed that we throw 409s when a secret already exists + // Attempt to create the secret again, which should throw + try { + USqlSecret secondTry = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().createSecret( + dbName, secretName, + adlaAcct, + createParams).getBody(); + // should never make it here + Assert.assertTrue(false); + } + catch(Exception e) { + // expected. + } + */ + + // Get the secret and ensure the response contains a date. + USqlSecret secretGetResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().getSecret( + dbName, secretName, adlaAcct).getBody(); + + Assert.assertNotNull(secretGetResponse); + Assert.assertNotNull(secretGetResponse.getCreationTime()); + + // Create a credential with the secret + String credentialCreationScript = + String.format("USE %s; CREATE CREDENTIAL %s WITH USER_NAME = \"scope@rkm4grspxa\", IDENTITY = \"%s\";", + dbName, credentialName, secretName); + + runJobToCompletion(dataLakeAnalyticsJobManagementClient, adlaAcct, UUID.randomUUID(), credentialCreationScript); + + // Get the Credential list + List credListResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().listCredentials( + dbName, adlaAcct).getBody(); + Assert.assertTrue(credListResponse.size() >= 1); + + // look for the credential we created + boolean foundCatalogElement = false; + for (USqlCredential cred: credListResponse) { + if (cred.getName().equals(credentialName)) { + foundCatalogElement = true; + break; + } + } + Assert.assertTrue(foundCatalogElement); + + // Get the specific credential as well + USqlCredential credGetResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().getCredential( + dbName, credentialName, adlaAcct).getBody(); + Assert.assertEquals(credentialName, credGetResponse.getName()); + + // Drop the credential (to enable secret deletion) + String credentialDropScript = + String.format("USE %s; DROP CREDENTIAL %s;", dbName, credentialName); + runJobToCompletion(dataLakeAnalyticsJobManagementClient, + adlaAcct, UUID.randomUUID(), + credentialDropScript); + + // Delete the secret + dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().deleteSecret( + dbName, secretName, adlaAcct); + + // Try to get the secret which should throw + try { + dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().getSecret( + dbName, secretName, adlaAcct); + + // should never make it here + Assert.assertTrue("Was able to retrieve a deleted secret", false); + } + catch (Exception e) { + // expected + } + + } +} diff --git a/azure-mgmt-datalake-analytics/src/test/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsJobOperationsTests.java b/azure-mgmt-datalake-analytics/src/test/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsJobOperationsTests.java new file mode 100644 index 000000000000..2e678e988cdd --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/test/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsJobOperationsTests.java @@ -0,0 +1,154 @@ +package com.microsoft.azure.management.datalake.analytics; + +import com.microsoft.azure.management.datalake.analytics.models.DataLakeAnalyticsAccount; +import com.microsoft.azure.management.datalake.analytics.models.DataLakeAnalyticsAccountProperties; +import com.microsoft.azure.management.datalake.analytics.models.DataLakeStoreAccountInfo; +import com.microsoft.azure.management.datalake.analytics.models.JobInformation; +import com.microsoft.azure.management.datalake.analytics.models.JobResult; +import com.microsoft.azure.management.datalake.analytics.models.JobState; +import com.microsoft.azure.management.datalake.analytics.models.JobType; +import com.microsoft.azure.management.datalake.analytics.models.USqlJobProperties; +import com.microsoft.azure.management.datalake.store.models.DataLakeStoreAccount; +import com.microsoft.azure.management.resources.models.ResourceGroup; + +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +public class DataLakeAnalyticsJobOperationsTests extends DataLakeAnalyticsManagementTestBase { + private static String rgName = generateName("javaadlarg"); + private static String location = "eastus2"; + private static String adlsAcct = generateName("javaadlsacct"); + private static String adlaAcct = generateName("javaadlaacct"); + private static String jobScript = "DROP DATABASE IF EXISTS testdb; CREATE DATABASE testdb;"; + + @BeforeClass + public static void setup() throws Exception { + createClients(); + ResourceGroup group = new ResourceGroup(); + group.setLocation(location); + resourceManagementClient.getResourceGroupsOperations().createOrUpdate(rgName, group); + // create storage and ADLS accounts, setting the accessKey + DataLakeStoreAccount adlsAccount = new DataLakeStoreAccount(); + adlsAccount.setLocation(location); + adlsAccount.setName(adlsAcct); + dataLakeStoreAccountManagementClient.getAccountOperations().create(rgName, adlsAcct, adlsAccount); + + // Create the ADLA acct to use. + DataLakeAnalyticsAccountProperties createProperties = new DataLakeAnalyticsAccountProperties(); + List adlsAccts = new ArrayList(); + DataLakeStoreAccountInfo adlsInfo = new DataLakeStoreAccountInfo(); + adlsInfo.setName(adlsAcct); + adlsAccts.add(adlsInfo); + + createProperties.setDataLakeStoreAccounts(adlsAccts); + createProperties.setDefaultDataLakeStoreAccount(adlsAcct); + + DataLakeAnalyticsAccount createParams = new DataLakeAnalyticsAccount(); + createParams.setLocation(location); + createParams.setName(adlaAcct); + createParams.setProperties(createProperties); + dataLakeAnalyticsAccountManagementClient.getAccountOperations().create(rgName, adlaAcct, createParams); + // Sleep for two minutes to ensure the account is totally provisioned. + Thread.sleep(120000); + } + + @AfterClass + public static void cleanup() throws Exception { + try { + dataLakeAnalyticsAccountManagementClient.getAccountOperations().delete(rgName, adlaAcct); + resourceManagementClient.getResourceGroupsOperations().delete(rgName); + } + catch (Exception e) { + // ignore failures during cleanup, as it is best effort + } + } + @Test + public void canSubmitGetListAndCancelJobs() throws Exception { + // submit a job + JobInformation jobToSubmit = new JobInformation(); + USqlJobProperties jobProperties = new USqlJobProperties(); + jobProperties.setScript(jobScript); + jobToSubmit.setName("java azure sdk data lake analytics job"); + jobToSubmit.setDegreeOfParallelism(2); + jobToSubmit.setType(JobType.USQL); + jobToSubmit.setProperties(jobProperties); + UUID jobId = UUID.randomUUID(); + UUID secondJobId = UUID.randomUUID(); + + JobInformation jobCreateResponse = dataLakeAnalyticsJobManagementClient.getJobOperations().create(jobId, adlaAcct, jobToSubmit).getBody(); + Assert.assertNotNull(jobCreateResponse); + + // cancel the job + dataLakeAnalyticsJobManagementClient.getJobOperations().cancel(jobId, adlaAcct); + + // Get the job and ensure it was cancelled + JobInformation cancelledJobResponse = dataLakeAnalyticsJobManagementClient.getJobOperations().get(jobId, adlaAcct).getBody(); + Assert.assertEquals(JobResult.CANCELLED, cancelledJobResponse.getResult()); + Assert.assertNotNull(cancelledJobResponse.getErrorMessage()); + Assert.assertTrue(cancelledJobResponse.getErrorMessage().size() >= 1); + + // Resubmit and wait for job to finish + jobCreateResponse = dataLakeAnalyticsJobManagementClient.getJobOperations().create(secondJobId, adlaAcct, jobToSubmit).getBody(); + Assert.assertNotNull(jobCreateResponse); + + JobInformation getJobResponse = dataLakeAnalyticsJobManagementClient.getJobOperations().get(jobCreateResponse.getJobId(), adlaAcct).getBody(); + Assert.assertNotNull(getJobResponse); + + int maxWaitInSeconds = 180; // 3 minutes should be long enough + int curWaitInSeconds = 0; + + while (getJobResponse.getState() != JobState.ENDED && curWaitInSeconds < maxWaitInSeconds) + { + // wait 5 seconds before polling again + Thread.sleep(5000); + curWaitInSeconds += 5; + getJobResponse = dataLakeAnalyticsJobManagementClient.getJobOperations().get(jobCreateResponse.getJobId(), adlaAcct).getBody(); + Assert.assertNotNull(getJobResponse); + } + + Assert.assertTrue(curWaitInSeconds <= maxWaitInSeconds); + + // Verify the job completes successfully + Assert.assertTrue( + String.format("Job: %s did not return success. Current job state: %s. Actual result: %s. Error (if any): %s", + getJobResponse.getJobId(), getJobResponse.getState(), getJobResponse.getResult(), getJobResponse.getErrorMessage()), + getJobResponse.getState() == JobState.ENDED && getJobResponse.getResult() == JobResult.SUCCEEDED); + + List listJobResponse = dataLakeAnalyticsJobManagementClient.getJobOperations().list(adlaAcct, null, null, null, null, null, null, null, null, null).getBody(); + Assert.assertNotNull(listJobResponse); + boolean foundJob = false; + for(JobInformation eachJob : listJobResponse) { + if (eachJob.getJobId().equals(secondJobId)) { + foundJob = true; + break; + } + } + + Assert.assertTrue(foundJob); + + // Just compile the job, which requires a jobId in the job object. + jobToSubmit.setJobId(getJobResponse.getJobId()); + JobInformation compileResponse = dataLakeAnalyticsJobManagementClient.getJobOperations().build(adlaAcct, jobToSubmit).getBody(); + Assert.assertNotNull(compileResponse); + + // list the jobs both with a hand crafted query string and using the parameters + listJobResponse = dataLakeAnalyticsJobManagementClient.getJobOperations().list(adlaAcct, null, null, null, null, "jobId", null, null, null, null).getBody(); + Assert.assertNotNull(listJobResponse); + + foundJob = false; + for(JobInformation eachJob : listJobResponse) { + if (eachJob.getJobId().equals(secondJobId)) { + foundJob = true; + break; + } + } + + Assert.assertTrue(foundJob); + } +} diff --git a/azure-mgmt-datalake-analytics/src/test/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsManagementTestBase.java b/azure-mgmt-datalake-analytics/src/test/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsManagementTestBase.java new file mode 100644 index 000000000000..934c05079ad6 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/test/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsManagementTestBase.java @@ -0,0 +1,105 @@ +package com.microsoft.azure.management.datalake.analytics; + +import com.microsoft.azure.credentials.AzureEnvironment; +import com.microsoft.azure.credentials.UserTokenCredentials; +import com.microsoft.azure.management.datalake.analytics.models.JobInformation; +import com.microsoft.azure.management.datalake.analytics.models.JobResult; +import com.microsoft.azure.management.datalake.analytics.models.JobState; +import com.microsoft.azure.management.datalake.analytics.models.JobType; +import com.microsoft.azure.management.datalake.analytics.models.USqlJobProperties; +import com.microsoft.azure.management.datalake.store.DataLakeStoreAccountManagementClient; +import com.microsoft.azure.management.datalake.store.DataLakeStoreAccountManagementClientImpl; +import com.microsoft.azure.management.resources.ResourceManagementClient; +import com.microsoft.azure.management.resources.ResourceManagementClientImpl; +import com.microsoft.azure.management.storage.StorageManagementClient; +import com.microsoft.azure.management.storage.StorageManagementClientImpl; + +import org.junit.Assert; + +import java.util.UUID; + +import okhttp3.logging.HttpLoggingInterceptor; + +public abstract class DataLakeAnalyticsManagementTestBase { + protected static DataLakeAnalyticsAccountManagementClient dataLakeAnalyticsAccountManagementClient; + protected static DataLakeAnalyticsJobManagementClient dataLakeAnalyticsJobManagementClient; + protected static DataLakeAnalyticsCatalogManagementClient dataLakeAnalyticsCatalogManagementClient; + protected static ResourceManagementClient resourceManagementClient; + protected static DataLakeStoreAccountManagementClient dataLakeStoreAccountManagementClient; + protected static StorageManagementClient storageManagementClient; + + public static void createClients() { + UserTokenCredentials credentials = new UserTokenCredentials( + System.getenv("arm.clientid"), + System.getenv("arm.domain"), + System.getenv("arm.username"), + System.getenv("arm.password"), + null, + AzureEnvironment.AZURE); + + dataLakeAnalyticsAccountManagementClient = new DataLakeAnalyticsAccountManagementClientImpl(credentials); + dataLakeAnalyticsAccountManagementClient.setLogLevel(HttpLoggingInterceptor.Level.BODY); + dataLakeAnalyticsAccountManagementClient.setSubscriptionId(System.getenv("arm.subscriptionid")); + dataLakeAnalyticsJobManagementClient = new DataLakeAnalyticsJobManagementClientImpl(credentials); + dataLakeAnalyticsJobManagementClient.setSubscriptionId(System.getenv("arm.subscriptionid")); + dataLakeAnalyticsJobManagementClient.setLogLevel(HttpLoggingInterceptor.Level.BODY); + + dataLakeAnalyticsCatalogManagementClient = new DataLakeAnalyticsCatalogManagementClientImpl(credentials); + dataLakeAnalyticsCatalogManagementClient.setSubscriptionId(System.getenv("arm.subscriptionid")); + dataLakeAnalyticsCatalogManagementClient.setLogLevel(HttpLoggingInterceptor.Level.BODY); + + resourceManagementClient = new ResourceManagementClientImpl(credentials); + resourceManagementClient.setSubscriptionId(System.getenv("arm.subscriptionid")); + resourceManagementClient.setLogLevel(HttpLoggingInterceptor.Level.BODY); + + dataLakeStoreAccountManagementClient = new DataLakeStoreAccountManagementClientImpl(credentials); + dataLakeStoreAccountManagementClient.setLogLevel(HttpLoggingInterceptor.Level.BODY); + dataLakeStoreAccountManagementClient.setSubscriptionId(System.getenv("arm.subscriptionid")); + + storageManagementClient = new StorageManagementClientImpl(credentials); + storageManagementClient.setLogLevel(HttpLoggingInterceptor.Level.BODY); + storageManagementClient.setSubscriptionId(System.getenv("arm.subscriptionid")); + } + + public static void runJobToCompletion(DataLakeAnalyticsJobManagementClient jobClient, String adlaAcct, UUID jobId, String scriptToRun) throws Exception { + // submit a job + JobInformation jobToSubmit = new JobInformation(); + USqlJobProperties jobProperties = new USqlJobProperties(); + jobProperties.setScript(scriptToRun); + jobToSubmit.setName("java azure sdk data lake analytics job"); + jobToSubmit.setDegreeOfParallelism(2); + jobToSubmit.setType(JobType.USQL); + jobToSubmit.setProperties(jobProperties); + + JobInformation jobCreateResponse = jobClient.getJobOperations().create(jobId, adlaAcct, jobToSubmit).getBody(); + Assert.assertNotNull(jobCreateResponse); + + JobInformation getJobResponse = jobClient.getJobOperations().get(jobCreateResponse.getJobId(), adlaAcct).getBody(); + Assert.assertNotNull(getJobResponse); + + int maxWaitInSeconds = 180; // 3 minutes should be long enough + int curWaitInSeconds = 0; + + while (getJobResponse.getState() != JobState.ENDED && curWaitInSeconds < maxWaitInSeconds) + { + // wait 5 seconds before polling again + Thread.sleep(5000); + curWaitInSeconds += 5; + getJobResponse = jobClient.getJobOperations().get(jobCreateResponse.getJobId(), adlaAcct).getBody(); + Assert.assertNotNull(getJobResponse); + } + + Assert.assertTrue(curWaitInSeconds <= maxWaitInSeconds); + + // Verify the job completes successfully + Assert.assertTrue( + String.format("Job: {0} did not return success. Current job state: {1}. Actual result: {2}. Error (if any): {3}", + getJobResponse.getJobId(), getJobResponse.getState(), getJobResponse.getResult(), getJobResponse.getErrorMessage()), + getJobResponse.getState() == JobState.ENDED && getJobResponse.getResult() == JobResult.SUCCEEDED); + } + + public static String generateName(String prefix) { + int randomSuffix = (int)(Math.random() * 1000); + return prefix + randomSuffix; + } +} diff --git a/azure-mgmt-datalake-store/pom.xml b/azure-mgmt-datalake-store/pom.xml new file mode 100644 index 000000000000..10ea0bea74d7 --- /dev/null +++ b/azure-mgmt-datalake-store/pom.xml @@ -0,0 +1,108 @@ + + + 4.0.0 + + com.microsoft.azure + azure + 1.0.0-SNAPSHOT + ../azure/pom.xml + + + azure-mgmt-datalake-store + jar + + Microsoft Azure SDK for Data Lake Store Management + This package contains Microsoft Azure Data Lake Store Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + UTF-8 + + + + + + microsoft + Microsoft + + + + + + com.microsoft.azure + azure-client-runtime + + + ${project.groupId} + azure-mgmt-resources + ${project.version} + test + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + + org.codehaus.mojo + build-helper-maven-plugin + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.storage + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/]]>
+
+
+ +
+
+
diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/AccountOperations.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/AccountOperations.java new file mode 100644 index 000000000000..0296f55a93c7 --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/AccountOperations.java @@ -0,0 +1,524 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store; + +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.datalake.store.models.DataLakeStoreAccount; +import com.microsoft.azure.management.datalake.store.models.FirewallRule; +import com.microsoft.azure.management.datalake.store.models.PageImpl; +import com.microsoft.rest.ServiceCall; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; + +/** + * An instance of this class provides access to all the operations defined + * in AccountOperations. + */ +public interface AccountOperations { + /** + * Deletes the specified firewall rule from the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account from which to delete the firewall rule. + * @param firewallRuleName The name of the firewall rule to delete. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse deleteFirewallRule(String resourceGroupName, String accountName, String firewallRuleName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Deletes the specified firewall rule from the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account from which to delete the firewall rule. + * @param firewallRuleName The name of the firewall rule to delete. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall deleteFirewallRuleAsync(String resourceGroupName, String accountName, String firewallRuleName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Gets the specified Data Lake Store firewall rule. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account from which to get the firewall rule. + * @param firewallRuleName The name of the firewall rule to retrieve. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the FirewallRule object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getFirewallRule(String resourceGroupName, String accountName, String firewallRuleName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the specified Data Lake Store firewall rule. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account from which to get the firewall rule. + * @param firewallRuleName The name of the firewall rule to retrieve. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getFirewallRuleAsync(String resourceGroupName, String accountName, String firewallRuleName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account from which to get the firewall rules. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<FirewallRule> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listFirewallRules(final String resourceGroupName, final String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account from which to get the firewall rules. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listFirewallRulesAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Gets the next page of Data Lake Store firewall rules, if any, for the specified account. The response includes a link to the next page of results, if any. + * + * @param nextLink The URL to the next page of the firewall rules list. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<FirewallRule> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> firewallRulesListNext(final String nextLink) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the next page of Data Lake Store firewall rules, if any, for the specified account. The response includes a link to the next page of results, if any. + * + * @param nextLink The URL to the next page of the firewall rules list. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall firewallRulesListNextAsync(final String nextLink, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Creates or updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to which to add the firewall rule. + * @param name The name of the firewall rule to create or update. + * @param parameters Parameters supplied to create the create firewall rule. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the FirewallRule object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse createOrUpdateFirewallRule(String resourceGroupName, String accountName, String name, FirewallRule parameters) throws CloudException, IOException, IllegalArgumentException; + + /** + * Creates or updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to which to add the firewall rule. + * @param name The name of the firewall rule to create or update. + * @param parameters Parameters supplied to create the create firewall rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall createOrUpdateFirewallRuleAsync(String resourceGroupName, String accountName, String name, FirewallRule parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Creates the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to create. + * @param parameters Parameters supplied to create the Data Lake Store account. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the DataLakeStoreAccount object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse create(String resourceGroupName, String name, DataLakeStoreAccount parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException; + + /** + * Creates the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to create. + * @param parameters Parameters supplied to create the Data Lake Store account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall createAsync(String resourceGroupName, String name, DataLakeStoreAccount parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Creates the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to create. + * @param parameters Parameters supplied to create the Data Lake Store account. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the DataLakeStoreAccount object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse beginCreate(String resourceGroupName, String name, DataLakeStoreAccount parameters) throws CloudException, IOException, IllegalArgumentException; + + /** + * Creates the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to create. + * @param parameters Parameters supplied to create the Data Lake Store account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall beginCreateAsync(String resourceGroupName, String name, DataLakeStoreAccount parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Updates the specified Data Lake Store account information. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to update. + * @param parameters Parameters supplied to update the Data Lake Store account. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the DataLakeStoreAccount object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse update(String resourceGroupName, String name, DataLakeStoreAccount parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException; + + /** + * Updates the specified Data Lake Store account information. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to update. + * @param parameters Parameters supplied to update the Data Lake Store account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall updateAsync(String resourceGroupName, String name, DataLakeStoreAccount parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Updates the specified Data Lake Store account information. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to update. + * @param parameters Parameters supplied to update the Data Lake Store account. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the DataLakeStoreAccount object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse beginUpdate(String resourceGroupName, String name, DataLakeStoreAccount parameters) throws CloudException, IOException, IllegalArgumentException; + + /** + * Updates the specified Data Lake Store account information. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to update. + * @param parameters Parameters supplied to update the Data Lake Store account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall beginUpdateAsync(String resourceGroupName, String name, DataLakeStoreAccount parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Deletes the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to delete. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse delete(String resourceGroupName, String accountName) throws CloudException, IOException, IllegalArgumentException, InterruptedException; + + /** + * Deletes the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to delete. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall deleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Deletes the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to delete. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse beginDelete(String resourceGroupName, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Deletes the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to delete. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall beginDeleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Gets the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to retrieve. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the DataLakeStoreAccount object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse get(String resourceGroupName, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to retrieve. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account(s). + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DataLakeStoreAccount> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listByResourceGroup(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account(s). + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account(s). + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count A Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DataLakeStoreAccount> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listByResourceGroup(final String resourceGroupName, final DataLakeStoreAccount filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) throws CloudException, IOException, IllegalArgumentException; + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account(s). + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count A Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listByResourceGroupAsync(final String resourceGroupName, final DataLakeStoreAccount filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DataLakeStoreAccount> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> list() throws CloudException, IOException, IllegalArgumentException; + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listAsync(final ListOperationCallback serviceCallback) throws IllegalArgumentException; + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DataLakeStoreAccount> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> list(final DataLakeStoreAccount filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) throws CloudException, IOException, IllegalArgumentException; + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listAsync(final DataLakeStoreAccount filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<FirewallRule> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listFirewallRulesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException; + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listFirewallRulesNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Gets the next page of Data Lake Store firewall rules, if any, for the specified account. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<FirewallRule> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> firewallRulesListNextNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the next page of Data Lake Store firewall rules, if any, for the specified account. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall firewallRulesListNextNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DataLakeStoreAccount> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listByResourceGroupNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException; + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listByResourceGroupNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DataLakeStoreAccount> object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException; + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException; + +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/AccountOperationsImpl.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/AccountOperationsImpl.java new file mode 100644 index 000000000000..9d7b10368a32 --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/AccountOperationsImpl.java @@ -0,0 +1,1767 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store; + +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceResponseBuilder; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.datalake.store.models.DataLakeStoreAccount; +import com.microsoft.azure.management.datalake.store.models.FirewallRule; +import com.microsoft.azure.management.datalake.store.models.PageImpl; +import com.microsoft.rest.ServiceCall; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseCallback; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.Call; +import retrofit2.Callback; +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.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import retrofit2.Retrofit; + +/** + * An instance of this class provides access to all the operations defined + * in AccountOperations. + */ +public final class AccountOperationsImpl implements AccountOperations { + /** The Retrofit service to perform REST calls. */ + private AccountService service; + /** The service client containing this operation class. */ + private DataLakeStoreAccountManagementClient client; + + /** + * Initializes an instance of AccountOperations. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AccountOperationsImpl(Retrofit retrofit, DataLakeStoreAccountManagementClient client) { + this.service = retrofit.create(AccountService.class); + this.client = client; + } + + /** + * The interface defining all the services for AccountOperations to be + * used by Retrofit to perform actually REST calls. + */ + interface AccountService { + @Headers("Content-Type: application/json; charset=utf-8") + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/firewallRules/{firewallRuleName}", method = "DELETE", hasBody = true) + Call deleteFirewallRule(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("firewallRuleName") String firewallRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/firewallRules/{firewallRuleName}") + Call getFirewallRule(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("firewallRuleName") String firewallRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/firewallRules") + Call listFirewallRules(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("{nextLink}") + Call firewallRulesListNext(@Path("nextLink") String nextLink, @Path("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/firewallRules/{name}") + Call createOrUpdateFirewallRule(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Body FirewallRule parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{name}") + Call create(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Body DataLakeStoreAccount parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{name}") + Call beginCreate(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Body DataLakeStoreAccount parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{name}") + Call update(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Body DataLakeStoreAccount parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{name}") + Call beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Body DataLakeStoreAccount parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}", method = "DELETE", hasBody = true) + Call delete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}", method = "DELETE", hasBody = true) + Call beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}") + Call get(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts") + Call listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$expand") String expand, @Query("$select") String select, @Query("$orderby") String orderby, @Query("$count") Boolean count, @Query("$search") String search, @Query("$format") String format, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DataLakeStore/accounts") + Call list(@Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$expand") String expand, @Query("$select") String select, @Query("$orderby") String orderby, @Query("$count") Boolean count, @Query("$search") String search, @Query("$format") String format, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET + Call listFirewallRulesNext(@Url String nextPageLink, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET + Call firewallRulesListNextNext(@Url String nextPageLink, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET + Call listByResourceGroupNext(@Url String nextPageLink, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET + Call listNext(@Url String nextPageLink, @Header("accept-language") String acceptLanguage); + + } + + /** + * Deletes the specified firewall rule from the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account from which to delete the firewall rule. + * @param firewallRuleName The name of the firewall rule to delete. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse deleteFirewallRule(String resourceGroupName, String accountName, String firewallRuleName) throws CloudException, IOException, IllegalArgumentException { + 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 (firewallRuleName == null) { + throw new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Call call = service.deleteFirewallRule(resourceGroupName, accountName, firewallRuleName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return deleteFirewallRuleDelegate(call.execute()); + } + + /** + * Deletes the specified firewall rule from the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account from which to delete the firewall rule. + * @param firewallRuleName The name of the firewall rule to delete. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall deleteFirewallRuleAsync(String resourceGroupName, String accountName, String firewallRuleName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (firewallRuleName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Call call = service.deleteFirewallRule(resourceGroupName, accountName, firewallRuleName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(deleteFirewallRuleDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse deleteFirewallRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Gets the specified Data Lake Store firewall rule. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account from which to get the firewall rule. + * @param firewallRuleName The name of the firewall rule to retrieve. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the FirewallRule object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getFirewallRule(String resourceGroupName, String accountName, String firewallRuleName) throws CloudException, IOException, IllegalArgumentException { + 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 (firewallRuleName == null) { + throw new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Call call = service.getFirewallRule(resourceGroupName, accountName, firewallRuleName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getFirewallRuleDelegate(call.execute()); + } + + /** + * Gets the specified Data Lake Store firewall rule. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account from which to get the firewall rule. + * @param firewallRuleName The name of the firewall rule to retrieve. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getFirewallRuleAsync(String resourceGroupName, String accountName, String firewallRuleName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (firewallRuleName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Call call = service.getFirewallRule(resourceGroupName, accountName, firewallRuleName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getFirewallRuleDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getFirewallRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account from which to get the firewall rules. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<FirewallRule> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listFirewallRules(final String resourceGroupName, final String accountName) throws CloudException, IOException, IllegalArgumentException { + 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.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Call call = service.listFirewallRules(resourceGroupName, accountName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listFirewallRulesDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listFirewallRulesNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account from which to get the firewall rules. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listFirewallRulesAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Call call = service.listFirewallRules(resourceGroupName, accountName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listFirewallRulesDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listFirewallRulesNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listFirewallRulesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the next page of Data Lake Store firewall rules, if any, for the specified account. The response includes a link to the next page of results, if any. + * + * @param nextLink The URL to the next page of the firewall rules list. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<FirewallRule> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> firewallRulesListNext(final String nextLink) throws CloudException, IOException, IllegalArgumentException { + if (nextLink == null) { + throw new IllegalArgumentException("Parameter nextLink is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + Call call = service.firewallRulesListNext(nextLink, this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + ServiceResponse> response = firewallRulesListNextDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = firewallRulesListNextNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Gets the next page of Data Lake Store firewall rules, if any, for the specified account. The response includes a link to the next page of results, if any. + * + * @param nextLink The URL to the next page of the firewall rules list. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall firewallRulesListNextAsync(final String nextLink, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (nextLink == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + Call call = service.firewallRulesListNext(nextLink, this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = firewallRulesListNextDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + firewallRulesListNextNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> firewallRulesListNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to which to add the firewall rule. + * @param name The name of the firewall rule to create or update. + * @param parameters Parameters supplied to create the create firewall rule. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the FirewallRule object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse createOrUpdateFirewallRule(String resourceGroupName, String accountName, String name, FirewallRule parameters) throws CloudException, IOException, IllegalArgumentException { + 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 (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Call call = service.createOrUpdateFirewallRule(resourceGroupName, accountName, name, this.client.getSubscriptionId(), parameters, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return createOrUpdateFirewallRuleDelegate(call.execute()); + } + + /** + * Creates or updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to which to add the firewall rule. + * @param name The name of the firewall rule to create or update. + * @param parameters Parameters supplied to create the create firewall rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall createOrUpdateFirewallRuleAsync(String resourceGroupName, String accountName, String name, FirewallRule parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (parameters == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Validator.validate(parameters, serviceCallback); + Call call = service.createOrUpdateFirewallRule(resourceGroupName, accountName, name, this.client.getSubscriptionId(), parameters, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(createOrUpdateFirewallRuleDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse createOrUpdateFirewallRuleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to create. + * @param parameters Parameters supplied to create the Data Lake Store account. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the DataLakeStoreAccount object wrapped in ServiceResponse if successful. + */ + public ServiceResponse create(String resourceGroupName, String name, DataLakeStoreAccount parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Response result = service.create(resourceGroupName, name, this.client.getSubscriptionId(), parameters, this.client.getApiVersion(), this.client.getAcceptLanguage()).execute(); + return client.getAzureClient().getPutOrPatchResult(result, new TypeToken() { }.getType()); + } + + /** + * Creates the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to create. + * @param parameters Parameters supplied to create the Data Lake Store account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + public ServiceCall createAsync(String resourceGroupName, String name, DataLakeStoreAccount parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + } + Validator.validate(parameters, serviceCallback); + Call call = service.create(resourceGroupName, name, this.client.getSubscriptionId(), parameters, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, Throwable t) { + serviceCallback.failure(t); + } + @Override + public void onResponse(Call call, Response response) { + client.getAzureClient().getPutOrPatchResultAsync(response, new TypeToken() { }.getType(), serviceCall, serviceCallback); + } + }); + return serviceCall; + } + + /** + * Creates the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to create. + * @param parameters Parameters supplied to create the Data Lake Store account. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the DataLakeStoreAccount object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse beginCreate(String resourceGroupName, String name, DataLakeStoreAccount parameters) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Call call = service.beginCreate(resourceGroupName, name, this.client.getSubscriptionId(), parameters, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return beginCreateDelegate(call.execute()); + } + + /** + * Creates the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to create. + * @param parameters Parameters supplied to create the Data Lake Store account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall beginCreateAsync(String resourceGroupName, String name, DataLakeStoreAccount parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (parameters == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Validator.validate(parameters, serviceCallback); + Call call = service.beginCreate(resourceGroupName, name, this.client.getSubscriptionId(), parameters, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(beginCreateDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(201, new TypeToken() { }.getType()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the specified Data Lake Store account information. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to update. + * @param parameters Parameters supplied to update the Data Lake Store account. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the DataLakeStoreAccount object wrapped in ServiceResponse if successful. + */ + public ServiceResponse update(String resourceGroupName, String name, DataLakeStoreAccount parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Response result = service.update(resourceGroupName, name, this.client.getSubscriptionId(), parameters, this.client.getApiVersion(), this.client.getAcceptLanguage()).execute(); + return client.getAzureClient().getPutOrPatchResult(result, new TypeToken() { }.getType()); + } + + /** + * Updates the specified Data Lake Store account information. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to update. + * @param parameters Parameters supplied to update the Data Lake Store account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + public ServiceCall updateAsync(String resourceGroupName, String name, DataLakeStoreAccount parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + } + Validator.validate(parameters, serviceCallback); + Call call = service.update(resourceGroupName, name, this.client.getSubscriptionId(), parameters, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, Throwable t) { + serviceCallback.failure(t); + } + @Override + public void onResponse(Call call, Response response) { + client.getAzureClient().getPutOrPatchResultAsync(response, new TypeToken() { }.getType(), serviceCall, serviceCallback); + } + }); + return serviceCall; + } + + /** + * Updates the specified Data Lake Store account information. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to update. + * @param parameters Parameters supplied to update the Data Lake Store account. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the DataLakeStoreAccount object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse beginUpdate(String resourceGroupName, String name, DataLakeStoreAccount parameters) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Call call = service.beginUpdate(resourceGroupName, name, this.client.getSubscriptionId(), parameters, this.client.getApiVersion(), this.client.getAcceptLanguage()); + return beginUpdateDelegate(call.execute()); + } + + /** + * Updates the specified Data Lake Store account information. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param name The name of the Data Lake Store account to update. + * @param parameters Parameters supplied to update the Data Lake Store account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall beginUpdateAsync(String resourceGroupName, String name, DataLakeStoreAccount parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (name == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter name is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (parameters == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Validator.validate(parameters, serviceCallback); + Call call = service.beginUpdate(resourceGroupName, name, this.client.getSubscriptionId(), parameters, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(beginUpdateDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to delete. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the ServiceResponse object if successful. + */ + public ServiceResponse delete(String resourceGroupName, String accountName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + 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.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Response result = service.delete(resourceGroupName, accountName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()).execute(); + return client.getAzureClient().getPostOrDeleteResult(result, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to delete. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + public ServiceCall deleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + } + Call call = service.delete(resourceGroupName, accountName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, Throwable t) { + serviceCallback.failure(t); + } + @Override + public void onResponse(Call call, Response response) { + client.getAzureClient().getPostOrDeleteResultAsync(response, new TypeToken() { }.getType(), serviceCall, serviceCallback); + } + }); + return serviceCall; + } + + /** + * Deletes the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to delete. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse beginDelete(String resourceGroupName, String accountName) throws CloudException, IOException, IllegalArgumentException { + 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.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Call call = service.beginDelete(resourceGroupName, accountName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return beginDeleteDelegate(call.execute()); + } + + /** + * Deletes the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to delete. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall beginDeleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Call call = service.beginDelete(resourceGroupName, accountName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(beginDeleteDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Gets the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to retrieve. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the DataLakeStoreAccount object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse get(String resourceGroupName, String accountName) throws CloudException, IOException, IllegalArgumentException { + 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.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Call call = service.get(resourceGroupName, accountName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + return getDelegate(call.execute()); + } + + /** + * Gets the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. + * @param accountName The name of the Data Lake Store account to retrieve. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Call call = service.get(resourceGroupName, accountName, this.client.getSubscriptionId(), this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account(s). + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DataLakeStoreAccount> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listByResourceGroup(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + DataLakeStoreAccount filter = null; + Integer top = null; + Integer skip = null; + String expand = null; + String select = null; + String orderby = null; + Boolean count = null; + String search = null; + String format = null; + Call call = service.listByResourceGroup(resourceGroupName, this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, search, format, this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listByResourceGroupDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listByResourceGroupNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account(s). + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final DataLakeStoreAccount filter = null; + final Integer top = null; + final Integer skip = null; + final String expand = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + final String search = null; + final String format = null; + Call call = service.listByResourceGroup(resourceGroupName, this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, search, format, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listByResourceGroupNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account(s). + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count A Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DataLakeStoreAccount> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listByResourceGroup(final String resourceGroupName, final DataLakeStoreAccount filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) throws CloudException, IOException, IllegalArgumentException { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Validator.validate(filter); + Call call = service.listByResourceGroup(resourceGroupName, this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, search, format, this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listByResourceGroupDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listByResourceGroupNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account(s). + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count A Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listByResourceGroupAsync(final String resourceGroupName, final DataLakeStoreAccount filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (resourceGroupName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Validator.validate(filter, serviceCallback); + Call call = service.listByResourceGroup(resourceGroupName, this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, search, format, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listByResourceGroupNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DataLakeStoreAccount> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> list() throws CloudException, IOException, IllegalArgumentException { + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + DataLakeStoreAccount filter = null; + Integer top = null; + Integer skip = null; + String expand = null; + String select = null; + String orderby = null; + Boolean count = null; + String search = null; + String format = null; + Call call = service.list(this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, search, format, this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listAsync(final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + final DataLakeStoreAccount filter = null; + final Integer top = null; + final Integer skip = null; + final String expand = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + final String search = null; + final String format = null; + Call call = service.list(this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, search, format, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DataLakeStoreAccount> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> list(final DataLakeStoreAccount filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) throws CloudException, IOException, IllegalArgumentException { + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + Validator.validate(filter); + Call call = service.list(this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, search, format, this.client.getApiVersion(), this.client.getAcceptLanguage()); + ServiceResponse> response = listDelegate(call.execute()); + List result = response.getBody().getItems(); + while (response.getBody().getNextPageLink() != null) { + response = listNext(response.getBody().getNextPageLink()); + result.addAll(response.getBody().getItems()); + } + return new ServiceResponse<>(result, response.getResponse()); + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param expand OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you’d like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. + * @param search A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. + * @param format The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listAsync(final DataLakeStoreAccount filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + Validator.validate(filter, serviceCallback); + Call call = service.list(this.client.getSubscriptionId(), this.client.getMapperAdapter().serializeRaw(filter), top, skip, expand, select, orderby, count, search, format, this.client.getApiVersion(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<FirewallRule> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listFirewallRulesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + Call call = service.listFirewallRulesNext(nextPageLink, this.client.getAcceptLanguage()); + return listFirewallRulesNextDelegate(call.execute()); + } + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listFirewallRulesNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (nextPageLink == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.")); + return null; + } + Call call = service.listFirewallRulesNext(nextPageLink, this.client.getAcceptLanguage()); + serviceCall.newCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listFirewallRulesNextDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listFirewallRulesNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listFirewallRulesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the next page of Data Lake Store firewall rules, if any, for the specified account. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<FirewallRule> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> firewallRulesListNextNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + Call call = service.firewallRulesListNextNext(nextPageLink, this.client.getAcceptLanguage()); + return firewallRulesListNextNextDelegate(call.execute()); + } + + /** + * Gets the next page of Data Lake Store firewall rules, if any, for the specified account. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall firewallRulesListNextNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (nextPageLink == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.")); + return null; + } + Call call = service.firewallRulesListNextNext(nextPageLink, this.client.getAcceptLanguage()); + serviceCall.newCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = firewallRulesListNextNextDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + firewallRulesListNextNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> firewallRulesListNextNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DataLakeStoreAccount> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listByResourceGroupNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + Call call = service.listByResourceGroupNext(nextPageLink, this.client.getAcceptLanguage()); + return listByResourceGroupNextDelegate(call.execute()); + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listByResourceGroupNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (nextPageLink == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.")); + return null; + } + Call call = service.listByResourceGroupNext(nextPageLink, this.client.getAcceptLanguage()); + serviceCall.newCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listByResourceGroupNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the List<DataLakeStoreAccount> object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + Call call = service.listNext(nextPageLink, this.client.getAcceptLanguage()); + return listNextDelegate(call.execute()); + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceCall the ServiceCall object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listNextAsync(final String nextPageLink, final ServiceCall serviceCall, final ListOperationCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (nextPageLink == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.")); + return null; + } + Call call = service.listNext(nextPageLink, this.client.getAcceptLanguage()); + serviceCall.newCall(call); + call.enqueue(new ServiceResponseCallback>(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + serviceCallback.load(result.getBody().getItems()); + if (result.getBody().getNextPageLink() != null + && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) { + listNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); + } else { + serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); + } + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/DataLakeStoreAccountManagementClient.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/DataLakeStoreAccountManagementClient.java new file mode 100644 index 000000000000..cf540e593fb4 --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/DataLakeStoreAccountManagementClient.java @@ -0,0 +1,135 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store; + +import com.microsoft.azure.AzureClient; +import com.microsoft.rest.AutoRestBaseUrl; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.serializer.JacksonMapperAdapter; +import java.util.List; +import okhttp3.Interceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; + +/** + * The interface for DataLakeStoreAccountManagementClient class. + */ +public interface DataLakeStoreAccountManagementClient { + /** + * Gets the URL used as the base for all cloud service requests. + * + * @return the BaseUrl object. + */ + AutoRestBaseUrl getBaseUrl(); + + /** + * Gets the list of interceptors the OkHttp client will execute. + * @return the list of interceptors. + */ + List getClientInterceptors(); + + /** + * Sets the logging level for OkHttp client. + * + * @param logLevel the logging level enum. + */ + void setLogLevel(Level logLevel); + + /** + * Gets the adapter for {@link com.fasterxml.jackson.databind.ObjectMapper} for serialization + * and deserialization operations.. + * + * @return the adapter. + */ + JacksonMapperAdapter getMapperAdapter(); + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + AzureClient getAzureClient(); + + /** + * Gets Gets Azure subscription credentials.. + * + * @return the credentials value. + */ + ServiceClientCredentials getCredentials(); + + /** + * Gets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Sets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.. + * + * @param subscriptionId the subscriptionId value. + */ + void setSubscriptionId(String subscriptionId); + + /** + * Gets Client Api Version.. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets Gets or sets the preferred language for the response.. + * + * @return the acceptLanguage value. + */ + String getAcceptLanguage(); + + /** + * Sets Gets or sets the preferred language for the response.. + * + * @param acceptLanguage the acceptLanguage value. + */ + void setAcceptLanguage(String acceptLanguage); + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @return the longRunningOperationRetryTimeout value. + */ + int getLongRunningOperationRetryTimeout(); + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + */ + void setLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout); + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @return the generateClientRequestId value. + */ + boolean getGenerateClientRequestId(); + + /** + * 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. + */ + void setGenerateClientRequestId(boolean generateClientRequestId); + + /** + * Gets the AccountOperations object to access its operations. + * @return the AccountOperations object. + */ + AccountOperations getAccountOperations(); + +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/DataLakeStoreAccountManagementClientImpl.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/DataLakeStoreAccountManagementClientImpl.java new file mode 100644 index 000000000000..b9cf751a1fa1 --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/DataLakeStoreAccountManagementClientImpl.java @@ -0,0 +1,216 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.CustomHeaderInterceptor; +import com.microsoft.rest.AutoRestBaseUrl; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import java.util.UUID; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; + +/** + * Initializes a new instance of the DataLakeStoreAccountManagementClient class. + */ +public final class DataLakeStoreAccountManagementClientImpl extends AzureServiceClient implements DataLakeStoreAccountManagementClient { + /** The URL used as the base for all cloud service requests. */ + private final AutoRestBaseUrl baseUrl; + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the URL used as the base for all cloud service requests. + * + * @return The BaseUrl value. + */ + public AutoRestBaseUrl getBaseUrl() { + return this.baseUrl; + } + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets Azure subscription credentials. */ + private ServiceClientCredentials credentials; + + /** + * Gets Gets Azure subscription credentials. + * + * @return the credentials value. + */ + public ServiceClientCredentials getCredentials() { + return this.credentials; + } + + /** Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + */ + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + /** Client Api Version. */ + private String apiVersion; + + /** + * Gets Client Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** 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 getAcceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + */ + public void setAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + } + + /** 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 getLongRunningOperationRetryTimeout() { + 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. + */ + public void setLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + } + + /** 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 getGenerateClientRequestId() { + 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. + */ + public void setGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + } + + /** + * Gets the AccountOperations object to access its operations. + * @return the AccountOperations object. + */ + public AccountOperations getAccountOperations() { + return new AccountOperationsImpl(this.retrofitBuilder.client(clientBuilder.build()).build(), this); + } + + /** + * Initializes an instance of DataLakeStoreAccountManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public DataLakeStoreAccountManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of DataLakeStoreAccountManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public DataLakeStoreAccountManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(); + this.baseUrl = new AutoRestBaseUrl(baseUrl); + this.credentials = credentials; + initialize(); + } + + /** + * Initializes an instance of DataLakeStoreAccountManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + * @param clientBuilder the builder for building up an {@link OkHttpClient} + * @param retrofitBuilder the builder for building up a {@link Retrofit} + */ + public DataLakeStoreAccountManagementClientImpl(String baseUrl, ServiceClientCredentials credentials, OkHttpClient.Builder clientBuilder, Retrofit.Builder retrofitBuilder) { + super(clientBuilder, retrofitBuilder); + this.baseUrl = new AutoRestBaseUrl(baseUrl); + this.credentials = credentials; + initialize(); + } + + @Override + protected void initialize() { + this.apiVersion = "2015-10-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.clientBuilder.interceptors().add(new CustomHeaderInterceptor("x-ms-client-request-id", UUID.randomUUID().toString())); + if (this.credentials != null) { + this.credentials.applyCredentialsFilter(clientBuilder); + } + super.initialize(); + this.azureClient = new AzureClient(clientBuilder, retrofitBuilder, mapperAdapter); + this.azureClient.setCredentials(this.credentials); + this.retrofitBuilder.baseUrl(baseUrl); + } +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/DataLakeStoreFileSystemManagementClient.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/DataLakeStoreFileSystemManagementClient.java new file mode 100644 index 000000000000..77df08d9e110 --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/DataLakeStoreFileSystemManagementClient.java @@ -0,0 +1,149 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store; + +import com.microsoft.azure.AzureClient; +import com.microsoft.rest.AutoRestBaseUrl; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.serializer.JacksonMapperAdapter; +import java.util.List; +import okhttp3.Interceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; + +/** + * The interface for DataLakeStoreFileSystemManagementClient class. + */ +public interface DataLakeStoreFileSystemManagementClient { + /** + * Gets the URL used as the base for all cloud service requests. + * + * @return the BaseUrl object. + */ + AutoRestBaseUrl getBaseUrl(); + + /** + * Gets the list of interceptors the OkHttp client will execute. + * @return the list of interceptors. + */ + List getClientInterceptors(); + + /** + * Sets the logging level for OkHttp client. + * + * @param logLevel the logging level enum. + */ + void setLogLevel(Level logLevel); + + /** + * Gets the adapter for {@link com.fasterxml.jackson.databind.ObjectMapper} for serialization + * and deserialization operations.. + * + * @return the adapter. + */ + JacksonMapperAdapter getMapperAdapter(); + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + AzureClient getAzureClient(); + + /** + * Gets Gets Azure subscription credentials.. + * + * @return the credentials value. + */ + ServiceClientCredentials getCredentials(); + + /** + * Gets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Sets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.. + * + * @param subscriptionId the subscriptionId value. + */ + void setSubscriptionId(String subscriptionId); + + /** + * Gets Client Api Version.. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets Gets the URI used as the base for all cloud service requests.. + * + * @return the adlsFileSystemDnsSuffix value. + */ + String getAdlsFileSystemDnsSuffix(); + + /** + * Sets Gets the URI used as the base for all cloud service requests.. + * + * @param adlsFileSystemDnsSuffix the adlsFileSystemDnsSuffix value. + */ + void setAdlsFileSystemDnsSuffix(String adlsFileSystemDnsSuffix); + + /** + * Gets Gets or sets the preferred language for the response.. + * + * @return the acceptLanguage value. + */ + String getAcceptLanguage(); + + /** + * Sets Gets or sets the preferred language for the response.. + * + * @param acceptLanguage the acceptLanguage value. + */ + void setAcceptLanguage(String acceptLanguage); + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @return the longRunningOperationRetryTimeout value. + */ + int getLongRunningOperationRetryTimeout(); + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + */ + void setLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout); + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @return the generateClientRequestId value. + */ + boolean getGenerateClientRequestId(); + + /** + * 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. + */ + void setGenerateClientRequestId(boolean generateClientRequestId); + + /** + * Gets the FileSystemOperations object to access its operations. + * @return the FileSystemOperations object. + */ + FileSystemOperations getFileSystemOperations(); + +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/DataLakeStoreFileSystemManagementClientImpl.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/DataLakeStoreFileSystemManagementClientImpl.java new file mode 100644 index 000000000000..1975307f7ff6 --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/DataLakeStoreFileSystemManagementClientImpl.java @@ -0,0 +1,237 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.CustomHeaderInterceptor; +import com.microsoft.rest.AutoRestBaseUrl; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import java.util.UUID; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; + +/** + * Initializes a new instance of the DataLakeStoreFileSystemManagementClient class. + */ +public final class DataLakeStoreFileSystemManagementClientImpl extends AzureServiceClient implements DataLakeStoreFileSystemManagementClient { + /** The URL used as the base for all cloud service requests. */ + private final AutoRestBaseUrl baseUrl; + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the URL used as the base for all cloud service requests. + * + * @return The BaseUrl value. + */ + public AutoRestBaseUrl getBaseUrl() { + return this.baseUrl; + } + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets Azure subscription credentials. */ + private ServiceClientCredentials credentials; + + /** + * Gets Gets Azure subscription credentials. + * + * @return the credentials value. + */ + public ServiceClientCredentials getCredentials() { + return this.credentials; + } + + /** Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + */ + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + /** Client Api Version. */ + private String apiVersion; + + /** + * Gets Client Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** Gets the URI used as the base for all cloud service requests. */ + private String adlsFileSystemDnsSuffix; + + /** + * Gets Gets the URI used as the base for all cloud service requests. + * + * @return the adlsFileSystemDnsSuffix value. + */ + public String getAdlsFileSystemDnsSuffix() { + return this.adlsFileSystemDnsSuffix; + } + + /** + * Sets Gets the URI used as the base for all cloud service requests. + * + * @param adlsFileSystemDnsSuffix the adlsFileSystemDnsSuffix value. + */ + public void setAdlsFileSystemDnsSuffix(String adlsFileSystemDnsSuffix) { + this.adlsFileSystemDnsSuffix = adlsFileSystemDnsSuffix; + } + + /** 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 getAcceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + */ + public void setAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + } + + /** 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 getLongRunningOperationRetryTimeout() { + 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. + */ + public void setLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + } + + /** 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 getGenerateClientRequestId() { + 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. + */ + public void setGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + } + + /** + * Gets the FileSystemOperations object to access its operations. + * @return the FileSystemOperations object. + */ + public FileSystemOperations getFileSystemOperations() { + return new FileSystemOperationsImpl(this.retrofitBuilder.client(clientBuilder.build()).build(), this); + } + + /** + * Initializes an instance of DataLakeStoreFileSystemManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public DataLakeStoreFileSystemManagementClientImpl(ServiceClientCredentials credentials) { + this("https://{accountName}.{adlsFileSystemDnsSuffix}", credentials); + } + + /** + * Initializes an instance of DataLakeStoreFileSystemManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + private DataLakeStoreFileSystemManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(); + this.baseUrl = new AutoRestBaseUrl(baseUrl); + this.credentials = credentials; + initialize(); + } + + /** + * Initializes an instance of DataLakeStoreFileSystemManagementClient client. + * + * @param credentials the management credentials for Azure + * @param clientBuilder the builder for building up an {@link OkHttpClient} + * @param retrofitBuilder the builder for building up a {@link Retrofit} + */ + public DataLakeStoreFileSystemManagementClientImpl(ServiceClientCredentials credentials, OkHttpClient.Builder clientBuilder, Retrofit.Builder retrofitBuilder) { + super(clientBuilder, retrofitBuilder); + this.baseUrl = new AutoRestBaseUrl("https://{accountName}.{adlsFileSystemDnsSuffix}"); + this.credentials = credentials; + initialize(); + } + + @Override + protected void initialize() { + this.apiVersion = "2015-10-01-preview"; + this.adlsFileSystemDnsSuffix = "azuredatalakestore.net"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.clientBuilder.interceptors().add(new CustomHeaderInterceptor("x-ms-client-request-id", UUID.randomUUID().toString())); + if (this.credentials != null) { + this.credentials.applyCredentialsFilter(clientBuilder); + } + super.initialize(); + this.azureClient = new AzureClient(clientBuilder, retrofitBuilder, mapperAdapter); + this.azureClient.setCredentials(this.credentials); + this.retrofitBuilder.baseUrl(baseUrl); + } +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/FileSystemOperations.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/FileSystemOperations.java new file mode 100644 index 000000000000..1f53d7563b5e --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/FileSystemOperations.java @@ -0,0 +1,710 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store; + +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.datalake.store.models.AclStatusResult; +import com.microsoft.azure.management.datalake.store.models.AppendModeType; +import com.microsoft.azure.management.datalake.store.models.ContentSummaryResult; +import com.microsoft.azure.management.datalake.store.models.FileOperationResult; +import com.microsoft.azure.management.datalake.store.models.FileStatusesResult; +import com.microsoft.azure.management.datalake.store.models.FileStatusResult; +import com.microsoft.rest.ServiceCall; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceResponse; +import java.io.InputStream; +import java.io.IOException; +import java.util.List; + +/** + * An instance of this class provides access to all the operations defined + * in FileSystemOperations. + */ +public interface FileSystemOperations { + /** + * Appends to the specified file. This method supports multiple concurrent appends to the file. NOTE: Concurrent append and normal (serial) append CANNOT be used interchangeably. Once a file has been appended to using either append option, it can only be appended to using that append option. + * + * @param filePath The Data Lake Store path (starting with '/') of the file to which to append using concurrent append. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param streamContents The file contents to include when appending to the file. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse concurrentAppend(String filePath, String accountName, byte[] streamContents) throws CloudException, IOException, IllegalArgumentException; + + /** + * Appends to the specified file. This method supports multiple concurrent appends to the file. NOTE: Concurrent append and normal (serial) append CANNOT be used interchangeably. Once a file has been appended to using either append option, it can only be appended to using that append option. + * + * @param filePath The Data Lake Store path (starting with '/') of the file to which to append using concurrent append. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param streamContents The file contents to include when appending to the file. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall concurrentAppendAsync(String filePath, String accountName, byte[] streamContents, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Appends to the specified file. This method supports multiple concurrent appends to the file. NOTE: Concurrent append and normal (serial) append CANNOT be used interchangeably. Once a file has been appended to using either append option, it can only be appended to using that append option. + * + * @param filePath The Data Lake Store path (starting with '/') of the file to which to append using concurrent append. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param streamContents The file contents to include when appending to the file. + * @param appendMode Indicates the concurrent append call should create the file if it doesn't exist or just open the existing file for append. Possible values include: 'autocreate' + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse concurrentAppend(String filePath, String accountName, byte[] streamContents, AppendModeType appendMode) throws CloudException, IOException, IllegalArgumentException; + + /** + * Appends to the specified file. This method supports multiple concurrent appends to the file. NOTE: Concurrent append and normal (serial) append CANNOT be used interchangeably. Once a file has been appended to using either append option, it can only be appended to using that append option. + * + * @param filePath The Data Lake Store path (starting with '/') of the file to which to append using concurrent append. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param streamContents The file contents to include when appending to the file. + * @param appendMode Indicates the concurrent append call should create the file if it doesn't exist or just open the existing file for append. Possible values include: 'autocreate' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall concurrentAppendAsync(String filePath, String accountName, byte[] streamContents, AppendModeType appendMode, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Checks if the specified access is available at the given path. + * + * @param path The Data Lake Store path (starting with '/') of the file or directory for which to check access. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse checkAccess(String path, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Checks if the specified access is available at the given path. + * + * @param path The Data Lake Store path (starting with '/') of the file or directory for which to check access. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall checkAccessAsync(String path, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Checks if the specified access is available at the given path. + * + * @param path The Data Lake Store path (starting with '/') of the file or directory for which to check access. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param fsaction File system operation read/write/execute in string form, matching regex pattern '[rwx-]{3}' + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse checkAccess(String path, String accountName, String fsaction) throws CloudException, IOException, IllegalArgumentException; + + /** + * Checks if the specified access is available at the given path. + * + * @param path The Data Lake Store path (starting with '/') of the file or directory for which to check access. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param fsaction File system operation read/write/execute in string form, matching regex pattern '[rwx-]{3}' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall checkAccessAsync(String path, String accountName, String fsaction, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Creates a directory. + * + * @param path The Data Lake Store path (starting with '/') of the directory to create. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the FileOperationResult object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse mkdirs(String path, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Creates a directory. + * + * @param path The Data Lake Store path (starting with '/') of the directory to create. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall mkdirsAsync(String path, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Concatenates the list of source files into the destination file, removing all source files upon success. + * + * @param destinationPath The Data Lake Store path (starting with '/') of the destination file resulting from the concatenation. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param sources A list of comma seperated Data Lake Store paths (starting with '/') of the files to concatenate, in the order in which they should be concatenated. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse concat(String destinationPath, String accountName, List sources) throws CloudException, IOException, IllegalArgumentException; + + /** + * Concatenates the list of source files into the destination file, removing all source files upon success. + * + * @param destinationPath The Data Lake Store path (starting with '/') of the destination file resulting from the concatenation. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param sources A list of comma seperated Data Lake Store paths (starting with '/') of the files to concatenate, in the order in which they should be concatenated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall concatAsync(String destinationPath, String accountName, List sources, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Concatenates the list of source files into the destination file, deleting all source files upon success. This method accepts more source file paths than the Concat method. This method and the parameters it accepts are subject to change for usability in an upcoming version. + * + * @param msConcatDestinationPath The Data Lake Store path (starting with '/') of the destination file resulting from the concatenation. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param streamContents A list of Data Lake Store paths (starting with '/') of the source files. Must be in the format: sources=<comma separated list> + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse msConcat(String msConcatDestinationPath, String accountName, byte[] streamContents) throws CloudException, IOException, IllegalArgumentException; + + /** + * Concatenates the list of source files into the destination file, deleting all source files upon success. This method accepts more source file paths than the Concat method. This method and the parameters it accepts are subject to change for usability in an upcoming version. + * + * @param msConcatDestinationPath The Data Lake Store path (starting with '/') of the destination file resulting from the concatenation. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param streamContents A list of Data Lake Store paths (starting with '/') of the source files. Must be in the format: sources=<comma separated list> + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall msConcatAsync(String msConcatDestinationPath, String accountName, byte[] streamContents, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Concatenates the list of source files into the destination file, deleting all source files upon success. This method accepts more source file paths than the Concat method. This method and the parameters it accepts are subject to change for usability in an upcoming version. + * + * @param msConcatDestinationPath The Data Lake Store path (starting with '/') of the destination file resulting from the concatenation. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param streamContents A list of Data Lake Store paths (starting with '/') of the source files. Must be in the format: sources=<comma separated list> + * @param deleteSourceDirectory Indicates that as an optimization instead of deleting each individual source stream, delete the source stream folder if all streams are in the same folder instead. This results in a substantial performance improvement when the only streams in the folder are part of the concatenation operation. WARNING: This includes the deletion of any other files that are not source files. Only set this to true when source files are the only files in the source directory. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse msConcat(String msConcatDestinationPath, String accountName, byte[] streamContents, Boolean deleteSourceDirectory) throws CloudException, IOException, IllegalArgumentException; + + /** + * Concatenates the list of source files into the destination file, deleting all source files upon success. This method accepts more source file paths than the Concat method. This method and the parameters it accepts are subject to change for usability in an upcoming version. + * + * @param msConcatDestinationPath The Data Lake Store path (starting with '/') of the destination file resulting from the concatenation. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param streamContents A list of Data Lake Store paths (starting with '/') of the source files. Must be in the format: sources=<comma separated list> + * @param deleteSourceDirectory Indicates that as an optimization instead of deleting each individual source stream, delete the source stream folder if all streams are in the same folder instead. This results in a substantial performance improvement when the only streams in the folder are part of the concatenation operation. WARNING: This includes the deletion of any other files that are not source files. Only set this to true when source files are the only files in the source directory. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall msConcatAsync(String msConcatDestinationPath, String accountName, byte[] streamContents, Boolean deleteSourceDirectory, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Get the list of file status objects specified by the file path, with optional pagination parameters. + * + * @param listFilePath The Data Lake Store path (starting with '/') of the directory to list. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the FileStatusesResult object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse listFileStatus(String listFilePath, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Get the list of file status objects specified by the file path, with optional pagination parameters. + * + * @param listFilePath The Data Lake Store path (starting with '/') of the directory to list. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall listFileStatusAsync(String listFilePath, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Gets the file content summary object specified by the file path. + * + * @param getContentSummaryFilePath The Data Lake Store path (starting with '/') of the file for which to retrieve the summary. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the ContentSummaryResult object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getContentSummary(String getContentSummaryFilePath, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets the file content summary object specified by the file path. + * + * @param getContentSummaryFilePath The Data Lake Store path (starting with '/') of the file for which to retrieve the summary. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getContentSummaryAsync(String getContentSummaryFilePath, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Get the file status object specified by the file path. + * + * @param getFilePath The Data Lake Store path (starting with '/') of the file or directory for which to retrieve the status. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the FileStatusResult object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getFileStatus(String getFilePath, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Get the file status object specified by the file path. + * + * @param getFilePath The Data Lake Store path (starting with '/') of the file or directory for which to retrieve the status. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getFileStatusAsync(String getFilePath, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Appends to the specified file. This method does not support multiple concurrent appends to the file. NOTE: Concurrent append and normal (serial) append CANNOT be used interchangeably. Once a file has been appended to using either append option, it can only be appended to using that append option. Use the ConcurrentAppend option if you would like support for concurrent appends. + * + * @param directFilePath The Data Lake Store path (starting with '/') of the file to which to append. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param streamContents The file contents to include when appending to the file. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse append(String directFilePath, String accountName, byte[] streamContents) throws CloudException, IOException, IllegalArgumentException; + + /** + * Appends to the specified file. This method does not support multiple concurrent appends to the file. NOTE: Concurrent append and normal (serial) append CANNOT be used interchangeably. Once a file has been appended to using either append option, it can only be appended to using that append option. Use the ConcurrentAppend option if you would like support for concurrent appends. + * + * @param directFilePath The Data Lake Store path (starting with '/') of the file to which to append. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param streamContents The file contents to include when appending to the file. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall appendAsync(String directFilePath, String accountName, byte[] streamContents, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Creates a file with optionally specified content. + * + * @param directFilePath The Data Lake Store path (starting with '/') of the file to create. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse create(String directFilePath, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Creates a file with optionally specified content. + * + * @param directFilePath The Data Lake Store path (starting with '/') of the file to create. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall createAsync(String directFilePath, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Creates a file with optionally specified content. + * + * @param directFilePath The Data Lake Store path (starting with '/') of the file to create. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param streamContents The file contents to include when creating the file. This parameter is optional, resulting in an empty file if not specified. + * @param overwrite The indication of if the file should be overwritten. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse create(String directFilePath, String accountName, byte[] streamContents, Boolean overwrite) throws CloudException, IOException, IllegalArgumentException; + + /** + * Creates a file with optionally specified content. + * + * @param directFilePath The Data Lake Store path (starting with '/') of the file to create. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param streamContents The file contents to include when creating the file. This parameter is optional, resulting in an empty file if not specified. + * @param overwrite The indication of if the file should be overwritten. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall createAsync(String directFilePath, String accountName, byte[] streamContents, Boolean overwrite, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Opens and reads from the specified file. + * + * @param directFilePath The Data Lake Store path (starting with '/') of the file to open. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the InputStream object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse open(String directFilePath, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Opens and reads from the specified file. + * + * @param directFilePath The Data Lake Store path (starting with '/') of the file to open. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall openAsync(String directFilePath, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Opens and reads from the specified file. + * + * @param directFilePath The Data Lake Store path (starting with '/') of the file to open. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param length the Long value + * @param offset the Long value + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the InputStream object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse open(String directFilePath, String accountName, Long length, Long offset) throws CloudException, IOException, IllegalArgumentException; + + /** + * Opens and reads from the specified file. + * + * @param directFilePath The Data Lake Store path (starting with '/') of the file to open. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param length the Long value + * @param offset the Long value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall openAsync(String directFilePath, String accountName, Long length, Long offset, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Sets the Access Control List (ACL) for a file or folder. + * + * @param setAclFilePath The Data Lake Store path (starting with '/') of the file or directory on which to set the ACL. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param aclspec The ACL spec included in ACL creation operations in the format '[default:]user|group|other::r|-w|-x|-' + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse setAcl(String setAclFilePath, String accountName, String aclspec) throws CloudException, IOException, IllegalArgumentException; + + /** + * Sets the Access Control List (ACL) for a file or folder. + * + * @param setAclFilePath The Data Lake Store path (starting with '/') of the file or directory on which to set the ACL. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param aclspec The ACL spec included in ACL creation operations in the format '[default:]user|group|other::r|-w|-x|-' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall setAclAsync(String setAclFilePath, String accountName, String aclspec, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Modifies existing Access Control List (ACL) entries on a file or folder. + * + * @param modifyAclFilePath The Data Lake Store path (starting with '/') of the file or directory with the ACL being modified. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param aclspec The ACL specification included in ACL modification operations in the format '[default:]user|group|other::r|-w|-x|-' + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse modifyAclEntries(String modifyAclFilePath, String accountName, String aclspec) throws CloudException, IOException, IllegalArgumentException; + + /** + * Modifies existing Access Control List (ACL) entries on a file or folder. + * + * @param modifyAclFilePath The Data Lake Store path (starting with '/') of the file or directory with the ACL being modified. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param aclspec The ACL specification included in ACL modification operations in the format '[default:]user|group|other::r|-w|-x|-' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall modifyAclEntriesAsync(String modifyAclFilePath, String accountName, String aclspec, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Removes existing Access Control List (ACL) entries for a file or folder. + * + * @param removeAclFilePath The Data Lake Store path (starting with '/') of the file or directory with the ACL being removed. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param aclspec The ACL spec included in ACL removal operations in the format '[default:]user|group|other' + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse removeAclEntries(String removeAclFilePath, String accountName, String aclspec) throws CloudException, IOException, IllegalArgumentException; + + /** + * Removes existing Access Control List (ACL) entries for a file or folder. + * + * @param removeAclFilePath The Data Lake Store path (starting with '/') of the file or directory with the ACL being removed. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param aclspec The ACL spec included in ACL removal operations in the format '[default:]user|group|other' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall removeAclEntriesAsync(String removeAclFilePath, String accountName, String aclspec, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Removes the existing Access Control List (ACL) of the specified file or directory. + * + * @param aclFilePath The Data Lake Store path (starting with '/') of the file or directory with the ACL being removed. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse removeAcl(String aclFilePath, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Removes the existing Access Control List (ACL) of the specified file or directory. + * + * @param aclFilePath The Data Lake Store path (starting with '/') of the file or directory with the ACL being removed. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall removeAclAsync(String aclFilePath, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Gets Access Control List (ACL) entries for the specified file or directory. + * + * @param aclFilePath The Data Lake Store path (starting with '/') of the file or directory for which to get the ACL. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the AclStatusResult object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getAclStatus(String aclFilePath, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Gets Access Control List (ACL) entries for the specified file or directory. + * + * @param aclFilePath The Data Lake Store path (starting with '/') of the file or directory for which to get the ACL. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getAclStatusAsync(String aclFilePath, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Deletes the requested file or directory, optionally recursively. + * + * @param filePath The Data Lake Store path (starting with '/') of the file or directory to delete. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the FileOperationResult object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse delete(String filePath, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Deletes the requested file or directory, optionally recursively. + * + * @param filePath The Data Lake Store path (starting with '/') of the file or directory to delete. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall deleteAsync(String filePath, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Deletes the requested file or directory, optionally recursively. + * + * @param filePath The Data Lake Store path (starting with '/') of the file or directory to delete. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param recursive The optional switch indicating if the delete should be recursive + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the FileOperationResult object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse delete(String filePath, String accountName, Boolean recursive) throws CloudException, IOException, IllegalArgumentException; + + /** + * Deletes the requested file or directory, optionally recursively. + * + * @param filePath The Data Lake Store path (starting with '/') of the file or directory to delete. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param recursive The optional switch indicating if the delete should be recursive + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall deleteAsync(String filePath, String accountName, Boolean recursive, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Rename a file or directory. + * + * @param renameFilePath The Data Lake Store path (starting with '/') of the file or directory to move/rename. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param destination The path to move/rename the file or folder to + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the FileOperationResult object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse rename(String renameFilePath, String accountName, String destination) throws CloudException, IOException, IllegalArgumentException; + + /** + * Rename a file or directory. + * + * @param renameFilePath The Data Lake Store path (starting with '/') of the file or directory to move/rename. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param destination The path to move/rename the file or folder to + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall renameAsync(String renameFilePath, String accountName, String destination, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Sets the owner of a file or directory. + * + * @param setOwnerFilePath The Data Lake Store path (starting with '/') of the file or directory for which to set the owner. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse setOwner(String setOwnerFilePath, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Sets the owner of a file or directory. + * + * @param setOwnerFilePath The Data Lake Store path (starting with '/') of the file or directory for which to set the owner. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall setOwnerAsync(String setOwnerFilePath, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Sets the owner of a file or directory. + * + * @param setOwnerFilePath The Data Lake Store path (starting with '/') of the file or directory for which to set the owner. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param owner The AAD Object ID of the user owner of the file or directory. If empty, the property will remain unchanged. + * @param group The AAD Object ID of the group owner of the file or directory. If empty, the property will remain unchanged. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse setOwner(String setOwnerFilePath, String accountName, String owner, String group) throws CloudException, IOException, IllegalArgumentException; + + /** + * Sets the owner of a file or directory. + * + * @param setOwnerFilePath The Data Lake Store path (starting with '/') of the file or directory for which to set the owner. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param owner The AAD Object ID of the user owner of the file or directory. If empty, the property will remain unchanged. + * @param group The AAD Object ID of the group owner of the file or directory. If empty, the property will remain unchanged. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall setOwnerAsync(String setOwnerFilePath, String accountName, String owner, String group, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Sets the permission of the file or folder. + * + * @param setPermissionFilePath The Data Lake Store path (starting with '/') of the file or directory for which to set the permission. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse setPermission(String setPermissionFilePath, String accountName) throws CloudException, IOException, IllegalArgumentException; + + /** + * Sets the permission of the file or folder. + * + * @param setPermissionFilePath The Data Lake Store path (starting with '/') of the file or directory for which to set the permission. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall setPermissionAsync(String setPermissionFilePath, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Sets the permission of the file or folder. + * + * @param setPermissionFilePath The Data Lake Store path (starting with '/') of the file or directory for which to set the permission. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param permission A string representation of the permission (i.e 'rwx'). If empty, this property remains unchanged. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse setPermission(String setPermissionFilePath, String accountName, String permission) throws CloudException, IOException, IllegalArgumentException; + + /** + * Sets the permission of the file or folder. + * + * @param setPermissionFilePath The Data Lake Store path (starting with '/') of the file or directory for which to set the permission. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param permission A string representation of the permission (i.e 'rwx'). If empty, this property remains unchanged. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall setPermissionAsync(String setPermissionFilePath, String accountName, String permission, final ServiceCallback serviceCallback) throws IllegalArgumentException; + +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/FileSystemOperationsImpl.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/FileSystemOperationsImpl.java new file mode 100644 index 000000000000..0c14f863512f --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/FileSystemOperationsImpl.java @@ -0,0 +1,2783 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store; + +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceResponseBuilder; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.datalake.store.models.AclStatusResult; +import com.microsoft.azure.management.datalake.store.models.AppendModeType; +import com.microsoft.azure.management.datalake.store.models.ContentSummaryResult; +import com.microsoft.azure.management.datalake.store.models.FileOperationResult; +import com.microsoft.azure.management.datalake.store.models.FileStatusesResult; +import com.microsoft.azure.management.datalake.store.models.FileStatusResult; +import com.microsoft.rest.serializer.CollectionFormat; +import com.microsoft.rest.ServiceCall; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseCallback; +import com.microsoft.rest.Validator; +import java.io.InputStream; +import java.io.IOException; +import java.util.List; +import okhttp3.MediaType; +import okhttp3.RequestBody; +import okhttp3.ResponseBody; +import retrofit2.Call; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Streaming; +import retrofit2.Response; +import retrofit2.Retrofit; + +/** + * An instance of this class provides access to all the operations defined + * in FileSystemOperations. + */ +public final class FileSystemOperationsImpl implements FileSystemOperations { + /** The Retrofit service to perform REST calls. */ + private FileSystemService service; + /** The service client containing this operation class. */ + private DataLakeStoreFileSystemManagementClient client; + + /** + * Initializes an instance of FileSystemOperations. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public FileSystemOperationsImpl(Retrofit retrofit, DataLakeStoreFileSystemManagementClient client) { + this.service = retrofit.create(FileSystemService.class); + this.client = client; + } + + /** + * The interface defining all the services for FileSystemOperations to be + * used by Retrofit to perform actually REST calls. + */ + interface FileSystemService { + @Headers("Content-Type: application/octet-stream") + @POST("WebHdfsExt/{filePath}") + Call concurrentAppend(@Path("filePath") String filePath, @Body RequestBody streamContents, @Query("appendMode") String appendMode, @Query("op") String op, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("webhdfs/v1/{path}") + Call checkAccess(@Path("path") String path, @Query("fsaction") String fsaction, @Query("op") String op, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @PUT("webhdfs/v1/{path}") + Call mkdirs(@Path("path") String path, @Query("op") String op, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @POST("webhdfs/v1/{destinationPath}") + Call concat(@Path("destinationPath") String destinationPath, @Query("sources") String sources, @Query("op") String op, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/octet-stream") + @POST("webhdfs/v1/{msConcatDestinationPath}") + Call msConcat(@Path("msConcatDestinationPath") String msConcatDestinationPath, @Query("deleteSourceDirectory") Boolean deleteSourceDirectory, @Body RequestBody streamContents, @Query("op") String op, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("webhdfs/v1/{listFilePath}") + Call listFileStatus(@Path("listFilePath") String listFilePath, @Query("op") String op, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("webhdfs/va/{getContentSummaryFilePath}") + Call getContentSummary(@Path("getContentSummaryFilePath") String getContentSummaryFilePath, @Query("op") String op, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("webhdfs/v1/{getFilePath}") + Call getFileStatus(@Path("getFilePath") String getFilePath, @Query("op") String op, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/octet-stream") + @POST("webhdfs/v1/{directFilePath}") + Call append(@Path("directFilePath") String directFilePath, @Body RequestBody streamContents, @Query("op") String op, @Query("append") String append, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/octet-stream") + @PUT("webhdfs/v1/{directFilePath}") + Call create(@Path("directFilePath") String directFilePath, @Body RequestBody streamContents, @Query("overwrite") Boolean overwrite, @Query("op") String op, @Query("write") String write, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("webhdfs/v1/{directFilePath}") + @Streaming + Call open(@Path("directFilePath") String directFilePath, @Query("length") Long length, @Query("offset") Long offset, @Query("op") String op, @Query("read") String read, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @PUT("webhdfs/v1/{setAclFilePath}") + Call setAcl(@Path("setAclFilePath") String setAclFilePath, @Query("aclspec") String aclspec, @Query("op") String op, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @PUT("webhdfs/v1/{modifyAclFilePath}") + Call modifyAclEntries(@Path("modifyAclFilePath") String modifyAclFilePath, @Query("aclspec") String aclspec, @Query("op") String op, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @PUT("webhdfs/v1/{removeAclFilePath}") + Call removeAclEntries(@Path("removeAclFilePath") String removeAclFilePath, @Query("aclspec") String aclspec, @Query("op") String op, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @PUT("webhdfs/v1/{aclFilePath}") + Call removeAcl(@Path("aclFilePath") String aclFilePath, @Query("op") String op, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("webhdfs/v1/{aclFilePath}") + Call getAclStatus(@Path("aclFilePath") String aclFilePath, @Query("op") String op, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @HTTP(path = "webhdfs/v1/{filePath}", method = "DELETE", hasBody = true) + Call delete(@Path("filePath") String filePath, @Query("recursive") Boolean recursive, @Query("op") String op, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @PUT("webhdfs/v1/{renameFilePath}") + Call rename(@Path("renameFilePath") String renameFilePath, @Query("destination") String destination, @Query("op") String op, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @PUT("webhdfs/v1/{setOwnerFilePath}") + Call setOwner(@Path("setOwnerFilePath") String setOwnerFilePath, @Query("owner") String owner, @Query("group") String group, @Query("op") String op, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @PUT("webhdfs/v1/{setPermissionFilePath}") + Call setPermission(@Path("setPermissionFilePath") String setPermissionFilePath, @Query("permission") String permission, @Query("op") String op, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + + } + + /** + * Appends to the specified file. This method supports multiple concurrent appends to the file. NOTE: Concurrent append and normal (serial) append CANNOT be used interchangeably. Once a file has been appended to using either append option, it can only be appended to using that append option. + * + * @param filePath The Data Lake Store path (starting with '/') of the file to which to append using concurrent append. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param streamContents The file contents to include when appending to the file. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse concurrentAppend(String filePath, String accountName, byte[] streamContents) throws CloudException, IOException, IllegalArgumentException { + if (filePath == null) { + throw new IllegalArgumentException("Parameter filePath is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); + } + if (streamContents == null) { + throw new IllegalArgumentException("Parameter streamContents is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + final String op = "CONCURRENTAPPEND"; + final AppendModeType appendMode = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.concurrentAppend(filePath, RequestBody.create(MediaType.parse("application/octet-stream"), streamContents), this.client.getMapperAdapter().serializeRaw(appendMode), op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return concurrentAppendDelegate(call.execute()); + } + + /** + * Appends to the specified file. This method supports multiple concurrent appends to the file. NOTE: Concurrent append and normal (serial) append CANNOT be used interchangeably. Once a file has been appended to using either append option, it can only be appended to using that append option. + * + * @param filePath The Data Lake Store path (starting with '/') of the file to which to append using concurrent append. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param streamContents The file contents to include when appending to the file. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall concurrentAppendAsync(String filePath, String accountName, byte[] streamContents, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (filePath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter filePath is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); + return null; + } + if (streamContents == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter streamContents is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String op = "CONCURRENTAPPEND"; + final AppendModeType appendMode = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.concurrentAppend(filePath, RequestBody.create(MediaType.parse("application/octet-stream"), streamContents), this.client.getMapperAdapter().serializeRaw(appendMode), op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(concurrentAppendDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Appends to the specified file. This method supports multiple concurrent appends to the file. NOTE: Concurrent append and normal (serial) append CANNOT be used interchangeably. Once a file has been appended to using either append option, it can only be appended to using that append option. + * + * @param filePath The Data Lake Store path (starting with '/') of the file to which to append using concurrent append. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param streamContents The file contents to include when appending to the file. + * @param appendMode Indicates the concurrent append call should create the file if it doesn't exist or just open the existing file for append. Possible values include: 'autocreate' + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse concurrentAppend(String filePath, String accountName, byte[] streamContents, AppendModeType appendMode) throws CloudException, IOException, IllegalArgumentException { + if (filePath == null) { + throw new IllegalArgumentException("Parameter filePath is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); + } + if (streamContents == null) { + throw new IllegalArgumentException("Parameter streamContents is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + final String op = "CONCURRENTAPPEND"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.concurrentAppend(filePath, RequestBody.create(MediaType.parse("application/octet-stream"), streamContents), this.client.getMapperAdapter().serializeRaw(appendMode), op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return concurrentAppendDelegate(call.execute()); + } + + /** + * Appends to the specified file. This method supports multiple concurrent appends to the file. NOTE: Concurrent append and normal (serial) append CANNOT be used interchangeably. Once a file has been appended to using either append option, it can only be appended to using that append option. + * + * @param filePath The Data Lake Store path (starting with '/') of the file to which to append using concurrent append. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param streamContents The file contents to include when appending to the file. + * @param appendMode Indicates the concurrent append call should create the file if it doesn't exist or just open the existing file for append. Possible values include: 'autocreate' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall concurrentAppendAsync(String filePath, String accountName, byte[] streamContents, AppendModeType appendMode, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (filePath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter filePath is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); + return null; + } + if (streamContents == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter streamContents is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String op = "CONCURRENTAPPEND"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.concurrentAppend(filePath, RequestBody.create(MediaType.parse("application/octet-stream"), streamContents), this.client.getMapperAdapter().serializeRaw(appendMode), op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(concurrentAppendDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse concurrentAppendDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Checks if the specified access is available at the given path. + * + * @param path The Data Lake Store path (starting with '/') of the file or directory for which to check access. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse checkAccess(String path, String accountName) throws CloudException, IOException, IllegalArgumentException { + if (path == null) { + throw new IllegalArgumentException("Parameter path is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + final String op = "CHECKACCESS"; + final String fsaction = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.checkAccess(path, fsaction, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return checkAccessDelegate(call.execute()); + } + + /** + * Checks if the specified access is available at the given path. + * + * @param path The Data Lake Store path (starting with '/') of the file or directory for which to check access. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall checkAccessAsync(String path, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (path == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter path is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String op = "CHECKACCESS"; + final String fsaction = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.checkAccess(path, fsaction, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(checkAccessDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Checks if the specified access is available at the given path. + * + * @param path The Data Lake Store path (starting with '/') of the file or directory for which to check access. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param fsaction File system operation read/write/execute in string form, matching regex pattern '[rwx-]{3}' + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse checkAccess(String path, String accountName, String fsaction) throws CloudException, IOException, IllegalArgumentException { + if (path == null) { + throw new IllegalArgumentException("Parameter path is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + final String op = "CHECKACCESS"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.checkAccess(path, fsaction, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return checkAccessDelegate(call.execute()); + } + + /** + * Checks if the specified access is available at the given path. + * + * @param path The Data Lake Store path (starting with '/') of the file or directory for which to check access. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param fsaction File system operation read/write/execute in string form, matching regex pattern '[rwx-]{3}' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall checkAccessAsync(String path, String accountName, String fsaction, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (path == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter path is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String op = "CHECKACCESS"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.checkAccess(path, fsaction, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(checkAccessDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse checkAccessDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Creates a directory. + * + * @param path The Data Lake Store path (starting with '/') of the directory to create. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the FileOperationResult object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse mkdirs(String path, String accountName) throws CloudException, IOException, IllegalArgumentException { + if (path == null) { + throw new IllegalArgumentException("Parameter path is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + final String op = "MKDIRS"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.mkdirs(path, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return mkdirsDelegate(call.execute()); + } + + /** + * Creates a directory. + * + * @param path The Data Lake Store path (starting with '/') of the directory to create. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall mkdirsAsync(String path, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (path == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter path is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String op = "MKDIRS"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.mkdirs(path, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(mkdirsDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse mkdirsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Concatenates the list of source files into the destination file, removing all source files upon success. + * + * @param destinationPath The Data Lake Store path (starting with '/') of the destination file resulting from the concatenation. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param sources A list of comma seperated Data Lake Store paths (starting with '/') of the files to concatenate, in the order in which they should be concatenated. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse concat(String destinationPath, String accountName, List sources) throws CloudException, IOException, IllegalArgumentException { + if (destinationPath == null) { + throw new IllegalArgumentException("Parameter destinationPath is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); + } + if (sources == null) { + throw new IllegalArgumentException("Parameter sources is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + Validator.validate(sources); + final String op = "CONCAT"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.concat(destinationPath, this.client.getMapperAdapter().serializeList(sources, CollectionFormat.CSV), op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return concatDelegate(call.execute()); + } + + /** + * Concatenates the list of source files into the destination file, removing all source files upon success. + * + * @param destinationPath The Data Lake Store path (starting with '/') of the destination file resulting from the concatenation. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param sources A list of comma seperated Data Lake Store paths (starting with '/') of the files to concatenate, in the order in which they should be concatenated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall concatAsync(String destinationPath, String accountName, List sources, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (destinationPath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter destinationPath is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); + return null; + } + if (sources == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter sources is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + Validator.validate(sources, serviceCallback); + final String op = "CONCAT"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.concat(destinationPath, this.client.getMapperAdapter().serializeList(sources, CollectionFormat.CSV), op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(concatDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse concatDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Concatenates the list of source files into the destination file, deleting all source files upon success. This method accepts more source file paths than the Concat method. This method and the parameters it accepts are subject to change for usability in an upcoming version. + * + * @param msConcatDestinationPath The Data Lake Store path (starting with '/') of the destination file resulting from the concatenation. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param streamContents A list of Data Lake Store paths (starting with '/') of the source files. Must be in the format: sources=<comma separated list> + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse msConcat(String msConcatDestinationPath, String accountName, byte[] streamContents) throws CloudException, IOException, IllegalArgumentException { + if (msConcatDestinationPath == null) { + throw new IllegalArgumentException("Parameter msConcatDestinationPath is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); + } + if (streamContents == null) { + throw new IllegalArgumentException("Parameter streamContents is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + final String op = "MSCONCAT"; + final Boolean deleteSourceDirectory = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.msConcat(msConcatDestinationPath, deleteSourceDirectory, RequestBody.create(MediaType.parse("application/octet-stream"), streamContents), op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return msConcatDelegate(call.execute()); + } + + /** + * Concatenates the list of source files into the destination file, deleting all source files upon success. This method accepts more source file paths than the Concat method. This method and the parameters it accepts are subject to change for usability in an upcoming version. + * + * @param msConcatDestinationPath The Data Lake Store path (starting with '/') of the destination file resulting from the concatenation. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param streamContents A list of Data Lake Store paths (starting with '/') of the source files. Must be in the format: sources=<comma separated list> + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall msConcatAsync(String msConcatDestinationPath, String accountName, byte[] streamContents, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (msConcatDestinationPath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter msConcatDestinationPath is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); + return null; + } + if (streamContents == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter streamContents is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String op = "MSCONCAT"; + final Boolean deleteSourceDirectory = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.msConcat(msConcatDestinationPath, deleteSourceDirectory, RequestBody.create(MediaType.parse("application/octet-stream"), streamContents), op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(msConcatDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Concatenates the list of source files into the destination file, deleting all source files upon success. This method accepts more source file paths than the Concat method. This method and the parameters it accepts are subject to change for usability in an upcoming version. + * + * @param msConcatDestinationPath The Data Lake Store path (starting with '/') of the destination file resulting from the concatenation. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param streamContents A list of Data Lake Store paths (starting with '/') of the source files. Must be in the format: sources=<comma separated list> + * @param deleteSourceDirectory Indicates that as an optimization instead of deleting each individual source stream, delete the source stream folder if all streams are in the same folder instead. This results in a substantial performance improvement when the only streams in the folder are part of the concatenation operation. WARNING: This includes the deletion of any other files that are not source files. Only set this to true when source files are the only files in the source directory. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse msConcat(String msConcatDestinationPath, String accountName, byte[] streamContents, Boolean deleteSourceDirectory) throws CloudException, IOException, IllegalArgumentException { + if (msConcatDestinationPath == null) { + throw new IllegalArgumentException("Parameter msConcatDestinationPath is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); + } + if (streamContents == null) { + throw new IllegalArgumentException("Parameter streamContents is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + final String op = "MSCONCAT"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.msConcat(msConcatDestinationPath, deleteSourceDirectory, RequestBody.create(MediaType.parse("application/octet-stream"), streamContents), op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return msConcatDelegate(call.execute()); + } + + /** + * Concatenates the list of source files into the destination file, deleting all source files upon success. This method accepts more source file paths than the Concat method. This method and the parameters it accepts are subject to change for usability in an upcoming version. + * + * @param msConcatDestinationPath The Data Lake Store path (starting with '/') of the destination file resulting from the concatenation. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param streamContents A list of Data Lake Store paths (starting with '/') of the source files. Must be in the format: sources=<comma separated list> + * @param deleteSourceDirectory Indicates that as an optimization instead of deleting each individual source stream, delete the source stream folder if all streams are in the same folder instead. This results in a substantial performance improvement when the only streams in the folder are part of the concatenation operation. WARNING: This includes the deletion of any other files that are not source files. Only set this to true when source files are the only files in the source directory. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall msConcatAsync(String msConcatDestinationPath, String accountName, byte[] streamContents, Boolean deleteSourceDirectory, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (msConcatDestinationPath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter msConcatDestinationPath is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); + return null; + } + if (streamContents == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter streamContents is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String op = "MSCONCAT"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.msConcat(msConcatDestinationPath, deleteSourceDirectory, RequestBody.create(MediaType.parse("application/octet-stream"), streamContents), op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(msConcatDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse msConcatDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Get the list of file status objects specified by the file path, with optional pagination parameters. + * + * @param listFilePath The Data Lake Store path (starting with '/') of the directory to list. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the FileStatusesResult object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse listFileStatus(String listFilePath, String accountName) throws CloudException, IOException, IllegalArgumentException { + if (listFilePath == null) { + throw new IllegalArgumentException("Parameter listFilePath is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + final String op = "LISTSTATUS"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.listFileStatus(listFilePath, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return listFileStatusDelegate(call.execute()); + } + + /** + * Get the list of file status objects specified by the file path, with optional pagination parameters. + * + * @param listFilePath The Data Lake Store path (starting with '/') of the directory to list. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall listFileStatusAsync(String listFilePath, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (listFilePath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter listFilePath is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String op = "LISTSTATUS"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.listFileStatus(listFilePath, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(listFileStatusDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse listFileStatusDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the file content summary object specified by the file path. + * + * @param getContentSummaryFilePath The Data Lake Store path (starting with '/') of the file for which to retrieve the summary. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the ContentSummaryResult object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getContentSummary(String getContentSummaryFilePath, String accountName) throws CloudException, IOException, IllegalArgumentException { + if (getContentSummaryFilePath == null) { + throw new IllegalArgumentException("Parameter getContentSummaryFilePath is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + final String op = "GETCONTENTSUMMARY"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.getContentSummary(getContentSummaryFilePath, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return getContentSummaryDelegate(call.execute()); + } + + /** + * Gets the file content summary object specified by the file path. + * + * @param getContentSummaryFilePath The Data Lake Store path (starting with '/') of the file for which to retrieve the summary. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getContentSummaryAsync(String getContentSummaryFilePath, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (getContentSummaryFilePath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter getContentSummaryFilePath is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String op = "GETCONTENTSUMMARY"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.getContentSummary(getContentSummaryFilePath, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getContentSummaryDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getContentSummaryDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the file status object specified by the file path. + * + * @param getFilePath The Data Lake Store path (starting with '/') of the file or directory for which to retrieve the status. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the FileStatusResult object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getFileStatus(String getFilePath, String accountName) throws CloudException, IOException, IllegalArgumentException { + if (getFilePath == null) { + throw new IllegalArgumentException("Parameter getFilePath is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + final String op = "GETFILESTATUS"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.getFileStatus(getFilePath, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return getFileStatusDelegate(call.execute()); + } + + /** + * Get the file status object specified by the file path. + * + * @param getFilePath The Data Lake Store path (starting with '/') of the file or directory for which to retrieve the status. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getFileStatusAsync(String getFilePath, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (getFilePath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter getFilePath is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String op = "GETFILESTATUS"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.getFileStatus(getFilePath, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getFileStatusDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getFileStatusDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Appends to the specified file. This method does not support multiple concurrent appends to the file. NOTE: Concurrent append and normal (serial) append CANNOT be used interchangeably. Once a file has been appended to using either append option, it can only be appended to using that append option. Use the ConcurrentAppend option if you would like support for concurrent appends. + * + * @param directFilePath The Data Lake Store path (starting with '/') of the file to which to append. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param streamContents The file contents to include when appending to the file. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse append(String directFilePath, String accountName, byte[] streamContents) throws CloudException, IOException, IllegalArgumentException { + if (directFilePath == null) { + throw new IllegalArgumentException("Parameter directFilePath is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); + } + if (streamContents == null) { + throw new IllegalArgumentException("Parameter streamContents is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + final String op = "APPEND"; + final String append = "true"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.append(directFilePath, RequestBody.create(MediaType.parse("application/octet-stream"), streamContents), op, append, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return appendDelegate(call.execute()); + } + + /** + * Appends to the specified file. This method does not support multiple concurrent appends to the file. NOTE: Concurrent append and normal (serial) append CANNOT be used interchangeably. Once a file has been appended to using either append option, it can only be appended to using that append option. Use the ConcurrentAppend option if you would like support for concurrent appends. + * + * @param directFilePath The Data Lake Store path (starting with '/') of the file to which to append. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param streamContents The file contents to include when appending to the file. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall appendAsync(String directFilePath, String accountName, byte[] streamContents, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (directFilePath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter directFilePath is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); + return null; + } + if (streamContents == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter streamContents is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String op = "APPEND"; + final String append = "true"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.append(directFilePath, RequestBody.create(MediaType.parse("application/octet-stream"), streamContents), op, append, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(appendDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse appendDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Creates a file with optionally specified content. + * + * @param directFilePath The Data Lake Store path (starting with '/') of the file to create. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse create(String directFilePath, String accountName) throws CloudException, IOException, IllegalArgumentException { + if (directFilePath == null) { + throw new IllegalArgumentException("Parameter directFilePath is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + final String op = "CREATE"; + final String write = "true"; + final byte[] streamContents = new byte[0]; + final Boolean overwrite = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.create(directFilePath, RequestBody.create(MediaType.parse("application/octet-stream"), streamContents), overwrite, op, write, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return createDelegate(call.execute()); + } + + /** + * Creates a file with optionally specified content. + * + * @param directFilePath The Data Lake Store path (starting with '/') of the file to create. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall createAsync(String directFilePath, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (directFilePath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter directFilePath is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String op = "CREATE"; + final String write = "true"; + final byte[] streamContents = new byte[0]; + final Boolean overwrite = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.create(directFilePath, RequestBody.create(MediaType.parse("application/octet-stream"), streamContents), overwrite, op, write, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(createDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Creates a file with optionally specified content. + * + * @param directFilePath The Data Lake Store path (starting with '/') of the file to create. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param streamContents The file contents to include when creating the file. This parameter is optional, resulting in an empty file if not specified. + * @param overwrite The indication of if the file should be overwritten. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse create(String directFilePath, String accountName, byte[] streamContents, Boolean overwrite) throws CloudException, IOException, IllegalArgumentException { + if (directFilePath == null) { + throw new IllegalArgumentException("Parameter directFilePath is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + final String op = "CREATE"; + final String write = "true"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.create(directFilePath, RequestBody.create(MediaType.parse("application/octet-stream"), streamContents), overwrite, op, write, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return createDelegate(call.execute()); + } + + /** + * Creates a file with optionally specified content. + * + * @param directFilePath The Data Lake Store path (starting with '/') of the file to create. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param streamContents The file contents to include when creating the file. This parameter is optional, resulting in an empty file if not specified. + * @param overwrite The indication of if the file should be overwritten. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall createAsync(String directFilePath, String accountName, byte[] streamContents, Boolean overwrite, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (directFilePath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter directFilePath is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String op = "CREATE"; + final String write = "true"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.create(directFilePath, RequestBody.create(MediaType.parse("application/octet-stream"), streamContents), overwrite, op, write, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(createDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse createDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(201, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Opens and reads from the specified file. + * + * @param directFilePath The Data Lake Store path (starting with '/') of the file to open. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the InputStream object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse open(String directFilePath, String accountName) throws CloudException, IOException, IllegalArgumentException { + if (directFilePath == null) { + throw new IllegalArgumentException("Parameter directFilePath is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + final String op = "OPEN"; + final String read = "true"; + final Long length = null; + final Long offset = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.open(directFilePath, length, offset, op, read, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return openDelegate(call.execute()); + } + + /** + * Opens and reads from the specified file. + * + * @param directFilePath The Data Lake Store path (starting with '/') of the file to open. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall openAsync(String directFilePath, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (directFilePath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter directFilePath is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String op = "OPEN"; + final String read = "true"; + final Long length = null; + final Long offset = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.open(directFilePath, length, offset, op, read, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(openDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Opens and reads from the specified file. + * + * @param directFilePath The Data Lake Store path (starting with '/') of the file to open. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param length the Long value + * @param offset the Long value + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the InputStream object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse open(String directFilePath, String accountName, Long length, Long offset) throws CloudException, IOException, IllegalArgumentException { + if (directFilePath == null) { + throw new IllegalArgumentException("Parameter directFilePath is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + final String op = "OPEN"; + final String read = "true"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.open(directFilePath, length, offset, op, read, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return openDelegate(call.execute()); + } + + /** + * Opens and reads from the specified file. + * + * @param directFilePath The Data Lake Store path (starting with '/') of the file to open. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param length the Long value + * @param offset the Long value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall openAsync(String directFilePath, String accountName, Long length, Long offset, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (directFilePath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter directFilePath is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String op = "OPEN"; + final String read = "true"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.open(directFilePath, length, offset, op, read, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(openDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse openDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Sets the Access Control List (ACL) for a file or folder. + * + * @param setAclFilePath The Data Lake Store path (starting with '/') of the file or directory on which to set the ACL. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param aclspec The ACL spec included in ACL creation operations in the format '[default:]user|group|other::r|-w|-x|-' + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse setAcl(String setAclFilePath, String accountName, String aclspec) throws CloudException, IOException, IllegalArgumentException { + if (setAclFilePath == null) { + throw new IllegalArgumentException("Parameter setAclFilePath is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); + } + if (aclspec == null) { + throw new IllegalArgumentException("Parameter aclspec is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + final String op = "SETACL"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.setAcl(setAclFilePath, aclspec, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return setAclDelegate(call.execute()); + } + + /** + * Sets the Access Control List (ACL) for a file or folder. + * + * @param setAclFilePath The Data Lake Store path (starting with '/') of the file or directory on which to set the ACL. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param aclspec The ACL spec included in ACL creation operations in the format '[default:]user|group|other::r|-w|-x|-' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall setAclAsync(String setAclFilePath, String accountName, String aclspec, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (setAclFilePath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter setAclFilePath is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); + return null; + } + if (aclspec == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter aclspec is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String op = "SETACL"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.setAcl(setAclFilePath, aclspec, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(setAclDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse setAclDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Modifies existing Access Control List (ACL) entries on a file or folder. + * + * @param modifyAclFilePath The Data Lake Store path (starting with '/') of the file or directory with the ACL being modified. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param aclspec The ACL specification included in ACL modification operations in the format '[default:]user|group|other::r|-w|-x|-' + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse modifyAclEntries(String modifyAclFilePath, String accountName, String aclspec) throws CloudException, IOException, IllegalArgumentException { + if (modifyAclFilePath == null) { + throw new IllegalArgumentException("Parameter modifyAclFilePath is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); + } + if (aclspec == null) { + throw new IllegalArgumentException("Parameter aclspec is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + final String op = "MODIFYACLENTRIES"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.modifyAclEntries(modifyAclFilePath, aclspec, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return modifyAclEntriesDelegate(call.execute()); + } + + /** + * Modifies existing Access Control List (ACL) entries on a file or folder. + * + * @param modifyAclFilePath The Data Lake Store path (starting with '/') of the file or directory with the ACL being modified. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param aclspec The ACL specification included in ACL modification operations in the format '[default:]user|group|other::r|-w|-x|-' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall modifyAclEntriesAsync(String modifyAclFilePath, String accountName, String aclspec, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (modifyAclFilePath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter modifyAclFilePath is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); + return null; + } + if (aclspec == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter aclspec is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String op = "MODIFYACLENTRIES"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.modifyAclEntries(modifyAclFilePath, aclspec, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(modifyAclEntriesDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse modifyAclEntriesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Removes existing Access Control List (ACL) entries for a file or folder. + * + * @param removeAclFilePath The Data Lake Store path (starting with '/') of the file or directory with the ACL being removed. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param aclspec The ACL spec included in ACL removal operations in the format '[default:]user|group|other' + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse removeAclEntries(String removeAclFilePath, String accountName, String aclspec) throws CloudException, IOException, IllegalArgumentException { + if (removeAclFilePath == null) { + throw new IllegalArgumentException("Parameter removeAclFilePath is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); + } + if (aclspec == null) { + throw new IllegalArgumentException("Parameter aclspec is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + final String op = "REMOVEACLENTRIES"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.removeAclEntries(removeAclFilePath, aclspec, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return removeAclEntriesDelegate(call.execute()); + } + + /** + * Removes existing Access Control List (ACL) entries for a file or folder. + * + * @param removeAclFilePath The Data Lake Store path (starting with '/') of the file or directory with the ACL being removed. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param aclspec The ACL spec included in ACL removal operations in the format '[default:]user|group|other' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall removeAclEntriesAsync(String removeAclFilePath, String accountName, String aclspec, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (removeAclFilePath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter removeAclFilePath is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); + return null; + } + if (aclspec == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter aclspec is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String op = "REMOVEACLENTRIES"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.removeAclEntries(removeAclFilePath, aclspec, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(removeAclEntriesDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse removeAclEntriesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Removes the existing Access Control List (ACL) of the specified file or directory. + * + * @param aclFilePath The Data Lake Store path (starting with '/') of the file or directory with the ACL being removed. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse removeAcl(String aclFilePath, String accountName) throws CloudException, IOException, IllegalArgumentException { + if (aclFilePath == null) { + throw new IllegalArgumentException("Parameter aclFilePath is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + final String op = "REMOVEACL"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.removeAcl(aclFilePath, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return removeAclDelegate(call.execute()); + } + + /** + * Removes the existing Access Control List (ACL) of the specified file or directory. + * + * @param aclFilePath The Data Lake Store path (starting with '/') of the file or directory with the ACL being removed. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall removeAclAsync(String aclFilePath, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (aclFilePath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter aclFilePath is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String op = "REMOVEACL"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.removeAcl(aclFilePath, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(removeAclDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse removeAclDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Gets Access Control List (ACL) entries for the specified file or directory. + * + * @param aclFilePath The Data Lake Store path (starting with '/') of the file or directory for which to get the ACL. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the AclStatusResult object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getAclStatus(String aclFilePath, String accountName) throws CloudException, IOException, IllegalArgumentException { + if (aclFilePath == null) { + throw new IllegalArgumentException("Parameter aclFilePath is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + final String op = "GETACLSTATUS"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.getAclStatus(aclFilePath, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return getAclStatusDelegate(call.execute()); + } + + /** + * Gets Access Control List (ACL) entries for the specified file or directory. + * + * @param aclFilePath The Data Lake Store path (starting with '/') of the file or directory for which to get the ACL. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getAclStatusAsync(String aclFilePath, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (aclFilePath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter aclFilePath is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String op = "GETACLSTATUS"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.getAclStatus(aclFilePath, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getAclStatusDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getAclStatusDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the requested file or directory, optionally recursively. + * + * @param filePath The Data Lake Store path (starting with '/') of the file or directory to delete. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the FileOperationResult object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse delete(String filePath, String accountName) throws CloudException, IOException, IllegalArgumentException { + if (filePath == null) { + throw new IllegalArgumentException("Parameter filePath is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + final String op = "DELETE"; + final Boolean recursive = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.delete(filePath, recursive, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return deleteDelegate(call.execute()); + } + + /** + * Deletes the requested file or directory, optionally recursively. + * + * @param filePath The Data Lake Store path (starting with '/') of the file or directory to delete. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall deleteAsync(String filePath, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (filePath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter filePath is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String op = "DELETE"; + final Boolean recursive = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.delete(filePath, recursive, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(deleteDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Deletes the requested file or directory, optionally recursively. + * + * @param filePath The Data Lake Store path (starting with '/') of the file or directory to delete. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param recursive The optional switch indicating if the delete should be recursive + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the FileOperationResult object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse delete(String filePath, String accountName, Boolean recursive) throws CloudException, IOException, IllegalArgumentException { + if (filePath == null) { + throw new IllegalArgumentException("Parameter filePath is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + final String op = "DELETE"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.delete(filePath, recursive, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return deleteDelegate(call.execute()); + } + + /** + * Deletes the requested file or directory, optionally recursively. + * + * @param filePath The Data Lake Store path (starting with '/') of the file or directory to delete. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param recursive The optional switch indicating if the delete should be recursive + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall deleteAsync(String filePath, String accountName, Boolean recursive, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (filePath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter filePath is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String op = "DELETE"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.delete(filePath, recursive, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(deleteDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Rename a file or directory. + * + * @param renameFilePath The Data Lake Store path (starting with '/') of the file or directory to move/rename. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param destination The path to move/rename the file or folder to + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the FileOperationResult object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse rename(String renameFilePath, String accountName, String destination) throws CloudException, IOException, IllegalArgumentException { + if (renameFilePath == null) { + throw new IllegalArgumentException("Parameter renameFilePath is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); + } + if (destination == null) { + throw new IllegalArgumentException("Parameter destination is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + final String op = "RENAME"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.rename(renameFilePath, destination, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return renameDelegate(call.execute()); + } + + /** + * Rename a file or directory. + * + * @param renameFilePath The Data Lake Store path (starting with '/') of the file or directory to move/rename. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param destination The path to move/rename the file or folder to + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall renameAsync(String renameFilePath, String accountName, String destination, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (renameFilePath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter renameFilePath is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); + return null; + } + if (destination == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter destination is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String op = "RENAME"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.rename(renameFilePath, destination, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(renameDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse renameDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Sets the owner of a file or directory. + * + * @param setOwnerFilePath The Data Lake Store path (starting with '/') of the file or directory for which to set the owner. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse setOwner(String setOwnerFilePath, String accountName) throws CloudException, IOException, IllegalArgumentException { + if (setOwnerFilePath == null) { + throw new IllegalArgumentException("Parameter setOwnerFilePath is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + final String op = "SETOWNER"; + final String owner = null; + final String group = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.setOwner(setOwnerFilePath, owner, group, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return setOwnerDelegate(call.execute()); + } + + /** + * Sets the owner of a file or directory. + * + * @param setOwnerFilePath The Data Lake Store path (starting with '/') of the file or directory for which to set the owner. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall setOwnerAsync(String setOwnerFilePath, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (setOwnerFilePath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter setOwnerFilePath is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String op = "SETOWNER"; + final String owner = null; + final String group = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.setOwner(setOwnerFilePath, owner, group, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(setOwnerDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Sets the owner of a file or directory. + * + * @param setOwnerFilePath The Data Lake Store path (starting with '/') of the file or directory for which to set the owner. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param owner The AAD Object ID of the user owner of the file or directory. If empty, the property will remain unchanged. + * @param group The AAD Object ID of the group owner of the file or directory. If empty, the property will remain unchanged. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse setOwner(String setOwnerFilePath, String accountName, String owner, String group) throws CloudException, IOException, IllegalArgumentException { + if (setOwnerFilePath == null) { + throw new IllegalArgumentException("Parameter setOwnerFilePath is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + final String op = "SETOWNER"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.setOwner(setOwnerFilePath, owner, group, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return setOwnerDelegate(call.execute()); + } + + /** + * Sets the owner of a file or directory. + * + * @param setOwnerFilePath The Data Lake Store path (starting with '/') of the file or directory for which to set the owner. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param owner The AAD Object ID of the user owner of the file or directory. If empty, the property will remain unchanged. + * @param group The AAD Object ID of the group owner of the file or directory. If empty, the property will remain unchanged. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall setOwnerAsync(String setOwnerFilePath, String accountName, String owner, String group, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (setOwnerFilePath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter setOwnerFilePath is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String op = "SETOWNER"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.setOwner(setOwnerFilePath, owner, group, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(setOwnerDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse setOwnerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Sets the permission of the file or folder. + * + * @param setPermissionFilePath The Data Lake Store path (starting with '/') of the file or directory for which to set the permission. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse setPermission(String setPermissionFilePath, String accountName) throws CloudException, IOException, IllegalArgumentException { + if (setPermissionFilePath == null) { + throw new IllegalArgumentException("Parameter setPermissionFilePath is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + final String op = "SETPERMISSION"; + final String permission = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.setPermission(setPermissionFilePath, permission, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return setPermissionDelegate(call.execute()); + } + + /** + * Sets the permission of the file or folder. + * + * @param setPermissionFilePath The Data Lake Store path (starting with '/') of the file or directory for which to set the permission. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall setPermissionAsync(String setPermissionFilePath, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (setPermissionFilePath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter setPermissionFilePath is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String op = "SETPERMISSION"; + final String permission = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.setPermission(setPermissionFilePath, permission, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(setPermissionDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Sets the permission of the file or folder. + * + * @param setPermissionFilePath The Data Lake Store path (starting with '/') of the file or directory for which to set the permission. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param permission A string representation of the permission (i.e 'rwx'). If empty, this property remains unchanged. + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse setPermission(String setPermissionFilePath, String accountName, String permission) throws CloudException, IOException, IllegalArgumentException { + if (setPermissionFilePath == null) { + throw new IllegalArgumentException("Parameter setPermissionFilePath is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); + } + if (this.client.getApiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + final String op = "SETPERMISSION"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.setPermission(setPermissionFilePath, permission, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return setPermissionDelegate(call.execute()); + } + + /** + * Sets the permission of the file or folder. + * + * @param setPermissionFilePath The Data Lake Store path (starting with '/') of the file or directory for which to set the permission. + * @param accountName The Azure Data Lake Store account to execute filesystem operations on. + * @param permission A string representation of the permission (i.e 'rwx'). If empty, this property remains unchanged. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall setPermissionAsync(String setPermissionFilePath, String accountName, String permission, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (setPermissionFilePath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter setPermissionFilePath is required and cannot be null.")); + return null; + } + if (accountName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + return null; + } + if (this.client.getAdlsFileSystemDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); + return null; + } + if (this.client.getApiVersion() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String op = "SETPERMISSION"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.setPermission(setPermissionFilePath, permission, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(setPermissionDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse setPermissionDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .build(response); + } + +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/AclStatus.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/AclStatus.java new file mode 100644 index 000000000000..1badfac52978 --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/AclStatus.java @@ -0,0 +1,111 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store.models; + +import java.util.List; + +/** + * Data Lake Store file or directory Access Control List information. + */ +public class AclStatus { + /** + * Gets or sets the list of ACLSpec entries on a file or directory. + */ + private List entries; + + /** + * Gets or sets the group owner, an AAD Object ID. + */ + private String group; + + /** + * Gets or sets the user owner, an AAD Object ID. + */ + private String owner; + + /** + * Gets or sets the indicator of whether the sticky bit is on or off. + */ + private Boolean stickyBit; + + /** + * Get the entries value. + * + * @return the entries value + */ + public List getEntries() { + return this.entries; + } + + /** + * Set the entries value. + * + * @param entries the entries value to set + */ + public void setEntries(List entries) { + this.entries = entries; + } + + /** + * Get the group value. + * + * @return the group value + */ + public String getGroup() { + return this.group; + } + + /** + * Set the group value. + * + * @param group the group value to set + */ + public void setGroup(String group) { + this.group = group; + } + + /** + * Get the owner value. + * + * @return the owner value + */ + public String getOwner() { + return this.owner; + } + + /** + * Set the owner value. + * + * @param owner the owner value to set + */ + public void setOwner(String owner) { + this.owner = owner; + } + + /** + * Get the stickyBit value. + * + * @return the stickyBit value + */ + public Boolean getStickyBit() { + return this.stickyBit; + } + + /** + * Set the stickyBit value. + * + * @param stickyBit the stickyBit value to set + */ + public void setStickyBit(Boolean stickyBit) { + this.stickyBit = stickyBit; + } + +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/AclStatusResult.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/AclStatusResult.java new file mode 100644 index 000000000000..515fa8bbe01e --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/AclStatusResult.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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data Lake Store file or directory Access Control List information. + */ +public class AclStatusResult { + /** + * Gets or sets the AclStatus object for a given file or directory. + */ + @JsonProperty(value = "AclStatus") + private AclStatus aclStatus; + + /** + * Get the aclStatus value. + * + * @return the aclStatus value + */ + public AclStatus getAclStatus() { + return this.aclStatus; + } + + /** + * Set the aclStatus value. + * + * @param aclStatus the aclStatus value to set + */ + public void setAclStatus(AclStatus aclStatus) { + this.aclStatus = aclStatus; + } + +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/AppendModeType.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/AppendModeType.java new file mode 100644 index 000000000000..0e41bddf2741 --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/AppendModeType.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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AppendModeType. + */ +public enum AppendModeType { + /** Enum value autocreate. */ + AUTOCREATE("autocreate"); + + /** The actual serialized value for a AppendModeType instance. */ + private String value; + + AppendModeType(String value) { + this.value = value; + } + + /** + * Gets the serialized value for a AppendModeType instance. + * + * @return the serialized value. + */ + @JsonValue + public String toValue() { + return this.value; + } + + /** + * Parses a serialized value to a AppendModeType instance. + * + * @param value the serialized value to parse. + * @return the parsed AppendModeType object, or null if unable to parse. + */ + @JsonCreator + public static AppendModeType fromValue(String value) { + AppendModeType[] items = AppendModeType.values(); + for (AppendModeType item : items) { + if (item.toValue().equals(value)) { + return item; + } + } + return null; + } +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/AzureAsyncOperationResult.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/AzureAsyncOperationResult.java new file mode 100644 index 000000000000..e49ce41bfceb --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/AzureAsyncOperationResult.java @@ -0,0 +1,57 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response body contains the status of the specified asynchronous + * operation, indicating whether it has succeeded, is in progress, or has + * failed. Note that this status is distinct from the HTTP status code + * returned for the Get Operation Status operation itself. If the + * asynchronous operation succeeded, the response body includes the HTTP + * status code for the successful request. If the asynchronous operation + * failed, the response body includes the HTTP status code for the failed + * request and error information regarding the failure. + */ +public class AzureAsyncOperationResult { + /** + * Gets the status of the AzureAsuncOperation. Possible values include: + * 'InProgress', 'Succeeded', 'Failed'. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private OperationStatus status; + + /** + * The error property. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Error error; + + /** + * Get the status value. + * + * @return the status value + */ + public OperationStatus getStatus() { + return this.status; + } + + /** + * Get the error value. + * + * @return the error value + */ + public Error getError() { + return this.error; + } + +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/ContentSummary.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/ContentSummary.java new file mode 100644 index 000000000000..cbdb67455991 --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/ContentSummary.java @@ -0,0 +1,79 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data Lake Store content summary information. + */ +public class ContentSummary { + /** + * Gets the number of directories. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Long directoryCount; + + /** + * Gets the number of files. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Long fileCount; + + /** + * Gets the number of bytes used by the contet. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Long length; + + /** + * Gets the disk space consumed by the content. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Long spaceConsumed; + + /** + * Get the directoryCount value. + * + * @return the directoryCount value + */ + public Long getDirectoryCount() { + return this.directoryCount; + } + + /** + * Get the fileCount value. + * + * @return the fileCount value + */ + public Long getFileCount() { + return this.fileCount; + } + + /** + * Get the length value. + * + * @return the length value + */ + public Long getLength() { + return this.length; + } + + /** + * Get the spaceConsumed value. + * + * @return the spaceConsumed value + */ + public Long getSpaceConsumed() { + return this.spaceConsumed; + } + +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/ContentSummaryResult.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/ContentSummaryResult.java new file mode 100644 index 000000000000..27378b753851 --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/ContentSummaryResult.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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data Lake Store filesystem content summary information response. + */ +public class ContentSummaryResult { + /** + * Gets the content summary for the specified path. + */ + @JsonProperty(value = "ContentSummary", access = JsonProperty.Access.WRITE_ONLY) + private ContentSummary contentSummary; + + /** + * Get the contentSummary value. + * + * @return the contentSummary value + */ + public ContentSummary getContentSummary() { + return this.contentSummary; + } + +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/DataLakeStoreAccount.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/DataLakeStoreAccount.java new file mode 100644 index 000000000000..251be733d495 --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/DataLakeStoreAccount.java @@ -0,0 +1,142 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * Data Lake Store account information. + */ +public class DataLakeStoreAccount { + /** + * Gets or sets the account regional location. + */ + private String location; + + /** + * Gets or sets the account name. + */ + private String name; + + /** + * Gets the namespace and type of the account. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Gets the account subscription ID. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Gets or sets the value of custom properties. + */ + private Map tags; + + /** + * Gets or sets the Data Lake Store account properties. + */ + private DataLakeStoreAccountProperties properties; + + /** + * Get the location value. + * + * @return the location value + */ + public String getLocation() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + */ + public void setLocation(String location) { + this.location = location; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String getName() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * Get the type value. + * + * @return the type value + */ + public String getType() { + return this.type; + } + + /** + * Get the id value. + * + * @return the id value + */ + public String getId() { + return this.id; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map getTags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + */ + public void setTags(Map tags) { + this.tags = tags; + } + + /** + * Get the properties value. + * + * @return the properties value + */ + public DataLakeStoreAccountProperties getProperties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + */ + public void setProperties(DataLakeStoreAccountProperties properties) { + this.properties = properties; + } + +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/DataLakeStoreAccountProperties.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/DataLakeStoreAccountProperties.java new file mode 100644 index 000000000000..9faadc8a785a --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/DataLakeStoreAccountProperties.java @@ -0,0 +1,130 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import org.joda.time.DateTime; + +/** + * Data Lake Store account properties information. + */ +public class DataLakeStoreAccountProperties { + /** + * Gets the status of the Data Lake Store account while being provisioned. + * Possible values include: 'Failed', 'Creating', 'Running', 'Succeeded', + * 'Patching', 'Suspending', 'Resuming', 'Deleting', 'Deleted'. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private DataLakeStoreAccountStatus provisioningState; + + /** + * Gets the status of the Data Lake Store account after provisioning has + * completed. Possible values include: 'active', 'suspended'. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private DataLakeStoreAccountState state; + + /** + * Gets the account creation time. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationTime; + + /** + * Gets the account last modified time. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModifiedTime; + + /** + * Gets or sets the gateway host. + */ + private String endpoint; + + /** + * Gets or sets the default owner group for all new folders and files + * created in the Data Lake Store account. + */ + private String defaultGroup; + + /** + * Get the provisioningState value. + * + * @return the provisioningState value + */ + public DataLakeStoreAccountStatus getProvisioningState() { + return this.provisioningState; + } + + /** + * Get the state value. + * + * @return the state value + */ + public DataLakeStoreAccountState getState() { + return this.state; + } + + /** + * Get the creationTime value. + * + * @return the creationTime value + */ + public DateTime getCreationTime() { + return this.creationTime; + } + + /** + * Get the lastModifiedTime value. + * + * @return the lastModifiedTime value + */ + public DateTime getLastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the endpoint value. + * + * @return the endpoint value + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Set the endpoint value. + * + * @param endpoint the endpoint value to set + */ + public void setEndpoint(String endpoint) { + this.endpoint = endpoint; + } + + /** + * Get the defaultGroup value. + * + * @return the defaultGroup value + */ + public String getDefaultGroup() { + return this.defaultGroup; + } + + /** + * Set the defaultGroup value. + * + * @param defaultGroup the defaultGroup value to set + */ + public void setDefaultGroup(String defaultGroup) { + this.defaultGroup = defaultGroup; + } + +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/DataLakeStoreAccountState.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/DataLakeStoreAccountState.java new file mode 100644 index 000000000000..2df7cb8fc212 --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/DataLakeStoreAccountState.java @@ -0,0 +1,59 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DataLakeStoreAccountState. + */ +public enum DataLakeStoreAccountState { + /** Enum value active. */ + ACTIVE("active"), + + /** Enum value suspended. */ + SUSPENDED("suspended"); + + /** The actual serialized value for a DataLakeStoreAccountState instance. */ + private String value; + + DataLakeStoreAccountState(String value) { + this.value = value; + } + + /** + * Gets the serialized value for a DataLakeStoreAccountState instance. + * + * @return the serialized value. + */ + @JsonValue + public String toValue() { + return this.value; + } + + /** + * Parses a serialized value to a DataLakeStoreAccountState instance. + * + * @param value the serialized value to parse. + * @return the parsed DataLakeStoreAccountState object, or null if unable to parse. + */ + @JsonCreator + public static DataLakeStoreAccountState fromValue(String value) { + DataLakeStoreAccountState[] items = DataLakeStoreAccountState.values(); + for (DataLakeStoreAccountState item : items) { + if (item.toValue().equals(value)) { + return item; + } + } + return null; + } +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/DataLakeStoreAccountStatus.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/DataLakeStoreAccountStatus.java new file mode 100644 index 000000000000..dcc09b2976c2 --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/DataLakeStoreAccountStatus.java @@ -0,0 +1,80 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DataLakeStoreAccountStatus. + */ +public enum DataLakeStoreAccountStatus { + /** Enum value Failed. */ + FAILED("Failed"), + + /** Enum value Creating. */ + CREATING("Creating"), + + /** Enum value Running. */ + RUNNING("Running"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Patching. */ + PATCHING("Patching"), + + /** Enum value Suspending. */ + SUSPENDING("Suspending"), + + /** Enum value Resuming. */ + RESUMING("Resuming"), + + /** Enum value Deleting. */ + DELETING("Deleting"), + + /** Enum value Deleted. */ + DELETED("Deleted"); + + /** The actual serialized value for a DataLakeStoreAccountStatus instance. */ + private String value; + + DataLakeStoreAccountStatus(String value) { + this.value = value; + } + + /** + * Gets the serialized value for a DataLakeStoreAccountStatus instance. + * + * @return the serialized value. + */ + @JsonValue + public String toValue() { + return this.value; + } + + /** + * Parses a serialized value to a DataLakeStoreAccountStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed DataLakeStoreAccountStatus object, or null if unable to parse. + */ + @JsonCreator + public static DataLakeStoreAccountStatus fromValue(String value) { + DataLakeStoreAccountStatus[] items = DataLakeStoreAccountStatus.values(); + for (DataLakeStoreAccountStatus item : items) { + if (item.toValue().equals(value)) { + return item; + } + } + return null; + } +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/Error.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/Error.java new file mode 100644 index 000000000000..03d61ddc2508 --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/Error.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Data Lake Store error information. + */ +public class Error { + /** + * Gets the HTTP status code or error code associated with this error. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * Gets the error message to display. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Gets the target of the error. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /** + * Gets the list of error details. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /** + * Gets the inner exceptions or errors, if any. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private InnerError innerError; + + /** + * Get the code value. + * + * @return the code value + */ + public String getCode() { + return this.code; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String getMessage() { + return this.message; + } + + /** + * Get the target value. + * + * @return the target value + */ + public String getTarget() { + return this.target; + } + + /** + * Get the details value. + * + * @return the details value + */ + public List getDetails() { + return this.details; + } + + /** + * Get the innerError value. + * + * @return the innerError value + */ + public InnerError getInnerError() { + return this.innerError; + } + +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/ErrorDetails.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/ErrorDetails.java new file mode 100644 index 000000000000..c6fefe0dd6e1 --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/ErrorDetails.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data Lake Store error details information. + */ +public class ErrorDetails { + /** + * Gets the HTTP status code or error code associated with this error. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * Gets the error message localized based on Accept-Language. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Gets the target of the particular error (for example, the name of the + * property in error). + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /** + * Get the code value. + * + * @return the code value + */ + public String getCode() { + return this.code; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String getMessage() { + return this.message; + } + + /** + * Get the target value. + * + * @return the target value + */ + public String getTarget() { + return this.target; + } + +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FileOperationResult.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FileOperationResult.java new file mode 100644 index 000000000000..593a7245e2ea --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FileOperationResult.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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result of the request or operation. + */ +public class FileOperationResult { + /** + * Gets the result of the operation or request. + */ + @JsonProperty(value = "boolean", access = JsonProperty.Access.WRITE_ONLY) + private Boolean operationResult; + + /** + * Get the operationResult value. + * + * @return the operationResult value + */ + public Boolean getOperationResult() { + return this.operationResult; + } + +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FileStatusProperties.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FileStatusProperties.java new file mode 100644 index 000000000000..084b97c892c2 --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FileStatusProperties.java @@ -0,0 +1,170 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data Lake Store file or directory information. + */ +public class FileStatusProperties { + /** + * Gets the last access time as ticks since the epoch. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Long accessTime; + + /** + * Gets the block size for the file. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Long blockSize; + + /** + * Gets the number of children in the directory. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Long childrenNum; + + /** + * Gets the group owner. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String group; + + /** + * Gets the number of bytes in a file. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Long length; + + /** + * Gets the modification time as ticks since the epoch. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Long modificationTime; + + /** + * Gets the user who is the owner. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String owner; + + /** + * Gets the path suffix. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String pathSuffix; + + /** + * Gets the permission represented as an string. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String permission; + + /** + * Gets the type of the path object. Possible values include: 'FILE', + * 'DIRECTORY'. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private FileType type; + + /** + * Get the accessTime value. + * + * @return the accessTime value + */ + public Long getAccessTime() { + return this.accessTime; + } + + /** + * Get the blockSize value. + * + * @return the blockSize value + */ + public Long getBlockSize() { + return this.blockSize; + } + + /** + * Get the childrenNum value. + * + * @return the childrenNum value + */ + public Long getChildrenNum() { + return this.childrenNum; + } + + /** + * Get the group value. + * + * @return the group value + */ + public String getGroup() { + return this.group; + } + + /** + * Get the length value. + * + * @return the length value + */ + public Long getLength() { + return this.length; + } + + /** + * Get the modificationTime value. + * + * @return the modificationTime value + */ + public Long getModificationTime() { + return this.modificationTime; + } + + /** + * Get the owner value. + * + * @return the owner value + */ + public String getOwner() { + return this.owner; + } + + /** + * Get the pathSuffix value. + * + * @return the pathSuffix value + */ + public String getPathSuffix() { + return this.pathSuffix; + } + + /** + * Get the permission value. + * + * @return the permission value + */ + public String getPermission() { + return this.permission; + } + + /** + * Get the type value. + * + * @return the type value + */ + public FileType getType() { + return this.type; + } + +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FileStatusResult.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FileStatusResult.java new file mode 100644 index 000000000000..d7944d2ad8c8 --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FileStatusResult.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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data Lake Store filesystem file status information response. + */ +public class FileStatusResult { + /** + * Gets the file status object associated with the specified path. + */ + @JsonProperty(value = "FileStatus", access = JsonProperty.Access.WRITE_ONLY) + private FileStatusProperties fileStatus; + + /** + * Get the fileStatus value. + * + * @return the fileStatus value + */ + public FileStatusProperties getFileStatus() { + return this.fileStatus; + } + +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FileStatuses.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FileStatuses.java new file mode 100644 index 000000000000..82d711bee09e --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FileStatuses.java @@ -0,0 +1,35 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data Lake Store file status list information. + */ +public class FileStatuses { + /** + * Gets the object containing the list of properties of the files. + */ + @JsonProperty(value = "FileStatus", access = JsonProperty.Access.WRITE_ONLY) + private List fileStatus; + + /** + * Get the fileStatus value. + * + * @return the fileStatus value + */ + public List getFileStatus() { + return this.fileStatus; + } + +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FileStatusesResult.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FileStatusesResult.java new file mode 100644 index 000000000000..20fb9a65dd73 --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FileStatusesResult.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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data Lake Store filesystem file status list information response. + */ +public class FileStatusesResult { + /** + * Gets the object representing the list of file statuses. + */ + @JsonProperty(value = "FileStatuses", access = JsonProperty.Access.WRITE_ONLY) + private FileStatuses fileStatuses; + + /** + * Get the fileStatuses value. + * + * @return the fileStatuses value + */ + public FileStatuses getFileStatuses() { + return this.fileStatuses; + } + +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FileType.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FileType.java new file mode 100644 index 000000000000..5892f4840a9c --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FileType.java @@ -0,0 +1,59 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for FileType. + */ +public enum FileType { + /** Enum value FILE. */ + FILE("FILE"), + + /** Enum value DIRECTORY. */ + DIRECTORY("DIRECTORY"); + + /** The actual serialized value for a FileType instance. */ + private String value; + + FileType(String value) { + this.value = value; + } + + /** + * Gets the serialized value for a FileType instance. + * + * @return the serialized value. + */ + @JsonValue + public String toValue() { + return this.value; + } + + /** + * Parses a serialized value to a FileType instance. + * + * @param value the serialized value to parse. + * @return the parsed FileType object, or null if unable to parse. + */ + @JsonCreator + public static FileType fromValue(String value) { + FileType[] items = FileType.values(); + for (FileType item : items) { + if (item.toValue().equals(value)) { + return item; + } + } + return null; + } +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FirewallRule.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FirewallRule.java new file mode 100644 index 000000000000..de6f2ba79c20 --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FirewallRule.java @@ -0,0 +1,126 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data Lake Store firewall rule information. + */ +public class FirewallRule { + /** + * Gets or sets the firewall rule's name. + */ + private String name; + + /** + * Gets the namespace and type of the firewall Rule. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Gets or sets the firewall rule's subscription ID. + */ + private String id; + + /** + * Gets or sets the firewall rule's regional location. + */ + private String location; + + /** + * Gets or sets the properties of the firewall rule. + */ + private FirewallRuleProperties properties; + + /** + * Get the name value. + * + * @return the name value + */ + public String getName() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * Get the type value. + * + * @return the type value + */ + public String getType() { + return this.type; + } + + /** + * Get the id value. + * + * @return the id value + */ + public String getId() { + return this.id; + } + + /** + * Set the id value. + * + * @param id the id value to set + */ + public void setId(String id) { + this.id = id; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String getLocation() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + */ + public void setLocation(String location) { + this.location = location; + } + + /** + * Get the properties value. + * + * @return the properties value + */ + public FirewallRuleProperties getProperties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + */ + public void setProperties(FirewallRuleProperties properties) { + this.properties = properties; + } + +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FirewallRuleProperties.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FirewallRuleProperties.java new file mode 100644 index 000000000000..e0c803551a48 --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FirewallRuleProperties.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store.models; + + +/** + * Data Lake Store firewall rule properties information. + */ +public class FirewallRuleProperties { + /** + * Gets or sets the start IP address for the firewall rule. + */ + private String startIpAddress; + + /** + * Gets or sets the end IP address for the firewall rule. + */ + private String endIpAddress; + + /** + * Get the startIpAddress value. + * + * @return the startIpAddress value + */ + public String getStartIpAddress() { + return this.startIpAddress; + } + + /** + * Set the startIpAddress value. + * + * @param startIpAddress the startIpAddress value to set + */ + public void setStartIpAddress(String startIpAddress) { + this.startIpAddress = startIpAddress; + } + + /** + * Get the endIpAddress value. + * + * @return the endIpAddress value + */ + public String getEndIpAddress() { + return this.endIpAddress; + } + + /** + * Set the endIpAddress value. + * + * @param endIpAddress the endIpAddress value to set + */ + public void setEndIpAddress(String endIpAddress) { + this.endIpAddress = endIpAddress; + } + +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/InnerError.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/InnerError.java new file mode 100644 index 000000000000..ee24c8e1a97f --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/InnerError.java @@ -0,0 +1,49 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data Lake Store inner error information. + */ +public class InnerError { + /** + * Gets the stack trace for the error. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String trace; + + /** + * Gets the context for the error message. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String context; + + /** + * Get the trace value. + * + * @return the trace value + */ + public String getTrace() { + return this.trace; + } + + /** + * Get the context value. + * + * @return the context value + */ + public String getContext() { + return this.context; + } + +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/OperationStatus.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/OperationStatus.java new file mode 100644 index 000000000000..f2c30ff221cb --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/OperationStatus.java @@ -0,0 +1,62 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for OperationStatus. + */ +public enum OperationStatus { + /** Enum value InProgress. */ + INPROGRESS("InProgress"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Failed. */ + FAILED("Failed"); + + /** The actual serialized value for a OperationStatus instance. */ + private String value; + + OperationStatus(String value) { + this.value = value; + } + + /** + * Gets the serialized value for a OperationStatus instance. + * + * @return the serialized value. + */ + @JsonValue + public String toValue() { + return this.value; + } + + /** + * Parses a serialized value to a OperationStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed OperationStatus object, or null if unable to parse. + */ + @JsonCreator + public static OperationStatus fromValue(String value) { + OperationStatus[] items = OperationStatus.values(); + for (OperationStatus item : items) { + if (item.toValue().equals(value)) { + return item; + } + } + return null; + } +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/PageImpl.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/PageImpl.java new file mode 100644 index 000000000000..bed78cd9d173 --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/PageImpl.java @@ -0,0 +1,55 @@ +/** + * 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 0.16.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.datalake.store.models; + +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 getNextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List getItems() { + return items; + } +} diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/package-info.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/package-info.java new file mode 100644 index 000000000000..7648d07efee1 --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/package-info.java @@ -0,0 +1,13 @@ +// 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 0.16.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the model classes for DataLakeStoreFileSystemManagementClient. + * Creates an Azure Data Lake Store filesystem client. + */ +package com.microsoft.azure.management.datalake.store.models; diff --git a/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/package-info.java b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/package-info.java new file mode 100644 index 000000000000..25b7396aaccd --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/package-info.java @@ -0,0 +1,13 @@ +// 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 0.16.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for DataLakeStoreFileSystemManagementClient. + * Creates an Azure Data Lake Store filesystem client. + */ +package com.microsoft.azure.management.datalake.store; diff --git a/azure-mgmt-datalake-store/src/test/java/com/microsoft/azure/management/datalake/store/DataLakeStoreAccountOperationsTests.java b/azure-mgmt-datalake-store/src/test/java/com/microsoft/azure/management/datalake/store/DataLakeStoreAccountOperationsTests.java new file mode 100644 index 000000000000..0642eb183fcf --- /dev/null +++ b/azure-mgmt-datalake-store/src/test/java/com/microsoft/azure/management/datalake/store/DataLakeStoreAccountOperationsTests.java @@ -0,0 +1,121 @@ +package com.microsoft.azure.management.datalake.store; + +import com.microsoft.azure.management.datalake.store.models.DataLakeStoreAccount; +import com.microsoft.azure.management.datalake.store.models.DataLakeStoreAccountProperties; +import com.microsoft.azure.management.resources.models.ResourceGroup; + +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +public class DataLakeStoreAccountOperationsTests extends DataLakeStoreManagementTestBase { + private static String rgName = generateName("javaadlsrg"); + private static String location = "eastus2"; + private static String adlsAcct = generateName("javaadlsacct"); + + @BeforeClass + public static void setup() throws Exception { + createClients(); + ResourceGroup group = new ResourceGroup(); + group.setLocation(location); + resourceManagementClient.getResourceGroupsOperations().createOrUpdate(rgName, group); + } + + @AfterClass + public static void cleanup() throws Exception { + try { + resourceManagementClient.getResourceGroupsOperations().delete(rgName); + } + catch (Exception e) { + // ignore failures during cleanup, as it is best effort + } + } + @Test + public void canCreateGetUpdateDeleteAdlsAccount() throws Exception { + // Create + DataLakeStoreAccountProperties createProperties = new DataLakeStoreAccountProperties(); + + DataLakeStoreAccount createParams = new DataLakeStoreAccount(); + createParams.setLocation(location); + createParams.setName(adlsAcct); + createParams.setProperties(createProperties); + createParams.setTags(new HashMap()); + createParams.getTags().put("testkey", "testvalue"); + + DataLakeStoreAccount createResponse = dataLakeStoreAccountManagementClient.getAccountOperations().create(rgName, adlsAcct, createParams).getBody(); + Assert.assertEquals(location, createResponse.getLocation()); + Assert.assertEquals("Microsoft.DataLakeStore/accounts", createResponse.getType()); + Assert.assertNotNull(createResponse.getId()); + Assert.assertTrue(createResponse.getId().contains(adlsAcct)); + Assert.assertEquals(1, createResponse.getTags().size()); + + // update the tags + createParams.getTags().put("testkey2", "testvalue2"); + createParams.setProperties(null); + DataLakeStoreAccount updateResponse = dataLakeStoreAccountManagementClient.getAccountOperations().update(rgName, adlsAcct, createParams).getBody(); + Assert.assertEquals(location, updateResponse.getLocation()); + Assert.assertEquals("Microsoft.DataLakeStore/accounts", updateResponse.getType()); + Assert.assertNotNull(updateResponse.getId()); + Assert.assertTrue(updateResponse.getId().contains(adlsAcct)); + Assert.assertEquals(2, updateResponse.getTags().size()); + + // get the account + DataLakeStoreAccount getResponse = dataLakeStoreAccountManagementClient.getAccountOperations().get(rgName, adlsAcct).getBody(); + Assert.assertEquals(location, getResponse.getLocation()); + Assert.assertEquals("Microsoft.DataLakeStore/accounts", getResponse.getType()); + Assert.assertNotNull(getResponse.getId()); + Assert.assertTrue(getResponse.getId().contains(adlsAcct)); + Assert.assertEquals(2, getResponse.getTags().size()); + + // list all accounts and make sure there is one. + List listResult = dataLakeStoreAccountManagementClient.getAccountOperations().list().getBody(); + DataLakeStoreAccount discoveredAcct = null; + for (DataLakeStoreAccount acct : listResult) { + if (acct.getName().equals(adlsAcct)) { + discoveredAcct = acct; + break; + } + } + + Assert.assertNotNull(discoveredAcct); + Assert.assertEquals(location, discoveredAcct.getLocation()); + Assert.assertEquals("Microsoft.DataLakeStore/accounts", discoveredAcct.getType()); + Assert.assertNotNull(discoveredAcct.getId()); + Assert.assertTrue(discoveredAcct.getId().contains(adlsAcct)); + Assert.assertEquals(2, discoveredAcct.getTags().size()); + + // the properties should be empty when we do list calls + Assert.assertNull(discoveredAcct.getProperties().getDefaultGroup()); + + // list within a resource group + listResult = dataLakeStoreAccountManagementClient.getAccountOperations().listByResourceGroup(rgName).getBody(); + discoveredAcct = null; + for (DataLakeStoreAccount acct : listResult) { + if (acct.getName().equals(adlsAcct)) { + discoveredAcct = acct; + break; + } + } + + Assert.assertNotNull(discoveredAcct); + Assert.assertEquals(location, discoveredAcct.getLocation()); + Assert.assertEquals("Microsoft.DataLakeStore/accounts", discoveredAcct.getType()); + Assert.assertNotNull(discoveredAcct.getId()); + Assert.assertTrue(discoveredAcct.getId().contains(adlsAcct)); + Assert.assertEquals(2, discoveredAcct.getTags().size()); + + // the properties should be empty when we do list calls + Assert.assertNull(discoveredAcct.getProperties().getDefaultGroup()); + + // Delete the ADLS account + dataLakeStoreAccountManagementClient.getAccountOperations().delete(rgName, adlsAcct); + + // Do it again, it should not throw + dataLakeStoreAccountManagementClient.getAccountOperations().delete(rgName, adlsAcct); + } +} diff --git a/azure-mgmt-datalake-store/src/test/java/com/microsoft/azure/management/datalake/store/DataLakeStoreFilesystemOperationsTests.java b/azure-mgmt-datalake-store/src/test/java/com/microsoft/azure/management/datalake/store/DataLakeStoreFilesystemOperationsTests.java new file mode 100644 index 000000000000..2349a53cbb93 --- /dev/null +++ b/azure-mgmt-datalake-store/src/test/java/com/microsoft/azure/management/datalake/store/DataLakeStoreFilesystemOperationsTests.java @@ -0,0 +1,763 @@ +package com.microsoft.azure.management.datalake.store; + +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.datalake.store.models.AclStatusResult; +import com.microsoft.azure.management.datalake.store.models.DataLakeStoreAccount; +import com.microsoft.azure.management.datalake.store.models.FileOperationResult; +import com.microsoft.azure.management.datalake.store.models.FileStatusProperties; +import com.microsoft.azure.management.datalake.store.models.FileStatusResult; +import com.microsoft.azure.management.datalake.store.models.FileStatusesResult; +import com.microsoft.azure.management.datalake.store.models.FileType; +import com.microsoft.azure.management.resources.models.ResourceGroup; + +import org.apache.commons.lang3.StringUtils; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import sun.misc.IOUtils; + +public class DataLakeStoreFilesystemOperationsTests extends DataLakeStoreManagementTestBase { + // constants + private static String folderToCreate = "SDKTestFolder01"; + private static String fileToCreateWithContents = "SDKTestFile02.txt"; + private static String fileToCopy = "SDKTestCopyFile01.txt"; + private static String fileToConcatTo = "SDKTestConcatFile01.txt"; + + private static String fileContentsToAdd = "These are some random test contents 1234!@"; + + private static String rgName = generateName("javaadlsrg"); + private static String adlsAcct = generateName("javaadlsacct"); + private static String aclUserId = "027c28d5-c91d-49f0-98c5-d10134b169b3"; + + @BeforeClass + public static void setup() throws Exception { + createClients(); + ResourceGroup group = new ResourceGroup(); + String location = "eastus2"; + group.setLocation(location); + resourceManagementClient.getResourceGroupsOperations().createOrUpdate(rgName, group); + + // create storage and ADLS accounts, setting the accessKey + DataLakeStoreAccount adlsAccount = new DataLakeStoreAccount(); + adlsAccount.setLocation(location); + adlsAccount.setName(adlsAcct); + dataLakeStoreAccountManagementClient.getAccountOperations().create(rgName, adlsAcct, adlsAccount); + } + + @AfterClass + public static void cleanup() throws Exception { + try { + resourceManagementClient.getResourceGroupsOperations().delete(rgName); + } + catch (Exception e) { + // ignore failures during cleanup, as it is best effort + } + } + + // tests + @Test + public void DataLakeStoreFileSystemFolderCreate() throws Exception + { + String folderPath = CreateFolder(adlsAcct, true); + GetAndCompareFileOrFolder(adlsAcct, folderPath, + FileType.DIRECTORY, 0); + } + + /* + TODO: Re-enable code when Expiry is live on the server again + @Test + public void DataLakeStoreFileSystemSetAndRemoveExpiry() + { + const long maxTimeInMilliseconds = 253402300800000; + var filePath = CreateFile(adlsAcct, false, true); + GetAndCompareFileOrFolder(adlsAcct, filePath, FileType.FILE, 0); + + // verify it does not have an expiration + var fileInfo = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().GetFileInfo(filePath, adlsAcct); + Assert.assertTrue(fileInfo.FileInfo.ExpirationTime <= 0 || fileInfo.FileInfo.ExpirationTime == maxTimeInMilliseconds, "Expiration time was not equal to 0 or DateTime.MaxValue.Ticks! Actual value reported: " + fileInfo.FileInfo.ExpirationTime); + + // set the expiration time as an absolute value + + var toSetAbsolute = ToUnixTimeStampMs(HttpMockServer.GetVariable("absoluteTime", DateTime.Now.AddSeconds(120).ToString())); + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().SetFileExpiry(filePath, ExpiryOptionType.Absolute, adlsAcct, toSetAbsolute); + fileInfo = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().GetFileInfo(filePath, adlsAcct); + VerifyTimeInAcceptableRange(toSetAbsolute, fileInfo.FileInfo.ExpirationTime.Value); + + // set the expiration time relative to now + var toSetRelativeToNow = ToUnixTimeStampMs(HttpMockServer.GetVariable("relativeTime", DateTime.Now.AddSeconds(120).ToString())); + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().SetFileExpiry(filePath, ExpiryOptionType.RelativeToNow, adlsAcct, 120 * 1000); + fileInfo = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().GetFileInfo(filePath, adlsAcct); + VerifyTimeInAcceptableRange(toSetRelativeToNow, fileInfo.FileInfo.ExpirationTime.Value); + + // set expiration time relative to the creation time + var toSetRelativeCreationTime = fileInfo.FileInfo.CreationTime.Value + (120 * 1000); + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().SetFileExpiry(filePath, ExpiryOptionType.RelativeToCreationDate, adlsAcct, 120 * 1000); + fileInfo = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().GetFileInfo(filePath, adlsAcct); + VerifyTimeInAcceptableRange(toSetRelativeCreationTime, fileInfo.FileInfo.ExpirationTime.Value); + + // reset expiration time to never + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().SetFileExpiry(filePath, ExpiryOptionType.NeverExpire, adlsAcct); + fileInfo = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().GetFileInfo(filePath, adlsAcct); + Assert.assertTrue(fileInfo.FileInfo.ExpirationTime <= 0 || fileInfo.FileInfo.ExpirationTime == maxTimeInMilliseconds, "Expiration time was not equal to 0 or DateTime.MaxValue.Ticks! Actual value reported: " + fileInfo.FileInfo.ExpirationTime); + } + + @Test + public void DataLakeStoreFileSystemNegativeExpiry() + { + const long maxTimeInMilliseconds = 253402300800000; + var filePath = CreateFile(adlsAcct, false, true); + GetAndCompareFileOrFolder(adlsAcct, filePath, FileType.FILE, 0); + + // verify it does not have an expiration + var fileInfo = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().GetFileInfo(filePath, adlsAcct); + Assert.assertTrue(fileInfo.FileInfo.ExpirationTime <= 0 || fileInfo.FileInfo.ExpirationTime == maxTimeInMilliseconds, "Expiration time was not equal to 0 or DateTime.MaxValue.Ticks! Actual value reported: " + fileInfo.FileInfo.ExpirationTime); + + // set the expiration time as an absolute value that is less than the creation time + var toSetAbsolute = ToUnixTimeStampMs(HttpMockServer.GetVariable("absoluteNegativeTime", DateTime.Now.AddSeconds(-120).ToString())); + Assert.assertThrows(() => dataLakeStoreFileSystemManagementClient.getFileSystemOperations().SetFileExpiry(filePath, ExpiryOptionType.Absolute, adlsAcct, toSetAbsolute)); + + // set the expiration time as an absolute value that is greater than max allowed time + toSetAbsolute = ToUnixTimeStampMs(DateTime.MaxValue.ToString()) + 1000; + Assert.assertThrows(() => dataLakeStoreFileSystemManagementClient.getFileSystemOperations().SetFileExpiry(filePath, ExpiryOptionType.Absolute, adlsAcct, toSetAbsolute)); + + // reset expiration time to never with a value and confirm the value is not honored + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().SetFileExpiry(filePath, ExpiryOptionType.NeverExpire, adlsAcct, 400); + fileInfo = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().GetFileInfo(filePath, adlsAcct); + Assert.assertTrue(fileInfo.FileInfo.ExpirationTime <= 0 || fileInfo.FileInfo.ExpirationTime == maxTimeInMilliseconds, "Expiration time was not equal to 0 or DateTime.MaxValue.Ticks! Actual value reported: " + fileInfo.FileInfo.ExpirationTime); + } + */ + + @Test + public void DataLakeStoreFileSystemListFolderContents() throws Exception + { + String folderPath = CreateFolder(adlsAcct, true); + GetAndCompareFileOrFolder(adlsAcct, folderPath, + FileType.DIRECTORY, 0); + + String filePath = CreateFile(adlsAcct, false, true, folderPath); + GetAndCompareFileOrFolder(adlsAcct, filePath, FileType.FILE, 0); + + // List all the contents in the folder + FileStatusesResult listFolderResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().listFileStatus(folderPath, adlsAcct).getBody(); + + // We know that this directory is brand new, so the contents should only be the one file. + Assert.assertEquals(1, listFolderResponse.getFileStatuses().getFileStatus().size()); + Assert.assertEquals(FileType.FILE, listFolderResponse.getFileStatuses().getFileStatus().get(0).getType()); + } + + @Test + public void DataLakeStoreFileSystemEmptyFileCreate() throws Exception + { + String filePath = CreateFile(adlsAcct, false, true, folderToCreate); + GetAndCompareFileOrFolder(adlsAcct, filePath, FileType.FILE, 0); + } + + @Test + public void DataLakeStoreFileSystemFileCreateWithContents() throws Exception + { + String filePath = CreateFile(adlsAcct, true, true, folderToCreate); + GetAndCompareFileOrFolder(adlsAcct, filePath, FileType.FILE, + fileContentsToAdd.length()); + CompareFileContents(adlsAcct, filePath, + fileContentsToAdd); + } + + @Test + public void DataLakeStoreFileSystemAppendToFile() throws Exception + { + String filePath = CreateFile(adlsAcct, false, true, folderToCreate); + GetAndCompareFileOrFolder(adlsAcct, filePath, FileType.FILE, 0); + + // Append to the file that we created + String fileContentsToAppend = "More test contents, that were appended!"; + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().append(filePath, + adlsAcct, + fileContentsToAppend.getBytes()); + + GetAndCompareFileOrFolder(adlsAcct, filePath, FileType.FILE, + fileContentsToAppend.length()); + } + + @Test + public void DataLakeStoreFileSystemConcatenateFiles() throws Exception + { + String filePath1 = CreateFile(adlsAcct, true, true, folderToCreate); + GetAndCompareFileOrFolder(adlsAcct, filePath1, FileType.FILE, + fileContentsToAdd.length()); + + String filePath2 = CreateFile(adlsAcct, true, true, folderToCreate); + GetAndCompareFileOrFolder(adlsAcct, filePath2, FileType.FILE, + fileContentsToAdd.length()); + + String targetFolder = CreateFolder(adlsAcct, true); + + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().concat( + String.format("%s/%s", targetFolder, fileToConcatTo), + adlsAcct, + Arrays.asList(new String[]{filePath1, filePath2}) + ); + + GetAndCompareFileOrFolder(adlsAcct, + String.format("%s/%s", targetFolder, fileToConcatTo), + FileType.FILE, + fileContentsToAdd.length() * 2); + + // Attempt to get the files that were concatted together, which should fail and throw + try { + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(filePath1, + adlsAcct); + Assert.assertTrue("Able to get the old file after concat", false); + } + catch (Exception e) { + Assert.assertTrue(e instanceof CloudException); + } + + try { + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(filePath2, + adlsAcct); + Assert.assertTrue("Able to get the old file after concat", false); + } + catch (Exception e) { + Assert.assertTrue(e instanceof CloudException); + } + } + + @Test + public void DataLakeStoreFileSystemMsConcatenateFiles() throws Exception + { + String filePath1 = CreateFile(adlsAcct, true, true, folderToCreate); + GetAndCompareFileOrFolder(adlsAcct, filePath1, FileType.FILE, + fileContentsToAdd.length()); + + String filePath2 = CreateFile(adlsAcct, true, true, folderToCreate); + GetAndCompareFileOrFolder(adlsAcct, filePath2, FileType.FILE, + fileContentsToAdd.length()); + + String targetFolder = CreateFolder(adlsAcct, true); + + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().msConcat( + String.format("%s/%s", targetFolder, fileToConcatTo), + adlsAcct, + String.format("sources=%s,%s", filePath1, filePath2).getBytes(), + false); + + GetAndCompareFileOrFolder(adlsAcct, + String.format("%s/%s", targetFolder, fileToConcatTo), + FileType.FILE, + fileContentsToAdd.length() * 2); + + // Attempt to get the files that were concatted together, which should fail and throw + try { + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(filePath1, + adlsAcct); + Assert.assertTrue("Able to get the old file after concat", false); + } + catch (Exception e) { + Assert.assertTrue(e instanceof CloudException); + } + + try { + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(filePath2, + adlsAcct); + Assert.assertTrue("Able to get the old file after concat", false); + } + catch (Exception e) { + Assert.assertTrue(e instanceof CloudException); + } + } + + @Test + public void DataLakeStoreFileSystemMsConcatDeleteDir() throws Exception + { + String concatFolderPath = String.format("%s/%s", folderToCreate, + "msconcatFolder"); + String filePath1 = CreateFile(adlsAcct, true, true, + concatFolderPath); + GetAndCompareFileOrFolder(adlsAcct, filePath1, FileType.FILE, + fileContentsToAdd.length()); + + String filePath2 = CreateFile(adlsAcct, true, true, + concatFolderPath); + GetAndCompareFileOrFolder(adlsAcct, filePath2, FileType.FILE, + fileContentsToAdd.length()); + + String targetFolder = CreateFolder(adlsAcct, true); + + String destination = String.format("%s/%s", targetFolder, fileToConcatTo); + + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().msConcat( + destination, + adlsAcct, + String.format("sources=%s,%s", filePath1, filePath2).getBytes(), + true); + + GetAndCompareFileOrFolder(adlsAcct, + String.format("%s/%s", targetFolder, fileToConcatTo), + FileType.FILE, + fileContentsToAdd.length()*2); + + // Attempt to get the files that were concatted together, which should fail and throw + try { + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(filePath1, adlsAcct); + Assert.assertTrue("Able to get the old file after concat", false); + } + catch (Exception e) { + Assert.assertTrue(e instanceof CloudException); + } + + try { + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(filePath2, adlsAcct); + Assert.assertTrue("Able to get the old file after concat", false); + } + catch (Exception e) { + Assert.assertTrue(e instanceof CloudException); + } + + // Attempt to get the folder that was created for concat, which should fail and be deleted. + try { + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(concatFolderPath, adlsAcct); + Assert.assertTrue("Able to get the old folder after concat", false); + } + catch (Exception e) { + Assert.assertTrue(e instanceof CloudException); + } + } + + @Test + public void DataLakeStoreFileSystemMoveFileAndFolder() throws Exception + { + String filePath = CreateFile(adlsAcct, true, true, folderToCreate); + GetAndCompareFileOrFolder(adlsAcct, filePath, FileType.FILE, + fileContentsToAdd.length()); + + String targetFolder1 = CreateFolder(adlsAcct, true); + String folderToMove = "SDKTestMoveFolder01"; + String targetFolder2 = generateName(folderToMove); + + // Move file first + String fileToMove = "SDKTestMoveFile01.txt"; + FileOperationResult moveFileResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().rename(filePath, + adlsAcct, + String.format("%s/%s", targetFolder1, fileToMove)).getBody(); + Assert.assertTrue(moveFileResponse.getOperationResult()); + GetAndCompareFileOrFolder(adlsAcct, + String.format("%s/%s", targetFolder1, fileToMove), + FileType.FILE, + fileContentsToAdd.length()); + + // Ensure the old file is gone + try { + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(filePath, adlsAcct); + Assert.assertTrue("Able to get the old file after rename", false); + } + catch (Exception e) { + Assert.assertTrue(e instanceof CloudException); + } + + // Now move folder completely. + FileOperationResult moveFolderResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().rename(targetFolder1, + adlsAcct, + targetFolder2).getBody(); + Assert.assertTrue(moveFolderResponse.getOperationResult()); + + GetAndCompareFileOrFolder(adlsAcct, targetFolder2, + FileType.DIRECTORY, 0); + + // ensure all the contents of the folder moved + // List all the contents in the folder + FileStatusesResult listFolderResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().listFileStatus(targetFolder2, + adlsAcct).getBody(); + + // We know that this directory is brand new, so the contents should only be the one file. + Assert.assertEquals(1, listFolderResponse.getFileStatuses().getFileStatus().size()); + Assert.assertEquals(FileType.FILE, listFolderResponse.getFileStatuses().getFileStatus().get(0).getType()); + + try { + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(targetFolder1, adlsAcct); + Assert.assertTrue("Able to get the old folder after rename", false); + } + catch (Exception e) { + Assert.assertTrue(e instanceof CloudException); + } + } + + @Test + public void DataLakeStoreFileSystemDeleteFolder() throws Exception + { + String folderPath = CreateFolder(adlsAcct, true); + GetAndCompareFileOrFolder(adlsAcct, folderPath, + FileType.DIRECTORY, 0); + DeleteFolder(adlsAcct, folderPath, true, false); + //WORK AROUND: Bug 4717659 makes it so even empty folders have contents. + + // delete again expecting failure. + DeleteFolder(adlsAcct, folderPath, false, true); + + // delete a folder with contents + String filePath = CreateFile(adlsAcct, true, true, folderPath); + GetAndCompareFileOrFolder(adlsAcct, filePath, FileType.FILE, + fileContentsToAdd.length()); + + // should fail if recurse is not set + DeleteFolder(adlsAcct, folderPath, false, true); + + // Now actually delete + DeleteFolder(adlsAcct, folderPath, true, false); + + // delete again expecting failure. + DeleteFolder(adlsAcct, folderPath, true, true); + } + + @Test + public void DataLakeStoreFileSystemDeleteFile() throws Exception + { + String filePath = CreateFile(adlsAcct, true, true, folderToCreate); + GetAndCompareFileOrFolder(adlsAcct, filePath, FileType.FILE, + fileContentsToAdd.length()); + DeleteFile(adlsAcct, filePath, false); + + // try to delete it again, which should fail + DeleteFile(adlsAcct, filePath, true); + } + + @Test + public void DataLakeStoreFileSystemGetAndSetAcl() throws Exception + { + AclStatusResult currentAcl = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getAclStatus("/", + adlsAcct).getBody(); + + List aclToReplaceWith = new ArrayList(currentAcl.getAclStatus().getEntries()); + String originalOther = ""; + String toReplace = "other::rwx"; + for (int i = 0; i < aclToReplaceWith.size(); i++) + { + if (aclToReplaceWith.get(i).startsWith("other")) + { + originalOther = aclToReplaceWith.get(i); + aclToReplaceWith.set(i, toReplace); + break; + } + } + + Assert.assertFalse(originalOther == null || StringUtils.isEmpty(originalOther)); + + // Set the other acl to RWX + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().setAcl("/", + adlsAcct, + String.join(",", aclToReplaceWith)); + + AclStatusResult newAcl = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getAclStatus("/", + adlsAcct).getBody(); + // verify the ACL actually changed + + // Check the access first and assert that it returns OK (note: this is currently only for the user making the request, so it is not testing "other") + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().checkAccess("/", + adlsAcct, "rwx"); + + boolean foundIt = false; + for (String entry: newAcl.getAclStatus().getEntries()) + { + if(entry.startsWith("other")) { + Assert.assertEquals(toReplace, entry); + foundIt = true; + break; + } + } + + Assert.assertTrue(foundIt); + + // Set it back using specific entry + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().modifyAclEntries("/", + adlsAcct, originalOther); + + // Now confirm that it equals the original ACL + List finalEntries = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getAclStatus("/", + adlsAcct).getBody() + .getAclStatus().getEntries(); + for (String entry: finalEntries) + { + boolean found = false; + for(String curEntry: currentAcl.getAclStatus().getEntries()) { + if(curEntry.toUpperCase().equals(entry.toUpperCase())) { + found = true; + break; + } + } + + Assert.assertTrue(found); + } + + Assert.assertEquals(finalEntries.size(), currentAcl.getAclStatus().getEntries().size()); + } + + @Test + public void DataLakeStoreFileSystemSetFileProperties() throws Exception + { + // This test simply tests that all bool/empty return actions return successfully + + String filePath = CreateFile(adlsAcct, true, true, folderToCreate); + FileStatusProperties originalFileStatus = + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(filePath, + adlsAcct).getBody().getFileStatus(); + // TODO: Set replication on file, this has been removed until it is confirmed as a supported API. + /* + var replicationResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().SetReplication(filePath, + adlsAcct, 3); + Assert.assertTrue(replicationResponse.Boolean); + */ + + /* + * This API is available but all values put into it are ignored. Commenting this out until this API is fully functional. + Assert.assertEquals(3, + dataLakeFileSystemClient.FileSystem.getFileStatus(filePath, adlsAcct) + .FileStatus.Replication); + */ + + // set the time on the file + // We use a static date for now since we aren't interested in whether the value is set properly, only that the method returns a 200. + /* TODO: Re enable once supported. + var timeToSet = new DateTime(2015, 10, 26, 14, 30, 0).Ticks; + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().SetTimes(filePath, + adlsAcct, timeToSet, timeToSet); + + var fileStatusAfterTime = + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(filePath, + adlsAcct) + .FileStatus; + */ + + /* + * This API is available but all values put into it are ignored. Commenting this out until this API is fully functional. + Assert.assertTrue( + fileStatusAfterTime.ModificationTime == timeToSet && fileStatusAfterTime.AccessTime == timeToSet); + */ + + // TODO: Symlink creation is explicitly not supported, but when it is this should be enabled. + /* + var symLinkName = generateName("testPath/symlinktest1"); + Assert.assertThrows(() => dataLakeStoreFileSystemManagementClient.getFileSystemOperations().CreateSymLink(filePath, + adlsAcct, symLinkName, true)); + */ + + // Once symlinks are available, remove the throws test and uncomment out this code. + // Assert.assertTrue(createSymLinkResponse.StatusCode == HttpStatusCode.OK); + // Assert.assertDoesNotThrow(() => dataLakeFileSystemClient.FileSystem.getFileStatus(symLinkName, adlsAcct)); + } + + @Test + public void DataLakeStoreFileSystemGetAcl() throws Exception + { + AclStatusResult aclGetResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getAclStatus("/", + adlsAcct).getBody(); + + Assert.assertNotNull(aclGetResponse.getAclStatus()); + Assert.assertTrue(aclGetResponse.getAclStatus().getEntries().size() > 0); + Assert.assertTrue(aclGetResponse.getAclStatus().getOwner() != null && StringUtils.isNotEmpty(aclGetResponse.getAclStatus().getOwner())); + Assert.assertTrue(aclGetResponse.getAclStatus().getGroup() != null && StringUtils.isNotEmpty(aclGetResponse.getAclStatus().getGroup())); + } + + @Test + public void DataLakeStoreFileSystemSetAcl() throws Exception + { + AclStatusResult aclGetResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getAclStatus("/", adlsAcct).getBody(); + + Assert.assertNotNull(aclGetResponse.getAclStatus()); + Assert.assertTrue(aclGetResponse.getAclStatus().getEntries().size() > 0); + + int currentCount = aclGetResponse.getAclStatus().getEntries().size(); + + // add an entry to the ACL Entries + String newAcls = String.join(",", aclGetResponse.getAclStatus().getEntries()); + newAcls += String.format(",user:%s:rwx", aclUserId); + + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().setAcl("/", + adlsAcct, + newAcls); + + // retrieve the ACL again and confirm the new entry is present + aclGetResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getAclStatus("/", + adlsAcct).getBody(); + + Assert.assertNotNull(aclGetResponse.getAclStatus()); + Assert.assertTrue(aclGetResponse.getAclStatus().getEntries().size() > 0); + Assert.assertEquals(currentCount + 1, aclGetResponse.getAclStatus().getEntries().size()); + + boolean found = false; + for (String entry: aclGetResponse.getAclStatus().getEntries()) { + if(entry.contains(aclUserId)) { + found = true; + break; + } + } + + Assert.assertTrue(found); + } + + @Test + public void DataLakeStoreFileSystemSetDeleteAclEntry() throws Exception + { + AclStatusResult aclGetResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getAclStatus("/", adlsAcct).getBody(); + + Assert.assertNotNull(aclGetResponse.getAclStatus()); + Assert.assertTrue(aclGetResponse.getAclStatus().getEntries().size() > 0); + + int currentCount = aclGetResponse.getAclStatus().getEntries().size(); + // add an entry to the ACL Entries + String newAce = String.format("user:%s:rwx", aclUserId); + + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().modifyAclEntries("", + adlsAcct, + newAce); + + // retrieve the ACL again and confirm the new entry is present + aclGetResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getAclStatus("/", + adlsAcct).getBody(); + + Assert.assertNotNull(aclGetResponse.getAclStatus()); + Assert.assertTrue(aclGetResponse.getAclStatus().getEntries().size() > 0); + Assert.assertEquals(currentCount + 1, aclGetResponse.getAclStatus().getEntries().size()); + + boolean found = false; + for (String entry: aclGetResponse.getAclStatus().getEntries()) { + if(entry.contains(aclUserId)) { + found = true; + break; + } + } + + Assert.assertTrue(found); + + // now remove the entry + String aceToRemove = String.format(",user:%s", aclUserId); + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().removeAclEntries("/", + adlsAcct, + aceToRemove); + + // retrieve the ACL again and confirm the new entry is present + aclGetResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getAclStatus("/", + adlsAcct).getBody(); + + Assert.assertNotNull(aclGetResponse.getAclStatus()); + Assert.assertTrue(aclGetResponse.getAclStatus().getEntries().size() > 0); + Assert.assertEquals(currentCount, aclGetResponse.getAclStatus().getEntries().size()); + + found = false; + for (String entry: aclGetResponse.getAclStatus().getEntries()) { + if(entry.contains(aclUserId)) { + found = true; + break; + } + } + + Assert.assertFalse(found); + } + + // helper methods + private String CreateFolder(String caboAccountName, boolean randomName) throws Exception + { + // Create a folder + String folderPath = randomName + ? generateName(folderToCreate) + : folderToCreate; + + FileOperationResult response = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().mkdirs(folderPath, caboAccountName).getBody(); + Assert.assertTrue(response.getOperationResult()); + + return folderPath; + } + + private String CreateFile(String caboAccountName, boolean withContents, boolean randomName, String folderName) throws Exception + { + String fileToCreate = "SDKTestFile01.txt"; + String filePath = randomName ? generateName(String.format("%s/%s", folderName, fileToCreate)) : String.format("%s/%s", folderName, fileToCreate); + + if (!withContents) + { + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().create( + filePath, + caboAccountName); + } + else + { + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().create( + filePath, + caboAccountName, + fileContentsToAdd.getBytes(), + false); // never overwrite during create, because if it exists we want to fail. + } + + return filePath; + } + + private FileStatusResult GetAndCompareFileOrFolder(String caboAccountName, String fileOrFolderPath, FileType expectedType, long expectedLength) throws Exception + { + FileStatusResult getResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(fileOrFolderPath, caboAccountName).getBody(); + Assert.assertEquals(expectedLength, (long) getResponse.getFileStatus().getLength()); + Assert.assertEquals(expectedType, getResponse.getFileStatus().getType()); + + return getResponse; + } + + private void CompareFileContents(String caboAccountName, String filePath, String expectedContents) throws Exception + { + // download a file and ensure they are equal + InputStream openResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().open(filePath, caboAccountName).getBody(); + Assert.assertNotNull(openResponse); + + String toCompare = new String(IOUtils.readFully(openResponse, -1, true)); + Assert.assertEquals(expectedContents, toCompare); + } + + private void DeleteFolder(String caboAccountName, String folderPath, boolean recursive, boolean failureExpected) throws Exception + { + if (failureExpected) + { + // try to delete a folder that doesn't exist or should fail + try + { + FileOperationResult deleteFolderResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().delete(folderPath, caboAccountName, recursive).getBody(); + Assert.assertTrue(!deleteFolderResponse.getOperationResult()); + } + catch (Exception e) + { + Assert.assertTrue(e instanceof CloudException); + } + } + else + { + // Delete a folder + FileOperationResult deleteFolderResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().delete(folderPath, caboAccountName, recursive).getBody(); + Assert.assertTrue(deleteFolderResponse.getOperationResult()); + } + } + + private void DeleteFile(String caboAccountName, String filePath, boolean failureExpected) throws Exception + { + if (failureExpected) + { + // try to delete a file that doesn't exist + try + { + FileOperationResult deleteFileResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().delete(filePath, caboAccountName, false).getBody(); + Assert.assertTrue(!deleteFileResponse.getOperationResult()); + } + catch (Exception e) + { + Assert.assertTrue(e instanceof CloudException); + } + } + else + { + // Delete a file + FileOperationResult deleteFileResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().delete(filePath, caboAccountName, false).getBody(); + Assert.assertTrue(deleteFileResponse.getOperationResult()); + } + } +} diff --git a/azure-mgmt-datalake-store/src/test/java/com/microsoft/azure/management/datalake/store/DataLakeStoreManagementTestBase.java b/azure-mgmt-datalake-store/src/test/java/com/microsoft/azure/management/datalake/store/DataLakeStoreManagementTestBase.java new file mode 100644 index 000000000000..7de156f02561 --- /dev/null +++ b/azure-mgmt-datalake-store/src/test/java/com/microsoft/azure/management/datalake/store/DataLakeStoreManagementTestBase.java @@ -0,0 +1,41 @@ +package com.microsoft.azure.management.datalake.store; + +import com.microsoft.azure.credentials.AzureEnvironment; +import com.microsoft.azure.credentials.UserTokenCredentials; +import com.microsoft.azure.management.resources.ResourceManagementClient; +import com.microsoft.azure.management.resources.ResourceManagementClientImpl; + +import okhttp3.logging.HttpLoggingInterceptor; + +public abstract class DataLakeStoreManagementTestBase { + protected static ResourceManagementClient resourceManagementClient; + protected static DataLakeStoreAccountManagementClient dataLakeStoreAccountManagementClient; + protected static DataLakeStoreFileSystemManagementClient dataLakeStoreFileSystemManagementClient; + + public static void createClients() { + UserTokenCredentials credentials = new UserTokenCredentials( + System.getenv("arm.clientid"), + System.getenv("arm.domain"), + System.getenv("arm.username"), + System.getenv("arm.password"), + null, + AzureEnvironment.AZURE); + + resourceManagementClient = new ResourceManagementClientImpl(credentials); + resourceManagementClient.setSubscriptionId(System.getenv("arm.subscriptionid")); + resourceManagementClient.setLogLevel(HttpLoggingInterceptor.Level.BODY); + + dataLakeStoreAccountManagementClient = new DataLakeStoreAccountManagementClientImpl(credentials); + dataLakeStoreAccountManagementClient.setLogLevel(HttpLoggingInterceptor.Level.BODY); + dataLakeStoreAccountManagementClient.setSubscriptionId(System.getenv("arm.subscriptionid")); + + dataLakeStoreFileSystemManagementClient = new DataLakeStoreFileSystemManagementClientImpl(credentials); + dataLakeStoreFileSystemManagementClient.setLogLevel(HttpLoggingInterceptor.Level.BODY); + dataLakeStoreFileSystemManagementClient.setSubscriptionId(System.getenv("arm.subscriptionid")); + } + + public static String generateName(String prefix) { + int randomSuffix = (int)(Math.random() * 1000); + return prefix + randomSuffix; + } +} \ No newline at end of file diff --git a/azure/pom.xml b/azure/pom.xml index 44be6c92de7c..33b22ae71066 100644 --- a/azure/pom.xml +++ b/azure/pom.xml @@ -56,6 +56,16 @@ always + + oss-snapshots + Open Source Snapshots + https://oss.sonatype.org/content/repositories/snapshots/ + default + + true + always + + @@ -289,5 +299,7 @@ ../azure-mgmt-storage ../azure-mgmt-network ../azure-mgmt-website + ../azure-mgmt-datalake-analytics + ../azure-mgmt-datalake-store diff --git a/gulpfile.js b/gulpfile.js index 972fe3641810..f7b18a81967f 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -47,6 +47,31 @@ var mappings = { 'source': 'arm-web/2015-08-01/swagger/service.json', 'package': 'com.microsoft.azure.management.website', 'args': '-FT 1' + }, + 'datalake.store.filesystem': { + 'dir': 'azure-mgmt-datalake-store', + 'source': 'arm-datalake-store/filesystem/2015-10-01-preview/swagger/filesystem.json', + 'package': 'com.microsoft.azure.management.datalake.store' + }, + 'datalake.store.account': { + 'dir': 'azure-mgmt-datalake-store', + 'source': 'arm-datalake-store/account/2015-10-01-preview/swagger/account.json', + 'package': 'com.microsoft.azure.management.datalake.store' + }, + 'datalake.analytics.account': { + 'dir': 'azure-mgmt-datalake-analytics', + 'source': 'arm-datalake-analytics/account/2015-10-01-preview/swagger/account.json', + 'package': 'com.microsoft.azure.management.datalake.analytics' + }, + 'datalake.analytics.job': { + 'dir': 'azure-mgmt-datalake-analytics', + 'source': 'arm-datalake-analytics/job/2015-11-01-preview/swagger/job.json', + 'package': 'com.microsoft.azure.management.datalake.analytics' + }, + 'datalake.analytics.catalog': { + 'dir': 'azure-mgmt-datalake-analytics', + 'source': 'arm-datalake-analytics/catalog/2015-10-01-preview/swagger/catalog.json', + 'package': 'com.microsoft.azure.management.datalake.analytics' } }; @@ -63,7 +88,7 @@ gulp.task('default', function() { var specRoot = args['spec-root'] || "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master"; var projects = args['projects']; -var autoRestVersion = '0.13.0-Nightly20151029'; // default +var autoRestVersion = '0.16.0-Nightly20160314'; // default if (args['autorest'] !== undefined) { autoRestVersion = args['autorest']; }