From c99516109ecc9ac729f6e9f769c9ed7c04bc7e76 Mon Sep 17 00:00:00 2001 From: begoldsm Date: Mon, 7 Mar 2016 14:44:05 -0800 Subject: [PATCH 1/9] update the gulpfile to include ADL --- gulpfile.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/gulpfile.js b/gulpfile.js index 972fe3641810..119c80db26cf 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' } }; From 8f59c1f6d206ac9ae78aa31800bf714da35c9ecb Mon Sep 17 00:00:00 2001 From: begoldsm Date: Mon, 7 Mar 2016 18:00:34 -0800 Subject: [PATCH 2/9] Initial ADL Java Check-in This includes PLACEHOLDER test packages as well as the autogenerated code and pom.xml files. --- azure-mgmt-datalake-analytics/pom.xml | 119 + .../datalake/analytics/AccountOperations.java | 842 ++++ .../analytics/AccountOperationsImpl.java | 2762 ++++++++++++ .../datalake/analytics/CatalogOperations.java | 1066 +++++ .../analytics/CatalogOperationsImpl.java | 3766 +++++++++++++++++ ...aLakeAnalyticsAccountManagementClient.java | 135 + ...eAnalyticsAccountManagementClientImpl.java | 216 + ...aLakeAnalyticsCatalogManagementClient.java | 149 + ...eAnalyticsCatalogManagementClientImpl.java | 237 ++ .../DataLakeAnalyticsJobManagementClient.java | 149 + ...aLakeAnalyticsJobManagementClientImpl.java | 237 ++ .../datalake/analytics/JobOperations.java | 231 + .../datalake/analytics/JobOperationsImpl.java | 831 ++++ .../models/AddDataLakeStoreParameters.java | 43 + .../models/AddStorageAccountParameters.java | 43 + .../models/AzureAsyncOperationResult.java | 57 + .../analytics/models/BlobContainer.java | 79 + .../models/BlobContainerProperties.java | 35 + .../analytics/models/CatalogItem.java | 64 + .../analytics/models/CatalogItemList.java | 64 + .../models/DataLakeAnalyticsAccount.java | 144 + .../DataLakeAnalyticsAccountProperties.java | 220 + .../models/DataLakeAnalyticsAccountState.java | 59 + .../DataLakeAnalyticsAccountStatus.java | 80 + ...CatalogSecretCreateOrUpdateParameters.java | 67 + .../models/DataLakeStoreAccountInfo.java | 67 + .../DataLakeStoreAccountInfoProperties.java | 41 + .../datalake/analytics/models/DdlName.java | 114 + .../datalake/analytics/models/EntityId.java | 65 + .../datalake/analytics/models/Error.java | 96 + .../analytics/models/ErrorDetails.java | 66 + .../analytics/models/ExternalTable.java | 65 + .../datalake/analytics/models/FileType.java | 59 + .../analytics/models/HiveJobProperties.java | 140 + .../models/HiveJobStatementInfo.java | 110 + .../datalake/analytics/models/InnerError.java | 49 + .../analytics/models/JobDataPath.java | 65 + .../analytics/models/JobErrorDetails.java | 233 + .../analytics/models/JobInformation.java | 300 ++ .../analytics/models/JobInnerError.java | 188 + .../analytics/models/JobProperties.java | 75 + .../analytics/models/JobResource.java | 88 + .../datalake/analytics/models/JobResult.java | 65 + .../datalake/analytics/models/JobState.java | 83 + .../analytics/models/JobStateAuditRecord.java | 81 + .../analytics/models/JobStatistics.java | 51 + .../models/JobStatisticsVertexStage.java | 319 ++ .../datalake/analytics/models/JobType.java | 59 + .../analytics/models/OperationStatus.java | 62 + .../datalake/analytics/models/PageImpl.java | 55 + .../analytics/models/SasTokenInfo.java | 35 + .../analytics/models/StorageAccountInfo.java | 67 + .../models/StorageAccountProperties.java | 67 + .../analytics/models/USqlAssembly.java | 181 + .../analytics/models/USqlAssemblyClr.java | 87 + .../models/USqlAssemblyDependencyInfo.java | 41 + .../models/USqlAssemblyFileInfo.java | 88 + .../analytics/models/USqlCredential.java | 110 + .../analytics/models/USqlDatabase.java | 41 + .../analytics/models/USqlDirectedColumn.java | 64 + .../models/USqlDistributionInfo.java | 111 + .../models/USqlExternalDataSource.java | 136 + .../datalake/analytics/models/USqlIndex.java | 250 ++ .../analytics/models/USqlJobProperties.java | 246 ++ .../analytics/models/USqlProcedure.java | 111 + .../datalake/analytics/models/USqlSchema.java | 64 + .../datalake/analytics/models/USqlSecret.java | 136 + .../datalake/analytics/models/USqlTable.java | 181 + .../analytics/models/USqlTableColumn.java | 65 + .../analytics/models/USqlTableStatistics.java | 321 ++ .../models/USqlTableValuedFunction.java | 110 + .../datalake/analytics/models/USqlType.java | 364 ++ .../datalake/analytics/models/USqlView.java | 111 + .../analytics/models/package-info.java | 13 + .../datalake/analytics/package-info.java | 13 + ...taLakeAnalyticsAccountOperationsTests.java | 45 + ...taLakeAnalyticsCatalogOperationsTests.java | 45 + .../DataLakeAnalyticsJobOperationsTests.java | 45 + .../DataLakeAnalyticsManagementTestBase.java | 20 + azure-mgmt-datalake-store/pom.xml | 119 + .../datalake/store/AccountOperations.java | 486 +++ .../datalake/store/AccountOperationsImpl.java | 1590 +++++++ .../DataLakeStoreAccountManagementClient.java | 135 + ...aLakeStoreAccountManagementClientImpl.java | 216 + ...taLakeStoreFileSystemManagementClient.java | 149 + ...keStoreFileSystemManagementClientImpl.java | 237 ++ .../datalake/store/FileSystemOperations.java | 575 +++ .../store/FileSystemOperationsImpl.java | 2223 ++++++++++ .../datalake/store/models/AclStatus.java | 111 + .../store/models/AclStatusResult.java | 43 + .../models/AzureAsyncOperationResult.java | 57 + .../datalake/store/models/ContentSummary.java | 79 + .../store/models/ContentSummaryResult.java | 34 + .../store/models/DataLakeStoreAccount.java | 142 + .../DataLakeStoreAccountProperties.java | 130 + .../models/DataLakeStoreAccountState.java | 59 + .../models/DataLakeStoreAccountStatus.java | 80 + .../datalake/store/models/Error.java | 95 + .../datalake/store/models/ErrorDetails.java | 65 + .../store/models/FileOperationResult.java | 34 + .../store/models/FileStatusProperties.java | 170 + .../store/models/FileStatusResult.java | 34 + .../datalake/store/models/FileStatuses.java | 35 + .../store/models/FileStatusesResult.java | 34 + .../datalake/store/models/FileType.java | 59 + .../datalake/store/models/FirewallRule.java | 126 + .../store/models/FirewallRuleProperties.java | 64 + .../datalake/store/models/InnerError.java | 49 + .../store/models/OperationStatus.java | 62 + .../datalake/store/models/PageImpl.java | 55 + .../datalake/store/models/package-info.java | 13 + .../datalake/store/package-info.java | 13 + .../DataLakeStoreAccountOperationsTests.java | 45 + ...ataLakeStoreFilesystemOperationsTests.java | 45 + .../DataLakeStoreManagementTestBase.java | 20 + gulpfile.js | 2 +- 116 files changed, 24943 insertions(+), 1 deletion(-) create mode 100644 azure-mgmt-datalake-analytics/pom.xml create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/AccountOperations.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/AccountOperationsImpl.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/CatalogOperations.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/CatalogOperationsImpl.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsAccountManagementClient.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsAccountManagementClientImpl.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsCatalogManagementClient.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsCatalogManagementClientImpl.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsJobManagementClient.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsJobManagementClientImpl.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/JobOperations.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/JobOperationsImpl.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/AddDataLakeStoreParameters.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/AddStorageAccountParameters.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/AzureAsyncOperationResult.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/BlobContainer.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/BlobContainerProperties.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/CatalogItem.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/CatalogItemList.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DataLakeAnalyticsAccount.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DataLakeAnalyticsAccountProperties.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DataLakeAnalyticsAccountState.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DataLakeAnalyticsAccountStatus.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DataLakeStoreAccountInfo.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DataLakeStoreAccountInfoProperties.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/DdlName.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/EntityId.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/Error.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/ErrorDetails.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/ExternalTable.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/FileType.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/HiveJobProperties.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/HiveJobStatementInfo.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/InnerError.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobDataPath.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobErrorDetails.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobInformation.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobInnerError.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobProperties.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobResource.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobResult.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobState.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobStateAuditRecord.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobStatistics.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobStatisticsVertexStage.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobType.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/OperationStatus.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/PageImpl.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/SasTokenInfo.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/StorageAccountInfo.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/StorageAccountProperties.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlAssembly.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlAssemblyClr.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlAssemblyDependencyInfo.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlAssemblyFileInfo.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlCredential.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlDatabase.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlDirectedColumn.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlDistributionInfo.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlExternalDataSource.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlIndex.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlJobProperties.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlProcedure.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlSchema.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlSecret.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlTable.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlTableColumn.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlTableStatistics.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlTableValuedFunction.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlType.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlView.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/package-info.java create mode 100644 azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/package-info.java create mode 100644 azure-mgmt-datalake-analytics/src/test/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsAccountOperationsTests.java create mode 100644 azure-mgmt-datalake-analytics/src/test/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsCatalogOperationsTests.java create mode 100644 azure-mgmt-datalake-analytics/src/test/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsJobOperationsTests.java create mode 100644 azure-mgmt-datalake-analytics/src/test/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsManagementTestBase.java create mode 100644 azure-mgmt-datalake-store/pom.xml create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/AccountOperations.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/AccountOperationsImpl.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/DataLakeStoreAccountManagementClient.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/DataLakeStoreAccountManagementClientImpl.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/DataLakeStoreFileSystemManagementClient.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/DataLakeStoreFileSystemManagementClientImpl.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/FileSystemOperations.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/FileSystemOperationsImpl.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/AclStatus.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/AclStatusResult.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/AzureAsyncOperationResult.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/ContentSummary.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/ContentSummaryResult.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/DataLakeStoreAccount.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/DataLakeStoreAccountProperties.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/DataLakeStoreAccountState.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/DataLakeStoreAccountStatus.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/Error.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/ErrorDetails.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FileOperationResult.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FileStatusProperties.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FileStatusResult.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FileStatuses.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FileStatusesResult.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FileType.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FirewallRule.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/FirewallRuleProperties.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/InnerError.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/OperationStatus.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/PageImpl.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/package-info.java create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/package-info.java create mode 100644 azure-mgmt-datalake-store/src/test/java/com/microsoft/azure/management/datalake/store/DataLakeStoreAccountOperationsTests.java create mode 100644 azure-mgmt-datalake-store/src/test/java/com/microsoft/azure/management/datalake/store/DataLakeStoreFilesystemOperationsTests.java create mode 100644 azure-mgmt-datalake-store/src/test/java/com/microsoft/azure/management/datalake/store/DataLakeStoreManagementTestBase.java diff --git a/azure-mgmt-datalake-analytics/pom.xml b/azure-mgmt-datalake-analytics/pom.xml new file mode 100644 index 000000000000..fa2b5e488a9a --- /dev/null +++ b/azure-mgmt-datalake-analytics/pom.xml @@ -0,0 +1,119 @@ + + + 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 + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + + + + org.apache.maven.plugins + maven-help-plugin + 2.1.1 + + + validate + + evaluate + + + legal + + + + + + + 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..118893d8a1b4 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/AccountOperations.java @@ -0,0 +1,842 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.15.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. + * @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. + * @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. + * @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. + * + * @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; + + /** + * Begins the creation process for 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; + + /** + * Begins the creation process for 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; + + /** + * Begins the creation process for 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; + + /** + * Begins the creation process for 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..160a6c79a36d --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/AccountOperationsImpl.java @@ -0,0 +1,2762 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.15.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. + * @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. + * @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. + * @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. + * + * @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); + } + + /** + * Begins the creation process for 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()); + } + + /** + * Begins the creation process for 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; + } + + /** + * Begins the creation process for 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()); + } + + /** + * Begins the creation process for 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..1111857f4ff7 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/CatalogOperations.java @@ -0,0 +1,1066 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.15.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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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..c978cf78f0c9 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/CatalogOperationsImpl.java @@ -0,0 +1,3766 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.15.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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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. + * @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..d41a286dd27e --- /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.15.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..98c49f0d30e8 --- /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.15.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..a57c1ae06464 --- /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.15.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..2ae6fff06c7c --- /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.15.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..fe159f99be3e --- /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.15.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..c657f840b2d5 --- /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.15.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..5bc307e80270 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/JobOperations.java @@ -0,0 +1,231 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.15.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; + +/** + * 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(String 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(String 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(String 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(String 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; + + /** + * Submits a job to the specified Data Lake Analytics account. + * + * @param jobId 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(String jobId, String accountName, JobInformation parameters) throws CloudException, IOException, IllegalArgumentException; + + /** + * Submits a job to the specified Data Lake Analytics account. + * + * @param jobId 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(String jobId, 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(String 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(String 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(String 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(String jobIdentity, String accountName, 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. + * @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..88edf8fa75fc --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/JobOperationsImpl.java @@ -0,0 +1,831 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.15.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 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") String 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") String 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") + @PUT("Jobs/{jobId}") + Call create(@Path("jobId") String jobId, @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") String 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") String 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") + 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(String 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(String 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(String 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(String 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); + } + + /** + * Submits a job to the specified Data Lake Analytics account. + * + * @param jobId 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(String jobId, String accountName, JobInformation parameters) throws CloudException, IOException, IllegalArgumentException { + if (jobId == null) { + throw new IllegalArgumentException("Parameter jobId 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(jobId, 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 jobId 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(String jobId, String accountName, JobInformation parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (jobId == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter jobId 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(jobId, 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); + } + + /** + * 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(String 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(String 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(String 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(String 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); + } + + /** + * 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..d8828931aa11 --- /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.15.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..2e44c0058f60 --- /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.15.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..38eac171d014 --- /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.15.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..4f4ac7de5b00 --- /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.15.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..1454546c0645 --- /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.15.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..c67c4fea49ca --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/CatalogItem.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.15.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. + */ +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 String 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 String getVersion() { + return this.version; + } + + /** + * Set the version value. + * + * @param version the version value to set + */ + public void setVersion(String 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..420ceb7dc66c --- /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.15.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..8a835371256f --- /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.15.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..495652144079 --- /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.15.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..ef19b5b52c0f --- /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.15.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..dd7942e54b91 --- /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.15.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..8e0068e5e052 --- /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.15.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..95b7e1e70aa6 --- /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.15.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..656475f59022 --- /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.15.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..d99728e55910 --- /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.15.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..00f929a6781c --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/EntityId.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.15.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 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 String 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 String getVersion() { + return this.version; + } + + /** + * Set the version value. + * + * @param version the version value to set + */ + public void setVersion(String 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..32c470553f16 --- /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.15.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..36aa9d36ea5e --- /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.15.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..c85cb3dd28b0 --- /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.15.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..0099451ddae5 --- /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.15.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..21a36579a3aa --- /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.15.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..734b89c2a06d --- /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.15.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..febe79c72b11 --- /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.15.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..153544f6794e --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobDataPath.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.15.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 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 String 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 String 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..25a90de4abd1 --- /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.15.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..18020d9cf5e2 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/JobInformation.java @@ -0,0 +1,300 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.15.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 common Data Lake Analytics job information properties. + */ +public class JobInformation { + /** + * Gets or sets the job's unique identifier (a GUID). + */ + private String 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 String getJobId() { + return this.jobId; + } + + /** + * Set the jobId value. + * + * @param jobId the jobId value to set + */ + public void setJobId(String 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..2e4f545760ed --- /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.15.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..c7251e2aff5f --- /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.15.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..5a026bd8009c --- /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.15.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..d18aabed938a --- /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.15.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..d80f1e827ede --- /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.15.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..ce1e5a8d4069 --- /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.15.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..2950c9c52040 --- /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.15.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..99578b99f9ed --- /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.15.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 Long 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 Long 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 Long 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 Long 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..9193c134c44e --- /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.15.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..6ed0c0a99d01 --- /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.15.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..84ad9d383073 --- /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.15.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..6a847a626148 --- /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.15.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..571388827408 --- /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.15.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..f030ae0fa00c --- /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.15.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..2c9280f8adc1 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlAssembly.java @@ -0,0 +1,181 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.15.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 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. + */ + private String assemblyName; + + /** + * 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 assemblyName value. + * + * @return the assemblyName value + */ + public String getAssemblyName() { + return this.assemblyName; + } + + /** + * Set the assemblyName value. + * + * @param assemblyName the assemblyName value to set + */ + public void setAssemblyName(String assemblyName) { + this.assemblyName = assemblyName; + } + + /** + * 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..1e8f6ec836eb --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlAssemblyClr.java @@ -0,0 +1,87 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.15.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 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. + */ + private String assemblyClrName; + + /** + * 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 assemblyClrName value. + * + * @return the assemblyClrName value + */ + public String getAssemblyClrName() { + return this.assemblyClrName; + } + + /** + * Set the assemblyClrName value. + * + * @param assemblyClrName the assemblyClrName value to set + */ + public void setAssemblyClrName(String assemblyClrName) { + this.assemblyClrName = assemblyClrName; + } + + /** + * 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..d996b2e90cb8 --- /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.15.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..87c88787e633 --- /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.15.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..605972b19ee2 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlCredential.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.15.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 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. + */ + private String credentialName; + + /** + * 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 credentialName value. + * + * @return the credentialName value + */ + public String getCredentialName() { + return this.credentialName; + } + + /** + * Set the credentialName value. + * + * @param credentialName the credentialName value to set + */ + public void setCredentialName(String credentialName) { + this.credentialName = credentialName; + } + + /** + * 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..95d7d9f128f4 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlDatabase.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.15.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 database item. + */ +public class USqlDatabase extends CatalogItem { + /** + * Gets or sets the name of the database. + */ + private String databaseName; + + /** + * 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; + } + +} 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..bb0ca2f548cb --- /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.15.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..6fc62154bbc4 --- /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.15.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..2cccd5e3081d --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlExternalDataSource.java @@ -0,0 +1,136 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.15.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 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. + */ + private String externalDataSourceName; + + /** + * 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 externalDataSourceName value. + * + * @return the externalDataSourceName value + */ + public String getExternalDataSourceName() { + return this.externalDataSourceName; + } + + /** + * Set the externalDataSourceName value. + * + * @param externalDataSourceName the externalDataSourceName value to set + */ + public void setExternalDataSourceName(String externalDataSourceName) { + this.externalDataSourceName = externalDataSourceName; + } + + /** + * 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..ee311ad55407 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlIndex.java @@ -0,0 +1,250 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.15.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 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 String 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 String getPartitionFunction() { + return this.partitionFunction; + } + + /** + * Set the partitionFunction value. + * + * @param partitionFunction the partitionFunction value to set + */ + public void setPartitionFunction(String 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..3c05e02fc6ce --- /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.15.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..c7ba1c05208f --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlProcedure.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.15.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 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. + */ + private String procName; + + /** + * 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 procName value. + * + * @return the procName value + */ + public String getProcName() { + return this.procName; + } + + /** + * Set the procName value. + * + * @param procName the procName value to set + */ + public void setProcName(String procName) { + this.procName = procName; + } + + /** + * 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..a256ac06b9a8 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlSchema.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.15.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 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. + */ + private String schemaName; + + /** + * 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; + } + +} 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..1f39eba80cce --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlSecret.java @@ -0,0 +1,136 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.15.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; + +/** + * 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. + */ + private String secretName; + + /** + * 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 secretName value. + * + * @return the secretName value + */ + public String getSecretName() { + return this.secretName; + } + + /** + * Set the secretName value. + * + * @param secretName the secretName value to set + */ + public void setSecretName(String secretName) { + this.secretName = secretName; + } + + /** + * 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..6343225dee93 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlTable.java @@ -0,0 +1,181 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.15.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 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. + */ + private String tableName; + + /** + * 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 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 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..bb6d0ffc83d0 --- /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.15.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..73f4e98de73e --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlTableStatistics.java @@ -0,0 +1,321 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.15.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 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. + */ + private String statisticsName; + + /** + * 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 statisticsName value. + * + * @return the statisticsName value + */ + public String getStatisticsName() { + return this.statisticsName; + } + + /** + * Set the statisticsName value. + * + * @param statisticsName the statisticsName value to set + */ + public void setStatisticsName(String statisticsName) { + this.statisticsName = statisticsName; + } + + /** + * 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..d92038fa34a8 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlTableValuedFunction.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.15.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 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. + */ + private String tvfName; + + /** + * 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 tvfName value. + * + * @return the tvfName value + */ + public String getTvfName() { + return this.tvfName; + } + + /** + * Set the tvfName value. + * + * @param tvfName the tvfName value to set + */ + public void setTvfName(String tvfName) { + this.tvfName = tvfName; + } + + /** + * 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..e227171ebd65 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlType.java @@ -0,0 +1,364 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.15.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 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. + */ + private String typeName; + + /** + * 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 typeName value. + * + * @return the typeName value + */ + public String getTypeName() { + return this.typeName; + } + + /** + * Set the typeName value. + * + * @param typeName the typeName value to set + */ + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + /** + * 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..6a55dfa0790a --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlView.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.15.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 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. + */ + private String viewName; + + /** + * 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 viewName value. + * + * @return the viewName value + */ + public String getViewName() { + return this.viewName; + } + + /** + * Set the viewName value. + * + * @param viewName the viewName value to set + */ + public void setViewName(String viewName) { + this.viewName = viewName; + } + + /** + * 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..53db045d389b --- /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.15.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the model classes for DataLakeAnalyticsCatalogManagementClient. + * Creates an Azure Data Lake Analytics catalog 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..338814b0f1c4 --- /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.15.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for DataLakeAnalyticsCatalogManagementClient. + * Creates an Azure Data Lake Analytics catalog 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..6267629654dd --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/test/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsAccountOperationsTests.java @@ -0,0 +1,45 @@ +package com.microsoft.azure.management.resources; + +import com.microsoft.azure.management.resources.models.ResourceGroup; + +import org.junit.Assert; +import org.junit.Test; + +import java.util.HashMap; +import java.util.List; + +public class ResourceGroupsOperationsTests extends ResourceManagementTestBase { + @Test + public void canCreateResourceGroup() throws Exception { + String rgName = "javacsmrg"; + String location = "southcentralus"; + // Create + ResourceGroup group = new ResourceGroup(); + group.setLocation(location); + group.setTags(new HashMap()); + group.getTags().put("department", "finance"); + group.getTags().put("tagname", "tagvalue"); + resourceManagementClient.getResourceGroupsOperations().createOrUpdate(rgName, group); + // List + List listResult = resourceManagementClient.getResourceGroupsOperations().list(null, null).getBody(); + ResourceGroup groupResult = null; + for (ResourceGroup rg : listResult) { + if (rg.getName().equals(rgName)) { + groupResult = rg; + break; + } + } + Assert.assertNotNull(groupResult); + Assert.assertEquals("finance", groupResult.getTags().get("department")); + Assert.assertEquals("tagvalue", groupResult.getTags().get("tagname")); + Assert.assertEquals(location, groupResult.getLocation()); + // Get + ResourceGroup getGroup = resourceManagementClient.getResourceGroupsOperations().get(rgName).getBody(); + Assert.assertNotNull(getGroup); + Assert.assertEquals(rgName, getGroup.getName()); + Assert.assertEquals(location, getGroup.getLocation()); + // Delete + resourceManagementClient.getResourceGroupsOperations().delete(rgName); + Assert.assertFalse(resourceManagementClient.getResourceGroupsOperations().checkExistence(rgName).getBody()); + } +} 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..6267629654dd --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/test/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsCatalogOperationsTests.java @@ -0,0 +1,45 @@ +package com.microsoft.azure.management.resources; + +import com.microsoft.azure.management.resources.models.ResourceGroup; + +import org.junit.Assert; +import org.junit.Test; + +import java.util.HashMap; +import java.util.List; + +public class ResourceGroupsOperationsTests extends ResourceManagementTestBase { + @Test + public void canCreateResourceGroup() throws Exception { + String rgName = "javacsmrg"; + String location = "southcentralus"; + // Create + ResourceGroup group = new ResourceGroup(); + group.setLocation(location); + group.setTags(new HashMap()); + group.getTags().put("department", "finance"); + group.getTags().put("tagname", "tagvalue"); + resourceManagementClient.getResourceGroupsOperations().createOrUpdate(rgName, group); + // List + List listResult = resourceManagementClient.getResourceGroupsOperations().list(null, null).getBody(); + ResourceGroup groupResult = null; + for (ResourceGroup rg : listResult) { + if (rg.getName().equals(rgName)) { + groupResult = rg; + break; + } + } + Assert.assertNotNull(groupResult); + Assert.assertEquals("finance", groupResult.getTags().get("department")); + Assert.assertEquals("tagvalue", groupResult.getTags().get("tagname")); + Assert.assertEquals(location, groupResult.getLocation()); + // Get + ResourceGroup getGroup = resourceManagementClient.getResourceGroupsOperations().get(rgName).getBody(); + Assert.assertNotNull(getGroup); + Assert.assertEquals(rgName, getGroup.getName()); + Assert.assertEquals(location, getGroup.getLocation()); + // Delete + resourceManagementClient.getResourceGroupsOperations().delete(rgName); + Assert.assertFalse(resourceManagementClient.getResourceGroupsOperations().checkExistence(rgName).getBody()); + } +} 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..6267629654dd --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/test/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsJobOperationsTests.java @@ -0,0 +1,45 @@ +package com.microsoft.azure.management.resources; + +import com.microsoft.azure.management.resources.models.ResourceGroup; + +import org.junit.Assert; +import org.junit.Test; + +import java.util.HashMap; +import java.util.List; + +public class ResourceGroupsOperationsTests extends ResourceManagementTestBase { + @Test + public void canCreateResourceGroup() throws Exception { + String rgName = "javacsmrg"; + String location = "southcentralus"; + // Create + ResourceGroup group = new ResourceGroup(); + group.setLocation(location); + group.setTags(new HashMap()); + group.getTags().put("department", "finance"); + group.getTags().put("tagname", "tagvalue"); + resourceManagementClient.getResourceGroupsOperations().createOrUpdate(rgName, group); + // List + List listResult = resourceManagementClient.getResourceGroupsOperations().list(null, null).getBody(); + ResourceGroup groupResult = null; + for (ResourceGroup rg : listResult) { + if (rg.getName().equals(rgName)) { + groupResult = rg; + break; + } + } + Assert.assertNotNull(groupResult); + Assert.assertEquals("finance", groupResult.getTags().get("department")); + Assert.assertEquals("tagvalue", groupResult.getTags().get("tagname")); + Assert.assertEquals(location, groupResult.getLocation()); + // Get + ResourceGroup getGroup = resourceManagementClient.getResourceGroupsOperations().get(rgName).getBody(); + Assert.assertNotNull(getGroup); + Assert.assertEquals(rgName, getGroup.getName()); + Assert.assertEquals(location, getGroup.getLocation()); + // Delete + resourceManagementClient.getResourceGroupsOperations().delete(rgName); + Assert.assertFalse(resourceManagementClient.getResourceGroupsOperations().checkExistence(rgName).getBody()); + } +} 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..f52472d53964 --- /dev/null +++ b/azure-mgmt-datalake-analytics/src/test/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsManagementTestBase.java @@ -0,0 +1,20 @@ +package com.microsoft.azure.management.resources; + +import com.microsoft.azure.credentials.ApplicationTokenCredentials; +import okhttp3.logging.HttpLoggingInterceptor; + +public abstract class ResourceManagementTestBase { + protected ResourceManagementClient resourceManagementClient; + + public ResourceManagementTestBase() { + resourceManagementClient = new ResourceManagementClientImpl( + new ApplicationTokenCredentials( + System.getenv("arm.clientid"), + System.getenv("arm.domain"), + System.getenv("arm.secret"), + null) + ); + resourceManagementClient.setSubscriptionId(System.getenv("arm.subscriptionid")); + resourceManagementClient.setLogLevel(HttpLoggingInterceptor.Level.BODY); + } +} diff --git a/azure-mgmt-datalake-store/pom.xml b/azure-mgmt-datalake-store/pom.xml new file mode 100644 index 000000000000..9fc32649c86b --- /dev/null +++ b/azure-mgmt-datalake-store/pom.xml @@ -0,0 +1,119 @@ + + + 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 + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + + + + org.apache.maven.plugins + maven-help-plugin + 2.1.1 + + + validate + + evaluate + + + legal + + + + + + + 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..4aca63a0f309 --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/AccountOperations.java @@ -0,0 +1,486 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.15.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). + * @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. + * + * @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..676104654e70 --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/AccountOperationsImpl.java @@ -0,0 +1,1590 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.15.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). + * @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. + * + * @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..4abbd1444132 --- /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.15.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..a781f68fbaa9 --- /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.15.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..19a3df0d78b3 --- /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.15.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..dcefd0ee23a7 --- /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.15.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..0129715b89c5 --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/FileSystemOperations.java @@ -0,0 +1,575 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.15.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.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. + * @param op The constant value for the operation. + * @param appendMode Indicates the concurrent append call should create the file if it doesn't exist or just open the existing file for append + * @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, InputStream streamContents, String op, String 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 op The constant value for the operation. + * @param appendMode Indicates the concurrent append call should create the file if it doesn't exist or just open the existing file for append + * @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, InputStream streamContents, String op, String 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. + * @param op The constant value for the operation. + * @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 op, 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 op The constant value for the operation. + * @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 op, 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. + * @param op The constant value for the operation. + * @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, String op) 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 op The constant value for the 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 mkdirsAsync(String path, String accountName, String op, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Concatenates the list of source files into the destination file. + * + * @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 op The constant value for the operation. + * @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, String op) throws CloudException, IOException, IllegalArgumentException; + + /** + * Concatenates the list of source files into the destination file. + * + * @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 op The constant value for the 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 concatAsync(String destinationPath, String accountName, List sources, String op, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Concatenates the list of source files into the destination file. 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 op The constant value for the operation. + * @param deletesourcedirectory Caution: Setting this parameter to true will delete the parent directory of all source files provided to the MsConcat method. + * @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, InputStream streamContents, String op, Boolean deletesourcedirectory) throws CloudException, IOException, IllegalArgumentException; + + /** + * Concatenates the list of source files into the destination file. 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 op The constant value for the operation. + * @param deletesourcedirectory Caution: Setting this parameter to true will delete the parent directory of all source files provided to the MsConcat method. + * @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, InputStream streamContents, String op, 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. + * @param op The constant value for the operation. + * @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, String op) 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 op The constant value for the 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 listFileStatusAsync(String listFilePath, String accountName, String op, 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. + * @param op The constant value for the operation. + * @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, String op) 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 op The constant value for the 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 getContentSummaryAsync(String getContentSummaryFilePath, String accountName, String op, 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. + * @param op The constant value for the operation. + * @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, String op) 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 op The constant value for the 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 getFileStatusAsync(String getFilePath, String accountName, String op, 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. + * @param op The constant value for the operation. + * @param append The constant value for the operation. + * @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, InputStream streamContents, String op, String append) 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 op The constant value for the operation. + * @param append The constant value for the 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 appendAsync(String directFilePath, String accountName, InputStream streamContents, String op, String append, 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 op The constant value for the operation. + * @param write The constant value for the operation. + * @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, String op, String write, InputStream 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 op The constant value for the operation. + * @param write The constant value for the operation. + * @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, String op, String write, InputStream 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. + * @param op The constant value for the operation. + * @param read The constant value for the operation. + * @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, String op, String read, 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 op The constant value for the operation. + * @param read The constant value for the operation. + * @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, String op, String read, 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|-' + * @param op The constant value for the operation. + * @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, String op) 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 op The constant value for the 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 setAclAsync(String setAclFilePath, String accountName, String aclspec, String op, 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|-' + * @param op The constant value for the operation. + * @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, String op) 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 op The constant value for the 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 modifyAclEntriesAsync(String modifyAclFilePath, String accountName, String aclspec, String op, 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' + * @param op The constant value for the operation. + * @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, String op) 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 op The constant value for the 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 removeAclEntriesAsync(String removeAclFilePath, String accountName, String aclspec, String op, 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. + * @param op The constant value for the operation. + * @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, String op) 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 op The constant value for the 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 removeAclAsync(String aclFilePath, String accountName, String op, 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. + * @param op The constant value for the operation. + * @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, String op) 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 op The constant value for the 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 getAclStatusAsync(String aclFilePath, String accountName, String op, 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 op The constant value for the operation. + * @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, String op, 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 op The constant value for the operation. + * @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, String op, 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 + * @param op The constant value for the operation. + * @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, String op) 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 op The constant value for the 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 renameAsync(String renameFilePath, String accountName, String destination, String op, 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 op The constant value for the operation. + * @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 op, 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 op The constant value for the operation. + * @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 op, 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. + * @param op The constant value for the operation. + * @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 op, 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 op The constant value for the operation. + * @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 op, 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..9a6b02b3e95d --- /dev/null +++ b/azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/FileSystemOperationsImpl.java @@ -0,0 +1,2223 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.15.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.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.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.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 InputStream 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 InputStream 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 InputStream 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 InputStream 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}") + 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. + * @param op The constant value for the operation. + * @param appendMode Indicates the concurrent append call should create the file if it doesn't exist or just open the existing file for append + * @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, InputStream streamContents, String op, String 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 (op == null) { + throw new IllegalArgumentException("Parameter op 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("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.concurrentAppend(filePath, streamContents, 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 op The constant value for the operation. + * @param appendMode Indicates the concurrent append call should create the file if it doesn't exist or just open the existing file for append + * @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, InputStream streamContents, String op, String 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 (op == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter op 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("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.concurrentAppend(filePath, streamContents, 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. + * @param op The constant value for the operation. + * @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 op, 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 (op == null) { + throw new IllegalArgumentException("Parameter op 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("{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 op The constant value for the operation. + * @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 op, 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 (op == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter op 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("{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. + * @param op The constant value for the operation. + * @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, String op) 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 (op == null) { + throw new IllegalArgumentException("Parameter op 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("{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 op The constant value for the 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 mkdirsAsync(String path, String accountName, String op, 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 (op == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter op 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("{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. + * + * @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 op The constant value for the operation. + * @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, String op) 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 (op == null) { + throw new IllegalArgumentException("Parameter op 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); + 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. + * + * @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 op The constant value for the 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 concatAsync(String destinationPath, String accountName, List sources, String op, 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 (op == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter op 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); + 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. 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 op The constant value for the operation. + * @param deletesourcedirectory Caution: Setting this parameter to true will delete the parent directory of all source files provided to the MsConcat method. + * @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, InputStream streamContents, String op, 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 (op == null) { + throw new IllegalArgumentException("Parameter op 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("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.msConcat(msConcatDestinationPath, deletesourcedirectory, 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. 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 op The constant value for the operation. + * @param deletesourcedirectory Caution: Setting this parameter to true will delete the parent directory of all source files provided to the MsConcat method. + * @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, InputStream streamContents, String op, 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 (op == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter op 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("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.msConcat(msConcatDestinationPath, deletesourcedirectory, 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. + * @param op The constant value for the operation. + * @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, String op) 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 (op == null) { + throw new IllegalArgumentException("Parameter op 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("{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 op The constant value for the 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 listFileStatusAsync(String listFilePath, String accountName, String op, 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 (op == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter op 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("{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. + * @param op The constant value for the operation. + * @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, String op) 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 (op == null) { + throw new IllegalArgumentException("Parameter op 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("{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 op The constant value for the 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 getContentSummaryAsync(String getContentSummaryFilePath, String accountName, String op, 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 (op == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter op 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("{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. + * @param op The constant value for the operation. + * @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, String op) 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 (op == null) { + throw new IllegalArgumentException("Parameter op 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("{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 op The constant value for the 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 getFileStatusAsync(String getFilePath, String accountName, String op, 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 (op == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter op 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("{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. + * @param op The constant value for the operation. + * @param append The constant value for the operation. + * @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, InputStream streamContents, String op, String append) 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 (op == null) { + throw new IllegalArgumentException("Parameter op is required and cannot be null."); + } + if (append == null) { + throw new IllegalArgumentException("Parameter append 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("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.append(directFilePath, 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 op The constant value for the operation. + * @param append The constant value for the 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 appendAsync(String directFilePath, String accountName, InputStream streamContents, String op, String append, 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 (op == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter op is required and cannot be null.")); + return null; + } + if (append == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter append 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("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.append(directFilePath, 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. + * @param op The constant value for the operation. + * @param write The constant value for the operation. + * @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, String op, String write, InputStream 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 (op == null) { + throw new IllegalArgumentException("Parameter op is required and cannot be null."); + } + if (write == null) { + throw new IllegalArgumentException("Parameter write 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("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.create(directFilePath, 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 op The constant value for the operation. + * @param write The constant value for the operation. + * @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, String op, String write, InputStream 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 (op == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter op is required and cannot be null.")); + return null; + } + if (write == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter write 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("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.create(directFilePath, 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. + * @param op The constant value for the operation. + * @param read The constant value for the operation. + * @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, String op, String read, 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 (op == null) { + throw new IllegalArgumentException("Parameter op is required and cannot be null."); + } + if (read == null) { + throw new IllegalArgumentException("Parameter read 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("{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 op The constant value for the operation. + * @param read The constant value for the operation. + * @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, String op, String read, 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 (op == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter op is required and cannot be null.")); + return null; + } + if (read == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter read 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("{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|-' + * @param op The constant value for the operation. + * @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, String op) 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 (op == null) { + throw new IllegalArgumentException("Parameter op 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("{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 op The constant value for the 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 setAclAsync(String setAclFilePath, String accountName, String aclspec, String op, 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 (op == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter op 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("{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|-' + * @param op The constant value for the operation. + * @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, String op) 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 (op == null) { + throw new IllegalArgumentException("Parameter op 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("{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 op The constant value for the 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 modifyAclEntriesAsync(String modifyAclFilePath, String accountName, String aclspec, String op, 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 (op == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter op 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("{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' + * @param op The constant value for the operation. + * @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, String op) 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 (op == null) { + throw new IllegalArgumentException("Parameter op 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("{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 op The constant value for the 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 removeAclEntriesAsync(String removeAclFilePath, String accountName, String aclspec, String op, 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 (op == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter op 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("{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. + * @param op The constant value for the operation. + * @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, String op) 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 (op == null) { + throw new IllegalArgumentException("Parameter op 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("{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 op The constant value for the 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 removeAclAsync(String aclFilePath, String accountName, String op, 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 (op == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter op 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("{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. + * @param op The constant value for the operation. + * @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, String op) 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 (op == null) { + throw new IllegalArgumentException("Parameter op 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("{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 op The constant value for the 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 getAclStatusAsync(String aclFilePath, String accountName, String op, 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 (op == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter op 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("{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. + * @param op The constant value for the operation. + * @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, String op, 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 (op == null) { + throw new IllegalArgumentException("Parameter op 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("{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 op The constant value for the operation. + * @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, String op, 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 (op == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter op 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("{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 + * @param op The constant value for the operation. + * @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, String op) 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 (op == null) { + throw new IllegalArgumentException("Parameter op 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("{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 op The constant value for the 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 renameAsync(String renameFilePath, String accountName, String destination, String op, 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 (op == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter op 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("{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. + * @param op The constant value for the operation. + * @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 op, 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 (op == null) { + throw new IllegalArgumentException("Parameter op 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("{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 op The constant value for the operation. + * @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 op, 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 (op == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter op 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("{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. + * @param op The constant value for the operation. + * @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 op, 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 (op == null) { + throw new IllegalArgumentException("Parameter op 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("{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 op The constant value for the operation. + * @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 op, 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 (op == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter op 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("{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..23274a1085e4 --- /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.15.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..4a79eae572c8 --- /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.15.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/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..a2285a7946a6 --- /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.15.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..3e183dda6bfc --- /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.15.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..068162c653bf --- /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.15.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..4e3db1c6524d --- /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.15.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..6cb073337848 --- /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.15.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..f599d96400a3 --- /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.15.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..7452976de9e1 --- /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.15.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..b1a58ad164f7 --- /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.15.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..d8e907b82d24 --- /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.15.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..482cfa247047 --- /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.15.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 booleanProperty; + + /** + * Get the booleanProperty value. + * + * @return the booleanProperty value + */ + public Boolean getBooleanProperty() { + return this.booleanProperty; + } + +} 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..9d9c90d40bfd --- /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.15.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..0249a6294ee9 --- /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.15.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..4547231c459b --- /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.15.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..2aed22885801 --- /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.15.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..866aefae759d --- /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.15.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..232063cef78e --- /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.15.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..333553418598 --- /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.15.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..3e94acc10a99 --- /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.15.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..04cda67881ed --- /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.15.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..3af3c4c58846 --- /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.15.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..16bc30496754 --- /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.15.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..3c8f0c804e52 --- /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.15.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..6267629654dd --- /dev/null +++ b/azure-mgmt-datalake-store/src/test/java/com/microsoft/azure/management/datalake/store/DataLakeStoreAccountOperationsTests.java @@ -0,0 +1,45 @@ +package com.microsoft.azure.management.resources; + +import com.microsoft.azure.management.resources.models.ResourceGroup; + +import org.junit.Assert; +import org.junit.Test; + +import java.util.HashMap; +import java.util.List; + +public class ResourceGroupsOperationsTests extends ResourceManagementTestBase { + @Test + public void canCreateResourceGroup() throws Exception { + String rgName = "javacsmrg"; + String location = "southcentralus"; + // Create + ResourceGroup group = new ResourceGroup(); + group.setLocation(location); + group.setTags(new HashMap()); + group.getTags().put("department", "finance"); + group.getTags().put("tagname", "tagvalue"); + resourceManagementClient.getResourceGroupsOperations().createOrUpdate(rgName, group); + // List + List listResult = resourceManagementClient.getResourceGroupsOperations().list(null, null).getBody(); + ResourceGroup groupResult = null; + for (ResourceGroup rg : listResult) { + if (rg.getName().equals(rgName)) { + groupResult = rg; + break; + } + } + Assert.assertNotNull(groupResult); + Assert.assertEquals("finance", groupResult.getTags().get("department")); + Assert.assertEquals("tagvalue", groupResult.getTags().get("tagname")); + Assert.assertEquals(location, groupResult.getLocation()); + // Get + ResourceGroup getGroup = resourceManagementClient.getResourceGroupsOperations().get(rgName).getBody(); + Assert.assertNotNull(getGroup); + Assert.assertEquals(rgName, getGroup.getName()); + Assert.assertEquals(location, getGroup.getLocation()); + // Delete + resourceManagementClient.getResourceGroupsOperations().delete(rgName); + Assert.assertFalse(resourceManagementClient.getResourceGroupsOperations().checkExistence(rgName).getBody()); + } +} 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..6267629654dd --- /dev/null +++ b/azure-mgmt-datalake-store/src/test/java/com/microsoft/azure/management/datalake/store/DataLakeStoreFilesystemOperationsTests.java @@ -0,0 +1,45 @@ +package com.microsoft.azure.management.resources; + +import com.microsoft.azure.management.resources.models.ResourceGroup; + +import org.junit.Assert; +import org.junit.Test; + +import java.util.HashMap; +import java.util.List; + +public class ResourceGroupsOperationsTests extends ResourceManagementTestBase { + @Test + public void canCreateResourceGroup() throws Exception { + String rgName = "javacsmrg"; + String location = "southcentralus"; + // Create + ResourceGroup group = new ResourceGroup(); + group.setLocation(location); + group.setTags(new HashMap()); + group.getTags().put("department", "finance"); + group.getTags().put("tagname", "tagvalue"); + resourceManagementClient.getResourceGroupsOperations().createOrUpdate(rgName, group); + // List + List listResult = resourceManagementClient.getResourceGroupsOperations().list(null, null).getBody(); + ResourceGroup groupResult = null; + for (ResourceGroup rg : listResult) { + if (rg.getName().equals(rgName)) { + groupResult = rg; + break; + } + } + Assert.assertNotNull(groupResult); + Assert.assertEquals("finance", groupResult.getTags().get("department")); + Assert.assertEquals("tagvalue", groupResult.getTags().get("tagname")); + Assert.assertEquals(location, groupResult.getLocation()); + // Get + ResourceGroup getGroup = resourceManagementClient.getResourceGroupsOperations().get(rgName).getBody(); + Assert.assertNotNull(getGroup); + Assert.assertEquals(rgName, getGroup.getName()); + Assert.assertEquals(location, getGroup.getLocation()); + // Delete + resourceManagementClient.getResourceGroupsOperations().delete(rgName); + Assert.assertFalse(resourceManagementClient.getResourceGroupsOperations().checkExistence(rgName).getBody()); + } +} 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..f52472d53964 --- /dev/null +++ b/azure-mgmt-datalake-store/src/test/java/com/microsoft/azure/management/datalake/store/DataLakeStoreManagementTestBase.java @@ -0,0 +1,20 @@ +package com.microsoft.azure.management.resources; + +import com.microsoft.azure.credentials.ApplicationTokenCredentials; +import okhttp3.logging.HttpLoggingInterceptor; + +public abstract class ResourceManagementTestBase { + protected ResourceManagementClient resourceManagementClient; + + public ResourceManagementTestBase() { + resourceManagementClient = new ResourceManagementClientImpl( + new ApplicationTokenCredentials( + System.getenv("arm.clientid"), + System.getenv("arm.domain"), + System.getenv("arm.secret"), + null) + ); + resourceManagementClient.setSubscriptionId(System.getenv("arm.subscriptionid")); + resourceManagementClient.setLogLevel(HttpLoggingInterceptor.Level.BODY); + } +} diff --git a/gulpfile.js b/gulpfile.js index 119c80db26cf..b0bed819361b 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -88,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.15.0-Nightly20160304'; // default if (args['autorest'] !== undefined) { autoRestVersion = args['autorest']; } From f1950b280c12f3fd8a7b948943b1538df95dde81 Mon Sep 17 00:00:00 2001 From: begoldsm Date: Thu, 10 Mar 2016 19:45:12 -0800 Subject: [PATCH 3/9] updates to include tests and proper pom files --- azure-mgmt-datalake-analytics/pom.xml | 29 +- ...taLakeAnalyticsAccountOperationsTests.java | 211 +++++++-- ...taLakeAnalyticsCatalogOperationsTests.java | 414 ++++++++++++++++-- .../DataLakeAnalyticsJobOperationsTests.java | 163 +++++-- .../DataLakeAnalyticsManagementTestBase.java | 111 ++++- azure-mgmt-datalake-store/pom.xml | 23 +- .../DataLakeStoreAccountOperationsTests.java | 4 +- ...ataLakeStoreFilesystemOperationsTests.java | 4 +- .../DataLakeStoreManagementTestBase.java | 43 +- azure/pom.xml | 2 + 10 files changed, 855 insertions(+), 149 deletions(-) diff --git a/azure-mgmt-datalake-analytics/pom.xml b/azure-mgmt-datalake-analytics/pom.xml index fa2b5e488a9a..52d3ca3b4754 100644 --- a/azure-mgmt-datalake-analytics/pom.xml +++ b/azure-mgmt-datalake-analytics/pom.xml @@ -50,6 +50,18 @@ com.microsoft.azure azure-client-runtime + + ${project.groupId} + azure-mgmt-resources + ${project.version} + test + + + ${project.groupId} + azure-mgmt-storage + ${project.version} + test + junit junit @@ -63,23 +75,6 @@ - - org.apache.maven.plugins - maven-help-plugin - 2.1.1 - - - validate - - evaluate - - - legal - - - - - org.apache.maven.plugins maven-compiler-plugin 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 index 6267629654dd..018e7e83c8e4 100644 --- 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 @@ -1,45 +1,200 @@ -package com.microsoft.azure.management.resources; +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 ResourceGroupsOperationsTests extends ResourceManagementTestBase { - @Test - public void canCreateResourceGroup() throws Exception { - String rgName = "javacsmrg"; - String location = "southcentralus"; - // Create +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); - group.setTags(new HashMap()); - group.getTags().put("department", "finance"); - group.getTags().put("tagname", "tagvalue"); resourceManagementClient.getResourceGroupsOperations().createOrUpdate(rgName, group); - // List - List listResult = resourceManagementClient.getResourceGroupsOperations().list(null, null).getBody(); - ResourceGroup groupResult = null; - for (ResourceGroup rg : listResult) { - if (rg.getName().equals(rgName)) { - groupResult = rg; + // 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 { + // delete the ADLA account first + dataLakeAnalyticsAccountManagementClient.getAccountOperations().delete(rgName, adlaAcct); + resourceManagementClient.getResourceGroupsOperations().delete(rgName); + } + @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(null, null, null, null, null, null, null, null, null).getBody(); + DataLakeAnalyticsAccount discoveredAcct = null; + for (DataLakeAnalyticsAccount acct : listResult) { + if (acct.getName().equals(adlaAcct)) { + discoveredAcct = acct; break; } } - Assert.assertNotNull(groupResult); - Assert.assertEquals("finance", groupResult.getTags().get("department")); - Assert.assertEquals("tagvalue", groupResult.getTags().get("tagname")); - Assert.assertEquals(location, groupResult.getLocation()); - // Get - ResourceGroup getGroup = resourceManagementClient.getResourceGroupsOperations().get(rgName).getBody(); - Assert.assertNotNull(getGroup); - Assert.assertEquals(rgName, getGroup.getName()); - Assert.assertEquals(location, getGroup.getLocation()); - // Delete - resourceManagementClient.getResourceGroupsOperations().delete(rgName); - Assert.assertFalse(resourceManagementClient.getResourceGroupsOperations().checkExistence(rgName).getBody()); + + 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()); + Assert.assertEquals(1, discoveredAcct.getProperties().getDataLakeStoreAccounts().size()); + Assert.assertEquals(adlsAcct, discoveredAcct.getProperties().getDataLakeStoreAccounts().get(0).getName()); + + // list within a resource group + listResult = dataLakeAnalyticsAccountManagementClient.getAccountOperations().listByResourceGroup(rgName, null, null, null, null, null, null, null, null, null).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()); + Assert.assertEquals(1, discoveredAcct.getProperties().getDataLakeStoreAccounts().size()); + Assert.assertEquals(adlsAcct, discoveredAcct.getProperties().getDataLakeStoreAccounts().get(0).getName()); + + // 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, null, null, null, null, null, null, null, null, null).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, null, null, null, null, null, null, null, null, null).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, null, null, null, null, null, null, null, null, null).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, null, null, null, null, null, null, null, null, null).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 index 6267629654dd..2a4780bbeb29 100644 --- 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 @@ -1,45 +1,401 @@ -package com.microsoft.azure.management.resources; +package com.microsoft.azure.management.datalake.analytics; +import com.microsoft.azure.CloudException; +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.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.USqlCredential; +import com.microsoft.azure.management.datalake.analytics.models.USqlDatabase; +import com.microsoft.azure.management.datalake.analytics.models.USqlJobProperties; +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.HashMap; +import java.util.ArrayList; import java.util.List; +import java.util.UUID; -public class ResourceGroupsOperationsTests extends ResourceManagementTestBase { - @Test - public void canCreateResourceGroup() throws Exception { - String rgName = "javacsmrg"; - String location = "southcentralus"; - // Create +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 {0}; CREATE DATABASE {0}; \n" + + "//Create Table\n" + + "CREATE TABLE {0}.dbo.{1}\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 {0}.dbo.{2};\n" + + "\n" + + "//create table weblogs on space-delimited website log data\n" + + "CREATE FUNCTION {0}.dbo.{2}()\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 {0}.dbo.{3} \n" + + "AS \n" + + " SELECT * FROM \n" + + " (\n" + + " VALUES(1,2),(2,4)\n" + + " ) \n" + + "AS \n" + + "T(a, b);\n" + + "CREATE PROCEDURE {0}.dbo.{4}()\n" + + "AS BEGIN\n" + + " CREATE VIEW {0}.dbo.{3} \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); + + public static void setup() throws Exception { + createClients(); ResourceGroup group = new ResourceGroup(); group.setLocation(location); - group.setTags(new HashMap()); - group.getTags().put("department", "finance"); - group.getTags().put("tagname", "tagvalue"); resourceManagementClient.getResourceGroupsOperations().createOrUpdate(rgName, group); - // List - List listResult = resourceManagementClient.getResourceGroupsOperations().list(null, null).getBody(); - ResourceGroup groupResult = null; - for (ResourceGroup rg : listResult) { - if (rg.getName().equals(rgName)) { - groupResult = rg; + // 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().toString(), catalogCreationScript); + } + + @AfterClass + public static void cleanup() throws Exception { + // delete the ADLA account first + dataLakeAnalyticsAccountManagementClient.getAccountOperations().delete(rgName, adlaAcct); + resourceManagementClient.getResourceGroupsOperations().delete(rgName); + } + @Test + public void canGetCatalogItems() throws Exception { + List dbListResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().listDatabases(adlaAcct, null, null, null, null, null, null, null).getBody(); + Assert.assertTrue(dbListResponse.size() >= 1); + + // look for the DB we created + boolean foundCatalogElement = false; + for (USqlDatabase db: dbListResponse) { + if (db.getDatabaseName().equals(dbName)) { + foundCatalogElement = true; break; } } - Assert.assertNotNull(groupResult); - Assert.assertEquals("finance", groupResult.getTags().get("department")); - Assert.assertEquals("tagvalue", groupResult.getTags().get("tagname")); - Assert.assertEquals(location, groupResult.getLocation()); - // Get - ResourceGroup getGroup = resourceManagementClient.getResourceGroupsOperations().get(rgName).getBody(); - Assert.assertNotNull(getGroup); - Assert.assertEquals(rgName, getGroup.getName()); - Assert.assertEquals(location, getGroup.getLocation()); - // Delete - resourceManagementClient.getResourceGroupsOperations().delete(rgName); - Assert.assertFalse(resourceManagementClient.getResourceGroupsOperations().checkExistence(rgName).getBody()); + Assert.assertTrue(foundCatalogElement); + + // Get the specific Database as well + USqlDatabase dbGetResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().getDatabase(dbName, adlaAcct).getBody(); + + Assert.assertEquals(dbName, dbGetResponse.getDatabaseName()); + + // Get the table list + List tableListResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().listTables(dbName, "dbo", adlaAcct, null, null, null, null, null, null, null).getBody(); + + Assert.assertTrue(tableListResponse.size() >= 1); + + // look for the table we created + foundCatalogElement = false; + for (USqlTable table: tableListResponse) { + if (table.getTableName().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.getTableName()); + + // Get the TVF list + List tvfListResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().listTableValuedFunctions(dbName, "dbo", adlaAcct, null, null, null, null, null, null, null).getBody(); + + Assert.assertTrue(tvfListResponse.size() >= 1); + + // look for the tvf we created + foundCatalogElement = false; + for (USqlTableValuedFunction tvf: tvfListResponse) { + if (tvf.getTvfName().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.getTvfName()); + + // Get the View list + List viewListResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().listViews(dbName, "dbo", adlaAcct, null, null, null, null, null, null, null).getBody(); + + Assert.assertTrue(viewListResponse.size() >= 1); + + // look for the view we created + foundCatalogElement = false; + for (USqlView view: viewListResponse) { + if (view.getViewName().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.getViewName()); + + // Get the Procedure list + List procListResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().listProcedures( + dbName, "dbo", adlaAcct, null, null, null, null, null, null, null).getBody(); + + Assert.assertTrue(procListResponse.size() >= 1); + + // look for the procedure we created + foundCatalogElement = false; + for (USqlProcedure proc: procListResponse) { + if (proc.getProcName().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.getProcName()); + + // Get all the types + List typeGetResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().listTypes( + dbName, "dbo", adlaAcct, null, null, null, null, null, null, null).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 {0}; CREATE CREDENTIAL {1} WITH USER_NAME = \"scope@rkm4grspxa\", IDENTITY = \"{2}\";", + dbName, credentialName, secretName); + + runJobToCompletion(dataLakeAnalyticsJobManagementClient, adlaAcct, UUID.randomUUID().toString(), credentialCreationScript); + + // Get the Credential list + List credListResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().listCredentials( + dbName, adlaAcct, null, null, null, null, null, null, null).getBody(); + Assert.assertTrue(credListResponse.size() >= 1); + + // look for the credential we created + boolean foundCatalogElement = false; + for (USqlCredential cred: credListResponse) { + if (cred.getCredentialName().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.getCredentialName()); + + // Drop the credential (to enable secret deletion) + String credentialDropScript = + String.format("USE {0}; DROP CREDENTIAL {1};", dbName, credentialName); + runJobToCompletion(dataLakeAnalyticsJobManagementClient, + adlaAcct, UUID.randomUUID().toString(), + 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 index 6267629654dd..45d46fa5a0aa 100644 --- 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 @@ -1,45 +1,150 @@ -package com.microsoft.azure.management.resources; +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.HashMap; +import java.util.ArrayList; import java.util.List; +import java.util.UUID; -public class ResourceGroupsOperationsTests extends ResourceManagementTestBase { - @Test - public void canCreateResourceGroup() throws Exception { - String rgName = "javacsmrg"; - String location = "southcentralus"; - // Create +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); - group.setTags(new HashMap()); - group.getTags().put("department", "finance"); - group.getTags().put("tagname", "tagvalue"); resourceManagementClient.getResourceGroupsOperations().createOrUpdate(rgName, group); - // List - List listResult = resourceManagementClient.getResourceGroupsOperations().list(null, null).getBody(); - ResourceGroup groupResult = null; - for (ResourceGroup rg : listResult) { - if (rg.getName().equals(rgName)) { - groupResult = rg; + // 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 { + // delete the ADLA account first + dataLakeAnalyticsAccountManagementClient.getAccountOperations().delete(rgName, adlaAcct); + resourceManagementClient.getResourceGroupsOperations().delete(rgName); + } + @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); + String jobId = UUID.randomUUID().toString(); + String secondJobId = UUID.randomUUID().toString(); + + 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: {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); + + 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.assertNotNull(groupResult); - Assert.assertEquals("finance", groupResult.getTags().get("department")); - Assert.assertEquals("tagvalue", groupResult.getTags().get("tagname")); - Assert.assertEquals(location, groupResult.getLocation()); - // Get - ResourceGroup getGroup = resourceManagementClient.getResourceGroupsOperations().get(rgName).getBody(); - Assert.assertNotNull(getGroup); - Assert.assertEquals(rgName, getGroup.getName()); - Assert.assertEquals(location, getGroup.getLocation()); - // Delete - resourceManagementClient.getResourceGroupsOperations().delete(rgName); - Assert.assertFalse(resourceManagementClient.getResourceGroupsOperations().checkExistence(rgName).getBody()); + + 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 index f52472d53964..aeed98ed10df 100644 --- 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 @@ -1,20 +1,107 @@ -package com.microsoft.azure.management.resources; +package com.microsoft.azure.management.datalake.analytics; import com.microsoft.azure.credentials.ApplicationTokenCredentials; +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.resources.ResourceManagementClient; +import com.microsoft.azure.management.resources.ResourceManagementClientImpl; +import com.microsoft.azure.management.datalake.store.DataLakeStoreAccountManagementClientImpl; +import com.microsoft.azure.management.datalake.store.DataLakeStoreAccountManagementClient; +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 ResourceManagementTestBase { - protected ResourceManagementClient resourceManagementClient; - - public ResourceManagementTestBase() { - resourceManagementClient = new ResourceManagementClientImpl( - new ApplicationTokenCredentials( - System.getenv("arm.clientid"), - System.getenv("arm.domain"), - System.getenv("arm.secret"), - null) - ); +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, String 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 index 9fc32649c86b..10ea0bea74d7 100644 --- a/azure-mgmt-datalake-store/pom.xml +++ b/azure-mgmt-datalake-store/pom.xml @@ -50,6 +50,12 @@ com.microsoft.azure azure-client-runtime + + ${project.groupId} + azure-mgmt-resources + ${project.version} + test + junit junit @@ -63,23 +69,6 @@ - - org.apache.maven.plugins - maven-help-plugin - 2.1.1 - - - validate - - evaluate - - - legal - - - - - org.apache.maven.plugins maven-compiler-plugin 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 index 6267629654dd..3e196930ab13 100644 --- 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 @@ -1,4 +1,4 @@ -package com.microsoft.azure.management.resources; +package com.microsoft.azure.management.datalake.store; import com.microsoft.azure.management.resources.models.ResourceGroup; @@ -8,7 +8,7 @@ import java.util.HashMap; import java.util.List; -public class ResourceGroupsOperationsTests extends ResourceManagementTestBase { +public class DataLakeStoreAccountOperationsTests extends DataLakeStoreManagementTestBase { @Test public void canCreateResourceGroup() throws Exception { String rgName = "javacsmrg"; 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 index 6267629654dd..cf5775a2a3ad 100644 --- 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 @@ -1,4 +1,4 @@ -package com.microsoft.azure.management.resources; +package com.microsoft.azure.management.datalake.store; import com.microsoft.azure.management.resources.models.ResourceGroup; @@ -8,7 +8,7 @@ import java.util.HashMap; import java.util.List; -public class ResourceGroupsOperationsTests extends ResourceManagementTestBase { +public class DataLakeStoreFilesystemOperationsTests extends DataLakeStoreManagementTestBase { @Test public void canCreateResourceGroup() throws Exception { String rgName = "javacsmrg"; 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 index f52472d53964..6be8e731ee08 100644 --- 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 @@ -1,20 +1,37 @@ -package com.microsoft.azure.management.resources; +package com.microsoft.azure.management.datalake.store; import com.microsoft.azure.credentials.ApplicationTokenCredentials; +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 org.junit.Assert; + +import java.util.UUID; + import okhttp3.logging.HttpLoggingInterceptor; -public abstract class ResourceManagementTestBase { - protected ResourceManagementClient resourceManagementClient; - - public ResourceManagementTestBase() { - resourceManagementClient = new ResourceManagementClientImpl( - new ApplicationTokenCredentials( - System.getenv("arm.clientid"), - System.getenv("arm.domain"), - System.getenv("arm.secret"), - null) - ); +public abstract class DataLakeStoreManagementTestBase { + protected static ResourceManagementClient resourceManagementClient; + protected static DataLakeStoreAccountManagementClient dataLakeStoreAccountManagementClient; + + 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")); } -} +} \ No newline at end of file diff --git a/azure/pom.xml b/azure/pom.xml index 44be6c92de7c..7db5552919f4 100644 --- a/azure/pom.xml +++ b/azure/pom.xml @@ -289,5 +289,7 @@ ../azure-mgmt-storage ../azure-mgmt-network ../azure-mgmt-website + ../azure-mgmt-datalake-analytics + ../azure-mgmt-datalake-store From d5208e01ee4d4d9090368b76a1c860769c1296a5 Mon Sep 17 00:00:00 2001 From: begoldsm Date: Fri, 11 Mar 2016 16:30:10 -0800 Subject: [PATCH 4/9] Updates to get tests running --- ...taLakeAnalyticsAccountOperationsTests.java | 20 ++- ...taLakeAnalyticsCatalogOperationsTests.java | 10 +- .../DataLakeAnalyticsJobOperationsTests.java | 10 +- .../DataLakeAnalyticsManagementTestBase.java | 1 - .../DataLakeStoreAccountOperationsTests.java | 128 ++++++++++++--- ...ataLakeStoreFilesystemOperationsTests.java | 152 ++++++++++++++---- .../DataLakeStoreManagementTestBase.java | 10 ++ 7 files changed, 262 insertions(+), 69 deletions(-) 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 index 018e7e83c8e4..9d5cf192b1a3 100644 --- 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 @@ -54,9 +54,13 @@ public static void setup() throws Exception { @AfterClass public static void cleanup() throws Exception { - // delete the ADLA account first - dataLakeAnalyticsAccountManagementClient.getAccountOperations().delete(rgName, adlaAcct); - resourceManagementClient.getResourceGroupsOperations().delete(rgName); + 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 { @@ -124,8 +128,9 @@ public void canCreateGetUpdateDeleteAdlaAccount() throws Exception { Assert.assertNotNull(discoveredAcct.getId()); Assert.assertTrue(discoveredAcct.getId().contains(adlaAcct)); Assert.assertEquals(2, discoveredAcct.getTags().size()); - Assert.assertEquals(1, discoveredAcct.getProperties().getDataLakeStoreAccounts().size()); - Assert.assertEquals(adlsAcct, discoveredAcct.getProperties().getDataLakeStoreAccounts().get(0).getName()); + + // 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, null, null, null, null, null, null, null, null, null).getBody(); @@ -143,8 +148,9 @@ public void canCreateGetUpdateDeleteAdlaAccount() throws Exception { Assert.assertNotNull(discoveredAcct.getId()); Assert.assertTrue(discoveredAcct.getId().contains(adlaAcct)); Assert.assertEquals(2, discoveredAcct.getTags().size()); - Assert.assertEquals(1, discoveredAcct.getProperties().getDataLakeStoreAccounts().size()); - Assert.assertEquals(adlsAcct, discoveredAcct.getProperties().getDataLakeStoreAccounts().get(0).getName()); + + // 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(); 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 index 2a4780bbeb29..9aa26c207e00 100644 --- 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 @@ -137,6 +137,7 @@ public class DataLakeAnalyticsCatalogOperationsTests extends DataLakeAnalyticsMa " T(a, b);\n" + "END;", dbName, tableName, tvfName, viewName, procName); + @BeforeClass public static void setup() throws Exception { createClients(); ResourceGroup group = new ResourceGroup(); @@ -173,8 +174,13 @@ public static void setup() throws Exception { @AfterClass public static void cleanup() throws Exception { // delete the ADLA account first - dataLakeAnalyticsAccountManagementClient.getAccountOperations().delete(rgName, adlaAcct); - resourceManagementClient.getResourceGroupsOperations().delete(rgName); + 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 { 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 index 45d46fa5a0aa..2594f472e669 100644 --- 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 @@ -60,9 +60,13 @@ public static void setup() throws Exception { @AfterClass public static void cleanup() throws Exception { - // delete the ADLA account first - dataLakeAnalyticsAccountManagementClient.getAccountOperations().delete(rgName, adlaAcct); - resourceManagementClient.getResourceGroupsOperations().delete(rgName); + 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 { 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 index aeed98ed10df..45221d9f7505 100644 --- 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 @@ -41,7 +41,6 @@ public static void createClients() { 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); 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 index 3e196930ab13..3277a9f6ad97 100644 --- 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 @@ -1,45 +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 { - @Test - public void canCreateResourceGroup() throws Exception { - String rgName = "javacsmrg"; - String location = "southcentralus"; - // Create + 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); - group.setTags(new HashMap()); - group.getTags().put("department", "finance"); - group.getTags().put("tagname", "tagvalue"); resourceManagementClient.getResourceGroupsOperations().createOrUpdate(rgName, group); - // List - List listResult = resourceManagementClient.getResourceGroupsOperations().list(null, null).getBody(); - ResourceGroup groupResult = null; - for (ResourceGroup rg : listResult) { - if (rg.getName().equals(rgName)) { - groupResult = rg; + } + + @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(null, null, null, null, null, null, null, null, null).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, null, null, null, null, null, null, null, null, null).getBody(); + discoveredAcct = null; + for (DataLakeStoreAccount acct : listResult) { + if (acct.getName().equals(adlsAcct)) { + discoveredAcct = acct; break; } } - Assert.assertNotNull(groupResult); - Assert.assertEquals("finance", groupResult.getTags().get("department")); - Assert.assertEquals("tagvalue", groupResult.getTags().get("tagname")); - Assert.assertEquals(location, groupResult.getLocation()); - // Get - ResourceGroup getGroup = resourceManagementClient.getResourceGroupsOperations().get(rgName).getBody(); - Assert.assertNotNull(getGroup); - Assert.assertEquals(rgName, getGroup.getName()); - Assert.assertEquals(location, getGroup.getLocation()); - // Delete - resourceManagementClient.getResourceGroupsOperations().delete(rgName); - Assert.assertFalse(resourceManagementClient.getResourceGroupsOperations().checkExistence(rgName).getBody()); + + 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 index cf5775a2a3ad..a34644c0c89d 100644 --- 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 @@ -1,45 +1,137 @@ package com.microsoft.azure.management.datalake.store; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.datalake.store.models.FileOperationResult; +import com.microsoft.azure.management.datalake.store.models.FileStatusResult; +import com.microsoft.azure.management.datalake.store.models.FileType; import com.microsoft.azure.management.resources.models.ResourceGroup; import org.junit.Assert; import org.junit.Test; +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.InputStreamReader; import java.util.HashMap; import java.util.List; +import sun.misc.IOUtils; + public class DataLakeStoreFilesystemOperationsTests extends DataLakeStoreManagementTestBase { - @Test - public void canCreateResourceGroup() throws Exception { - String rgName = "javacsmrg"; - String location = "southcentralus"; - // Create - ResourceGroup group = new ResourceGroup(); - group.setLocation(location); - group.setTags(new HashMap()); - group.getTags().put("department", "finance"); - group.getTags().put("tagname", "tagvalue"); - resourceManagementClient.getResourceGroupsOperations().createOrUpdate(rgName, group); - // List - List listResult = resourceManagementClient.getResourceGroupsOperations().list(null, null).getBody(); - ResourceGroup groupResult = null; - for (ResourceGroup rg : listResult) { - if (rg.getName().equals(rgName)) { - groupResult = rg; - break; + // constants + private static String folderToCreate = "SDKTestFolder01"; + private static String folderToMove = "SDKTestMoveFolder01"; + private static String fileToCreate = "SDKTestFile01.txt"; + private static String fileToCreateWithContents = "SDKTestFile02.txt"; + private static String fileToCopy = "SDKTestCopyFile01.txt"; + private static String fileToConcatTo = "SDKTestConcatFile01.txt"; + private static String fileToMove = "SDKTestMoveFile01.txt"; + + private static String fileContentsToAdd = "These are some random test contents 1234!@"; + private static String fileContentsToAppend = "More test contents, that were appended!"; + + // 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, null).getBody(); + Assert.assertTrue(response.getBooleanProperty()); + + return folderPath; + } + + private String CreateFile(String caboAccountName, boolean withContents, boolean randomName, String folderName) throws Exception + { + String filePath = randomName ? generateName(String.format("{0}/{1}", folderName, fileToCreate)) : String.format("{0}/{1}", folderName, fileToCreate); + + if (!withContents) + { + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().create( + filePath, + caboAccountName, + null, + "true", + new ByteArrayInputStream(new byte[]{}), null); + } + else + { + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().create( + filePath, + caboAccountName, + null, + "true", + new ByteArrayInputStream(fileContentsToAdd.getBytes()), null); + } + + return filePath; + } + + private FileStatusResult GetAndCompareFileOrFolder(String caboAccountName, String fileOrFolderPath, FileType expectedType, long expectedLength) throws Exception + { + FileStatusResult getResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(fileOrFolderPath, caboAccountName, null).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, null, null, null, null).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, null, recursive).getBody(); + Assert.assertTrue(!deleteFolderResponse.getBooleanProperty()); + } + catch (Exception e) + { + Assert.assertTrue(e instanceof CloudException); } } - Assert.assertNotNull(groupResult); - Assert.assertEquals("finance", groupResult.getTags().get("department")); - Assert.assertEquals("tagvalue", groupResult.getTags().get("tagname")); - Assert.assertEquals(location, groupResult.getLocation()); - // Get - ResourceGroup getGroup = resourceManagementClient.getResourceGroupsOperations().get(rgName).getBody(); - Assert.assertNotNull(getGroup); - Assert.assertEquals(rgName, getGroup.getName()); - Assert.assertEquals(location, getGroup.getLocation()); - // Delete - resourceManagementClient.getResourceGroupsOperations().delete(rgName); - Assert.assertFalse(resourceManagementClient.getResourceGroupsOperations().checkExistence(rgName).getBody()); + else + { + // Delete a folder + FileOperationResult deleteFolderResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().delete(folderPath, caboAccountName, null, recursive).getBody(); + Assert.assertTrue(deleteFolderResponse.getBooleanProperty()); + } + } + + 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, null, false).getBody(); + Assert.assertTrue(!deleteFileResponse.getBooleanProperty()); + } + catch (Exception e) + { + Assert.assertTrue(e instanceof CloudException); + } + } + else + { + // Delete a file + FileOperationResult deleteFileResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().delete(filePath, caboAccountName, null, false).getBody(); + Assert.assertTrue(deleteFileResponse.getBooleanProperty()); + } } } 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 index 6be8e731ee08..396a206c0bbd 100644 --- 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 @@ -16,6 +16,7 @@ public abstract class DataLakeStoreManagementTestBase { protected static ResourceManagementClient resourceManagementClient; protected static DataLakeStoreAccountManagementClient dataLakeStoreAccountManagementClient; + protected static DataLakeStoreFileSystemManagementClient dataLakeStoreFileSystemManagementClient; public static void createClients() { UserTokenCredentials credentials = new UserTokenCredentials( @@ -33,5 +34,14 @@ public static void createClients() { 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 From 86915d8af9d6040607b1ee20a90d8759d2aaf87b Mon Sep 17 00:00:00 2001 From: begoldsm Date: Mon, 14 Mar 2016 11:58:00 -0700 Subject: [PATCH 5/9] Add store dependency for tests. --- azure-mgmt-datalake-analytics/pom.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/azure-mgmt-datalake-analytics/pom.xml b/azure-mgmt-datalake-analytics/pom.xml index 52d3ca3b4754..c03e71f7506e 100644 --- a/azure-mgmt-datalake-analytics/pom.xml +++ b/azure-mgmt-datalake-analytics/pom.xml @@ -56,6 +56,12 @@ ${project.version} test + + ${project.groupId} + azure-mgmt-datalake-store + ${project.version} + test + ${project.groupId} azure-mgmt-storage From bbc17a2e1daed9c1d4248233538c04dbd27ca52a Mon Sep 17 00:00:00 2001 From: begoldsm Date: Mon, 14 Mar 2016 17:49:19 -0700 Subject: [PATCH 6/9] Add filesystem tests NOTE: these don't work yet until I get the new bits published from Jianghao. --- ...ataLakeStoreFilesystemOperationsTests.java | 647 +++++++++++++++++- 1 file changed, 646 insertions(+), 1 deletion(-) 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 index a34644c0c89d..d0a686e16601 100644 --- 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 @@ -1,17 +1,26 @@ 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.ByteArrayInputStream; import java.io.InputStream; import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; @@ -29,6 +38,642 @@ public class DataLakeStoreFilesystemOperationsTests extends DataLakeStoreManagem private static String fileContentsToAdd = "These are some random test contents 1234!@"; private static String fileContentsToAppend = "More test contents, that were appended!"; + + private static String rgName = generateName("javaadlsrg"); + private static String location = "eastus2"; + 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(); + 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, null).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 + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().append(filePath, + adlsAcct, + new ByteArrayInputStream(fileContentsToAdd.getBytes()), null, "true"); + + 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("{0}/{1}", targetFolder, fileToConcatTo), + adlsAcct, + Arrays.asList(new String[]{filePath1, filePath2}), null + ); + + GetAndCompareFileOrFolder(adlsAcct, + String.format("{0}/{1}", 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, null); + 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, null); + 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("{0}/{1}", targetFolder, fileToConcatTo), + adlsAcct, + new ByteArrayInputStream(String.format("sources={0},{1}", filePath1, filePath2).getBytes()), + null, + false); + + GetAndCompareFileOrFolder(adlsAcct, + String.format("{0}/{1}", 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, null); + 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, null); + 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("{0}/{1}", 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); + + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().msConcat( + String.format("{0}/{1}", targetFolder, fileToConcatTo), + adlsAcct, + new ByteArrayInputStream(String.format("sources={0},{1}", filePath1, filePath2).getBytes()), + null, + true); + + GetAndCompareFileOrFolder(adlsAcct, + String.format("{0}/{1}", 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, null); + 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, null); + 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, null); + 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 targetFolder2 = generateName(folderToMove); + + // Move file first + FileOperationResult moveFileResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().rename(filePath, + adlsAcct, + String.format("{0}/{1}", targetFolder1, fileToMove), + null).getBody(); + Assert.assertTrue(moveFileResponse.getBooleanProperty()); + GetAndCompareFileOrFolder(adlsAcct, + String.format("{0}/{1}", targetFolder1, fileToMove), + FileType.FILE, + fileContentsToAdd.length()); + + // Ensure the old file is gone + try { + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(filePath, adlsAcct, null); + 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, + null).getBody(); + Assert.assertTrue(moveFolderResponse.getBooleanProperty()); + + 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, null).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, null); + 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, null).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), + null); + + AclStatusResult newAcl = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getAclStatus("/", + adlsAcct, + null).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, null, "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, null); + + // Now confirm that it equals the original ACL + List finalEntries = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getAclStatus("/", + adlsAcct, + null).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, null).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, null).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, null).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:{0}:rwx", aclUserId); + + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().setAcl("/", + adlsAcct, + newAcls, + null); + + // retrieve the ACL again and confirm the new entry is present + aclGetResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getAclStatus("/", + adlsAcct, null).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, null).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:{0}:rwx", aclUserId); + + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().modifyAclEntries("/", + adlsAcct, + newAce, + null); + + // retrieve the ACL again and confirm the new entry is present + aclGetResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getAclStatus("/", + adlsAcct, + null).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:{0}", aclUserId); + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().removeAclEntries("/", + adlsAcct, + aceToRemove, + null); + + // retrieve the ACL again and confirm the new entry is present + aclGetResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getAclStatus("/", + adlsAcct, + null).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 @@ -73,7 +718,7 @@ private String CreateFile(String caboAccountName, boolean withContents, boolean private FileStatusResult GetAndCompareFileOrFolder(String caboAccountName, String fileOrFolderPath, FileType expectedType, long expectedLength) throws Exception { FileStatusResult getResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(fileOrFolderPath, caboAccountName, null).getBody(); - Assert.assertEquals(expectedLength, (long)getResponse.getFileStatus().getLength()); + Assert.assertEquals(expectedLength, (long) getResponse.getFileStatus().getLength()); Assert.assertEquals(expectedType, getResponse.getFileStatus().getType()); return getResponse; From 1fcb9727ed5b25b5f5bbe9369b5148aee3c31614 Mon Sep 17 00:00:00 2001 From: begoldsm Date: Tue, 15 Mar 2016 12:43:20 -0700 Subject: [PATCH 7/9] Updates to SDK based on nightly This gives us UUID support, friendly name support, optional parameters, constant support. --- .../datalake/analytics/AccountOperations.java | 108 +- .../analytics/AccountOperationsImpl.java | 407 +++- .../datalake/analytics/CatalogOperations.java | 256 ++- .../analytics/CatalogOperationsImpl.java | 1653 +++++++++++++++-- ...aLakeAnalyticsAccountManagementClient.java | 2 +- ...eAnalyticsAccountManagementClientImpl.java | 2 +- ...aLakeAnalyticsCatalogManagementClient.java | 2 +- ...eAnalyticsCatalogManagementClientImpl.java | 2 +- .../DataLakeAnalyticsJobManagementClient.java | 2 +- ...aLakeAnalyticsJobManagementClientImpl.java | 2 +- .../datalake/analytics/JobOperations.java | 75 +- .../datalake/analytics/JobOperationsImpl.java | 245 ++- .../models/AddDataLakeStoreParameters.java | 2 +- .../models/AddStorageAccountParameters.java | 2 +- .../models/AzureAsyncOperationResult.java | 2 +- .../analytics/models/BlobContainer.java | 2 +- .../models/BlobContainerProperties.java | 2 +- .../analytics/models/CatalogItem.java | 9 +- .../analytics/models/CatalogItemList.java | 2 +- .../models/DataLakeAnalyticsAccount.java | 2 +- .../DataLakeAnalyticsAccountProperties.java | 2 +- .../models/DataLakeAnalyticsAccountState.java | 2 +- .../DataLakeAnalyticsAccountStatus.java | 2 +- ...CatalogSecretCreateOrUpdateParameters.java | 2 +- .../models/DataLakeStoreAccountInfo.java | 2 +- .../DataLakeStoreAccountInfoProperties.java | 2 +- .../datalake/analytics/models/DdlName.java | 2 +- .../datalake/analytics/models/EntityId.java | 9 +- .../datalake/analytics/models/Error.java | 2 +- .../analytics/models/ErrorDetails.java | 2 +- .../analytics/models/ExternalTable.java | 2 +- .../datalake/analytics/models/FileType.java | 2 +- .../analytics/models/HiveJobProperties.java | 2 +- .../models/HiveJobStatementInfo.java | 2 +- .../datalake/analytics/models/InnerError.java | 2 +- .../analytics/models/JobDataPath.java | 7 +- .../analytics/models/JobErrorDetails.java | 2 +- .../analytics/models/JobInformation.java | 9 +- .../analytics/models/JobInnerError.java | 2 +- .../analytics/models/JobProperties.java | 2 +- .../analytics/models/JobResource.java | 2 +- .../datalake/analytics/models/JobResult.java | 2 +- .../datalake/analytics/models/JobState.java | 2 +- .../analytics/models/JobStateAuditRecord.java | 2 +- .../analytics/models/JobStatistics.java | 2 +- .../models/JobStatisticsVertexStage.java | 10 +- .../datalake/analytics/models/JobType.java | 2 +- .../analytics/models/OperationStatus.java | 2 +- .../datalake/analytics/models/PageImpl.java | 2 +- .../analytics/models/SasTokenInfo.java | 2 +- .../analytics/models/StorageAccountInfo.java | 2 +- .../models/StorageAccountProperties.java | 2 +- .../analytics/models/USqlAssembly.java | 22 +- .../analytics/models/USqlAssemblyClr.java | 22 +- .../models/USqlAssemblyDependencyInfo.java | 2 +- .../models/USqlAssemblyFileInfo.java | 2 +- .../analytics/models/USqlCredential.java | 22 +- .../analytics/models/USqlDatabase.java | 22 +- .../analytics/models/USqlDirectedColumn.java | 2 +- .../models/USqlDistributionInfo.java | 2 +- .../models/USqlExternalDataSource.java | 22 +- .../datalake/analytics/models/USqlIndex.java | 9 +- .../analytics/models/USqlJobProperties.java | 2 +- .../analytics/models/USqlProcedure.java | 22 +- .../datalake/analytics/models/USqlSchema.java | 22 +- .../datalake/analytics/models/USqlSecret.java | 22 +- .../datalake/analytics/models/USqlTable.java | 22 +- .../analytics/models/USqlTableColumn.java | 2 +- .../analytics/models/USqlTableStatistics.java | 22 +- .../models/USqlTableValuedFunction.java | 22 +- .../datalake/analytics/models/USqlType.java | 22 +- .../datalake/analytics/models/USqlView.java | 22 +- .../analytics/models/package-info.java | 6 +- .../datalake/analytics/package-info.java | 6 +- ...taLakeAnalyticsAccountOperationsTests.java | 12 +- ...taLakeAnalyticsCatalogOperationsTests.java | 50 +- .../DataLakeAnalyticsJobOperationsTests.java | 4 +- .../DataLakeAnalyticsManagementTestBase.java | 7 +- .../datalake/store/AccountOperations.java | 40 +- .../datalake/store/AccountOperationsImpl.java | 179 +- .../DataLakeStoreAccountManagementClient.java | 2 +- ...aLakeStoreAccountManagementClientImpl.java | 2 +- ...taLakeStoreFileSystemManagementClient.java | 2 +- ...keStoreFileSystemManagementClientImpl.java | 2 +- .../datalake/store/FileSystemOperations.java | 313 +++- .../store/FileSystemOperationsImpl.java | 1212 ++++++++---- .../datalake/store/models/AclStatus.java | 2 +- .../store/models/AclStatusResult.java | 2 +- .../datalake/store/models/AppendModeType.java | 56 + .../models/AzureAsyncOperationResult.java | 2 +- .../datalake/store/models/ContentSummary.java | 2 +- .../store/models/ContentSummaryResult.java | 2 +- .../store/models/DataLakeStoreAccount.java | 2 +- .../DataLakeStoreAccountProperties.java | 2 +- .../models/DataLakeStoreAccountState.java | 2 +- .../models/DataLakeStoreAccountStatus.java | 2 +- .../datalake/store/models/Error.java | 2 +- .../datalake/store/models/ErrorDetails.java | 2 +- .../store/models/FileOperationResult.java | 12 +- .../store/models/FileStatusProperties.java | 2 +- .../store/models/FileStatusResult.java | 2 +- .../datalake/store/models/FileStatuses.java | 2 +- .../store/models/FileStatusesResult.java | 2 +- .../datalake/store/models/FileType.java | 2 +- .../datalake/store/models/FirewallRule.java | 2 +- .../store/models/FirewallRuleProperties.java | 2 +- .../datalake/store/models/InnerError.java | 2 +- .../store/models/OperationStatus.java | 2 +- .../datalake/store/models/PageImpl.java | 2 +- .../datalake/store/models/package-info.java | 2 +- .../datalake/store/package-info.java | 2 +- .../DataLakeStoreAccountOperationsTests.java | 4 +- ...ataLakeStoreFilesystemOperationsTests.java | 112 +- .../DataLakeStoreManagementTestBase.java | 6 - gulpfile.js | 2 +- 115 files changed, 4156 insertions(+), 1096 deletions(-) create mode 100644 azure-mgmt-datalake-store/src/main/java/com/microsoft/azure/management/datalake/store/models/AppendModeType.java 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 index 118893d8a1b4..53b36e596e9f 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ @@ -333,6 +333,28 @@ public interface AccountOperations { */ 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. * @@ -343,7 +365,7 @@ public interface AccountOperations { * @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 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. @@ -364,7 +386,7 @@ public interface AccountOperations { * @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 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. @@ -374,6 +396,28 @@ public interface AccountOperations { */ 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. * @@ -384,7 +428,7 @@ public interface AccountOperations { * @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 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. @@ -405,7 +449,7 @@ public interface AccountOperations { * @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 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. @@ -415,6 +459,26 @@ public interface AccountOperations { */ 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. * @@ -424,7 +488,7 @@ public interface AccountOperations { * @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 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. @@ -444,7 +508,7 @@ public interface AccountOperations { * @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 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. @@ -454,6 +518,24 @@ public interface AccountOperations { */ 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. * @@ -462,7 +544,7 @@ public interface AccountOperations { * @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 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. @@ -481,7 +563,7 @@ public interface AccountOperations { * @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 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. @@ -562,7 +644,7 @@ public interface AccountOperations { ServiceCall beginDeleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** - * Begins the creation process for the specified Data Lake Analytics account.This supplies the user with computation services for Data Lake Analytics workloads. + * 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. @@ -576,7 +658,7 @@ public interface AccountOperations { ServiceResponse create(String resourceGroupName, String name, DataLakeAnalyticsAccount parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException; /** - * Begins the creation process for the specified Data Lake Analytics account.This supplies the user with computation services for Data Lake Analytics workloads. + * 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. @@ -588,7 +670,7 @@ public interface AccountOperations { ServiceCall createAsync(String resourceGroupName, String name, DataLakeAnalyticsAccount parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** - * Begins the creation process for the specified Data Lake Analytics account.This supplies the user with computation services for Data Lake Analytics workloads. + * 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. @@ -601,7 +683,7 @@ public interface AccountOperations { ServiceResponse beginCreate(String resourceGroupName, String name, DataLakeAnalyticsAccount parameters) throws CloudException, IOException, IllegalArgumentException; /** - * Begins the creation process for the specified Data Lake Analytics account.This supplies the user with computation services for Data Lake Analytics workloads. + * 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. 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 index 160a6c79a36d..f9b755f6044a 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ @@ -1276,6 +1276,108 @@ private ServiceResponse addDataLakeStoreAccountDelegate(Response> 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. * @@ -1286,7 +1388,7 @@ private ServiceResponse addDataLakeStoreAccountDelegate(Response> listStorageAccounts(final Strin * @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 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. @@ -1387,6 +1489,108 @@ private ServiceResponse> listStorageAccountsDelegat .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. * @@ -1397,7 +1601,7 @@ private ServiceResponse> listStorageAccountsDelegat * @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 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. @@ -1440,7 +1644,7 @@ public ServiceResponse> listDataLakeStoreAccounts * @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 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. @@ -1498,6 +1702,99 @@ private ServiceResponse> listDataLakeStoreAcc .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. * @@ -1507,7 +1804,7 @@ private ServiceResponse> listDataLakeStoreAcc * @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 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. @@ -1546,7 +1843,7 @@ public ServiceResponse> listByResourceGroup(final * @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 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. @@ -1600,6 +1897,90 @@ private ServiceResponse> listByResourceGroupD .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. * @@ -1608,7 +1989,7 @@ private ServiceResponse> listByResourceGroupD * @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 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. @@ -1643,7 +2024,7 @@ public ServiceResponse> list(final DataLakeAnalyt * @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 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. @@ -1920,7 +2301,7 @@ private ServiceResponse beginDeleteDelegate(Response respons } /** - * Begins the creation process for the specified Data Lake Analytics account.This supplies the user with computation services for Data Lake Analytics workloads. + * 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. @@ -1953,7 +2334,7 @@ public ServiceResponse create(String resourceGroupName } /** - * Begins the creation process for the specified Data Lake Analytics account.This supplies the user with computation services for Data Lake Analytics workloads. + * 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. @@ -1998,7 +2379,7 @@ public void onResponse(Call call, Response response) } /** - * Begins the creation process for the specified Data Lake Analytics account.This supplies the user with computation services for Data Lake Analytics workloads. + * 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. @@ -2030,7 +2411,7 @@ public ServiceResponse beginCreate(String resourceGrou } /** - * Begins the creation process for the specified Data Lake Analytics account.This supplies the user with computation services for Data Lake Analytics workloads. + * 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. 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 index 1111857f4ff7..9129cb0280c8 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ @@ -167,6 +167,28 @@ public interface CatalogOperations { */ 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. * @@ -229,6 +251,28 @@ public interface CatalogOperations { */ 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. * @@ -293,6 +337,30 @@ public interface CatalogOperations { */ 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. * @@ -359,6 +427,30 @@ public interface CatalogOperations { */ 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. * @@ -425,6 +517,30 @@ public interface CatalogOperations { */ 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. * @@ -493,6 +609,32 @@ public interface CatalogOperations { */ 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. * @@ -534,6 +676,30 @@ public interface CatalogOperations { */ 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. * @@ -600,6 +766,30 @@ public interface CatalogOperations { */ 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. * @@ -664,6 +854,28 @@ public interface CatalogOperations { */ 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. * @@ -726,6 +938,28 @@ public interface CatalogOperations { */ 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. * @@ -786,6 +1020,26 @@ public interface CatalogOperations { */ 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. * 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 index c978cf78f0c9..b6a6f5693ec6 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ @@ -734,6 +734,115 @@ private ServiceResponse getExternalDataSourceDelegate(Re .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. * @@ -948,6 +1057,115 @@ private ServiceResponse getCredentialDelegate(Response> 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. * @@ -1177,19 +1395,12 @@ private ServiceResponse getProcedureDelegate(Response> 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 { + 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."); } @@ -1208,6 +1419,13 @@ public ServiceResponse> listProcedures(final String database 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()); @@ -1226,18 +1444,11 @@ public ServiceResponse> listProcedures(final String database * @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 { + 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."); } @@ -1265,6 +1476,13 @@ public ServiceCall listProceduresAsync(final String databaseName, final String s 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()); @@ -1289,35 +1507,31 @@ public void onResponse(Call call, Response response) 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. + * Retrieves the list of procedures 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 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 USqlTable object wrapped in {@link ServiceResponse} if successful. + * @return the List<USqlProcedure> object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getTable(String databaseName, String schemaName, String tableName, String accountName) throws CloudException, IOException, IllegalArgumentException { + 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 (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."); } @@ -1332,22 +1546,144 @@ public ServiceResponse getTable(String databaseName, String schemaNam } 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()); + 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 specified table from the Data Lake Analytics catalog. + * Retrieves the list of procedures 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 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 getTableAsync(String databaseName, String schemaName, String tableName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + 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."); } @@ -1403,6 +1739,124 @@ private ServiceResponse getTableDelegate(Response respo .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. * @@ -1641,19 +2095,12 @@ private ServiceResponse getViewDelegate(Response respons * @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 { + 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."); } @@ -1672,6 +2119,13 @@ public ServiceResponse> listViews(final String databaseName, fina 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()); @@ -1690,18 +2144,11 @@ public ServiceResponse> listViews(final String databaseName, fina * @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 { + 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."); } @@ -1729,6 +2176,13 @@ public ServiceCall listViewsAsync(final String databaseName, final String schema 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()); @@ -1753,35 +2207,153 @@ public void onResponse(Call call, Response response) 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. + * Retrieves the list of views 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 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 USqlTableStatistics object wrapped in {@link ServiceResponse} if successful. + * @return the List<USqlView> object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getTableStatistic(String databaseName, String schemaName, String tableName, String statisticsName, String accountName) throws CloudException, IOException, IllegalArgumentException { + 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 (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.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."); @@ -1883,19 +2455,12 @@ private ServiceResponse getTableStatisticDelegate(Response< * @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 { + 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."); } @@ -1917,6 +2482,13 @@ public ServiceResponse> listTableStatistics(final Stri 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()); @@ -1936,18 +2508,11 @@ public ServiceResponse> listTableStatistics(final Stri * @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 { + 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."); } @@ -1979,6 +2544,13 @@ public ServiceCall listTableStatisticsAsync(final String databaseName, final Str 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()); @@ -2003,18 +2575,12 @@ public void onResponse(Call call, Response response) 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. + * Retrieves the list of tables 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 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. @@ -2026,15 +2592,18 @@ private ServiceResponse> listTableStatisticsDelega * @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. + * @return the List<USqlTableStatistics> 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 { + 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."); } @@ -2047,24 +2616,24 @@ public ServiceResponse> listTypes(final String databaseName, fina 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(); + 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 = listTypesNext(response.getBody().getNextPageLink()); + response = listTableStatisticsNext(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. + * Retrieves the list of tables 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 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. @@ -2077,7 +2646,7 @@ public ServiceResponse> listTypes(final String databaseName, fina * @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 { + 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."); } @@ -2089,6 +2658,10 @@ public ServiceCall listTypesAsync(final String databaseName, final String schema 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; @@ -2105,20 +2678,19 @@ public ServiceCall listTypesAsync(final String databaseName, final String schema 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()); + 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) { + call.enqueue(new ServiceResponseCallback>(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - ServiceResponse> result = listTypesDelegate(response); + ServiceResponse> result = listTableStatisticsDelegate(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); + listTableStatisticsNextAsync(result.getBody().getNextPageLink(), serviceCall, serviceCallback); } else { serviceCallback.success(new ServiceResponse<>(serviceCallback.get(), result.getResponse())); } @@ -2130,35 +2702,31 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse> listTypesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) - .register(200, new TypeToken>() { }.getType()) + 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 specified table valued function from the Data Lake Analytics catalog. + * 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 table valued function. - * @param schemaName The name of the schema containing the table valued function. - * @param tableValuedFunctionName The name of the tableValuedFunction. + * @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 USqlTableValuedFunction object wrapped in {@link ServiceResponse} if successful. + * @return the List<USqlType> object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getTableValuedFunction(String databaseName, String schemaName, String tableValuedFunctionName, String accountName) throws CloudException, IOException, IllegalArgumentException { + 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 (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."); } @@ -2171,24 +2739,36 @@ public ServiceResponse getTableValuedFunction(String da 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.getTableValuedFunction(databaseName, schemaName, tableValuedFunctionName, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); - return getTableValuedFunctionDelegate(call.execute()); + 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 specified table valued function from the Data Lake Analytics catalog. + * 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 table valued function. - * @param schemaName The name of the schema containing the table valued function. - * @param tableValuedFunctionName The name of the tableValuedFunction. + * @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 getTableValuedFunctionAsync(String databaseName, String schemaName, String tableValuedFunctionName, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + 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."); } @@ -2200,10 +2780,6 @@ public ServiceCall getTableValuedFunctionAsync(String databaseName, String schem 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; @@ -2220,15 +2796,29 @@ public ServiceCall getTableValuedFunctionAsync(String databaseName, String schem 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.getTableValuedFunction(databaseName, schemaName, tableValuedFunctionName, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + 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) { + call.enqueue(new ServiceResponseCallback>(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getTableValuedFunctionDelegate(response)); + 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); } @@ -2237,19 +2827,364 @@ public void onResponse(Call call, Response response) 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. + * 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 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 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. @@ -2299,18 +3234,123 @@ public ServiceResponse> listTableValuedFunctions(f * @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 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 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 { + 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."); } @@ -2318,8 +3358,8 @@ public ServiceCall listTableValuedFunctionsAsync(final String databaseName, fina 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.")); + if (assemblyName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter assemblyName is required and cannot be null.")); return null; } if (accountName == null) { @@ -2340,20 +3380,13 @@ public ServiceCall listTableValuedFunctionsAsync(final String databaseName, fina } 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()); + 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) { + 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())); - } + serviceCallback.success(getAssemblyDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -2362,31 +3395,27 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse> listTableValuedFunctionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder, CloudException>(this.client.getMapperAdapter()) - .register(200, new TypeToken>() { }.getType()) + 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 specified assembly from the Data Lake Analytics catalog. + * Retrieves the list of assemblies 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. + * @return the List<USqlAssemblyClr> object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getAssembly(String databaseName, String assemblyName, String accountName) throws CloudException, IOException, IllegalArgumentException { + 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 (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."); } @@ -2399,23 +3428,35 @@ public ServiceResponse getAssembly(String databaseName, String ass 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.getAssembly(databaseName, assemblyName, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); - return getAssemblyDelegate(call.execute()); + 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 specified assembly from the Data Lake Analytics catalog. + * Retrieves the list of assemblies 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 { + 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."); } @@ -2423,10 +3464,6 @@ public ServiceCall getAssemblyAsync(String databaseName, String assemblyName, St 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; @@ -2443,15 +3480,29 @@ public ServiceCall getAssemblyAsync(String databaseName, String assemblyName, St 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.getAssembly(databaseName, assemblyName, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + 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) { + call.enqueue(new ServiceResponseCallback>(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getAssemblyDelegate(response)); + 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); } @@ -2460,13 +3511,6 @@ public void onResponse(Call call, Response response) 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. * @@ -2681,6 +3725,115 @@ private ServiceResponse getSchemaDelegate(Response res .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. * @@ -2886,6 +4039,106 @@ private ServiceResponse getDatabaseDelegate(Response .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. * 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 index d41a286dd27e..daf1d8ab6e34 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 98c49f0d30e8..2d3d45337fc6 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index a57c1ae06464..3f2524eb5f2d 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 2ae6fff06c7c..e278937ff66c 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index fe159f99be3e..01d122b6cef8 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index c657f840b2d5..30f6ea227073 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 5bc307e80270..734034473dec 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ @@ -21,6 +21,7 @@ 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 @@ -37,7 +38,7 @@ public interface JobOperations { * @throws IllegalArgumentException exception thrown from invalid parameters * @return the JobStatistics object wrapped in {@link ServiceResponse} if successful. */ - ServiceResponse getStatistics(String jobIdentity, String accountName) throws CloudException, IOException, IllegalArgumentException; + ServiceResponse getStatistics(UUID jobIdentity, String accountName) throws CloudException, IOException, IllegalArgumentException; /** * Gets statistics of the specified job. @@ -48,7 +49,7 @@ public interface JobOperations { * @throws IllegalArgumentException thrown if callback is null * @return the {@link ServiceCall} object */ - ServiceCall getStatisticsAsync(String jobIdentity, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + ServiceCall getStatisticsAsync(UUID jobIdentity, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Gets the U-SQL job debug data information specified by the job ID. @@ -60,7 +61,7 @@ public interface JobOperations { * @throws IllegalArgumentException exception thrown from invalid parameters * @return the JobDataPath object wrapped in {@link ServiceResponse} if successful. */ - ServiceResponse getDebugDataPath(String jobIdentity, String accountName) throws CloudException, IOException, IllegalArgumentException; + ServiceResponse getDebugDataPath(UUID jobIdentity, String accountName) throws CloudException, IOException, IllegalArgumentException; /** * Gets the U-SQL job debug data information specified by the job ID. @@ -71,7 +72,7 @@ public interface JobOperations { * @throws IllegalArgumentException thrown if callback is null * @return the {@link ServiceCall} object */ - ServiceCall getDebugDataPathAsync(String jobIdentity, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + 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. @@ -97,76 +98,96 @@ public interface JobOperations { ServiceCall buildAsync(String accountName, JobInformation parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** - * Submits a job to the specified Data Lake Analytics account. + * Cancels the running job specified by the job ID. * - * @param jobId The job ID (a GUID) for the job being submitted. + * @param jobIdentity JobInfo ID to cancel. * @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. + * @return the {@link ServiceResponse} object if successful. */ - ServiceResponse create(String jobId, String accountName, JobInformation parameters) throws CloudException, IOException, IllegalArgumentException; + ServiceResponse cancel(UUID jobIdentity, String accountName) throws CloudException, IOException, IllegalArgumentException; /** - * Submits a job to the specified Data Lake Analytics account. + * Cancels the running job specified by the job ID. * - * @param jobId The job ID (a GUID) for the job being submitted. + * @param jobIdentity JobInfo ID to cancel. * @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(String jobId, String accountName, JobInformation parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException; + ServiceCall cancelAsync(UUID jobIdentity, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** - * Cancels the running job specified by the job ID. + * Gets the job information for the specified job ID. * - * @param jobIdentity JobInfo ID to cancel. + * @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 {@link ServiceResponse} object if successful. + * @return the JobInformation object wrapped in {@link ServiceResponse} if successful. */ - ServiceResponse cancel(String jobIdentity, String accountName) throws CloudException, IOException, IllegalArgumentException; + ServiceResponse get(UUID jobIdentity, String accountName) throws CloudException, IOException, IllegalArgumentException; /** - * Cancels the running job specified by the job ID. + * Gets the job information for the specified job ID. * - * @param jobIdentity JobInfo ID to cancel. + * @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 cancelAsync(String jobIdentity, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + ServiceCall getAsync(UUID jobIdentity, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** - * Gets the job information for the specified job ID. + * Submits a job to the specified Data Lake Analytics account. * - * @param jobIdentity JobInfo ID. + * @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 get(String jobIdentity, String accountName) throws CloudException, IOException, IllegalArgumentException; + ServiceResponse create(UUID jobIdentity, String accountName, JobInformation parameters) throws CloudException, IOException, IllegalArgumentException; /** - * Gets the job information for the specified job ID. + * Submits a job to the specified Data Lake Analytics account. * - * @param jobIdentity JobInfo ID. + * @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 getAsync(String jobIdentity, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + 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. * 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 index 88edf8fa75fc..3bfea469dde2 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ @@ -25,6 +25,7 @@ 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; @@ -67,27 +68,27 @@ public JobOperationsImpl(Retrofit retrofit, DataLakeAnalyticsJobManagementClient interface JobService { @Headers("Content-Type: application/json; charset=utf-8") @POST("Jobs/{jobIdentity}/GetStatistics") - Call getStatistics(@Path("jobIdentity") String jobIdentity, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + 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") String jobIdentity, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + 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") - @PUT("Jobs/{jobId}") - Call create(@Path("jobId") String jobId, @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") String jobIdentity, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + 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") String jobIdentity, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + 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") @@ -109,7 +110,7 @@ interface JobService { * @throws IllegalArgumentException exception thrown from invalid parameters * @return the JobStatistics object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getStatistics(String jobIdentity, String accountName) throws CloudException, IOException, IllegalArgumentException { + 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."); } @@ -140,7 +141,7 @@ public ServiceResponse getStatistics(String jobIdentity, String a * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getStatisticsAsync(String jobIdentity, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getStatisticsAsync(UUID jobIdentity, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -198,7 +199,7 @@ private ServiceResponse getStatisticsDelegate(Response getDebugDataPath(String jobIdentity, String accountName) throws CloudException, IOException, IllegalArgumentException { + 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."); } @@ -229,7 +230,7 @@ public ServiceResponse getDebugDataPath(String jobIdentity, String * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall getDebugDataPathAsync(String jobIdentity, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getDebugDataPathAsync(UUID jobIdentity, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -369,19 +370,18 @@ private ServiceResponse buildDelegate(Response res } /** - * Submits a job to the specified Data Lake Analytics account. + * Cancels the running job specified by the job ID. * - * @param jobId The job ID (a GUID) for the job being submitted. + * @param jobIdentity JobInfo ID to cancel. * @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. + * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse create(String jobId, String accountName, JobInformation parameters) throws CloudException, IOException, IllegalArgumentException { - if (jobId == null) { - throw new IllegalArgumentException("Parameter jobId is required and cannot be null."); + 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."); @@ -389,38 +389,33 @@ public ServiceResponse create(String jobId, String accountName, 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(jobId, parameters, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); - return createDelegate(call.execute()); + Call call = service.cancel(jobIdentity, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return cancelDelegate(call.execute()); } /** - * Submits a job to the specified Data Lake Analytics account. + * Cancels the running job specified by the job ID. * - * @param jobId The job ID (a GUID) for the job being submitted. + * @param jobIdentity JobInfo ID to cancel. * @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(String jobId, String accountName, JobInformation parameters, final ServiceCallback serviceCallback) throws IllegalArgumentException { + 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 (jobId == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter jobId is required and cannot be null.")); + if (jobIdentity == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter jobIdentity is required and cannot be null.")); return null; } if (accountName == null) { @@ -431,10 +426,6 @@ public ServiceCall createAsync(String jobId, String accountName, JobInformation 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; @@ -443,16 +434,15 @@ public ServiceCall createAsync(String jobId, String accountName, JobInformation 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(jobId, parameters, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + 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) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(createDelegate(response)); + serviceCallback.success(cancelDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -461,24 +451,23 @@ public void onResponse(Call call, Response response) 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) + private ServiceResponse cancelDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .build(response); } /** - * Cancels the running job specified by the job ID. + * Gets the job information for the specified job ID. * - * @param jobIdentity JobInfo ID to cancel. + * @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 {@link ServiceResponse} object if successful. + * @return the JobInformation object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse cancel(String jobIdentity, String accountName) throws CloudException, IOException, IllegalArgumentException { + 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."); } @@ -496,20 +485,20 @@ public ServiceResponse cancel(String jobIdentity, String accountName) thro } 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()); + Call call = service.get(jobIdentity, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return getDelegate(call.execute()); } /** - * Cancels the running job specified by the job ID. + * Gets the job information for the specified job ID. * - * @param jobIdentity JobInfo ID to cancel. + * @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 cancelAsync(String jobIdentity, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getAsync(UUID jobIdentity, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -535,13 +524,13 @@ public ServiceCall cancelAsync(String jobIdentity, String accountName, final Ser } 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()); + 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) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(cancelDelegate(response)); + serviceCallback.success(getDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -550,23 +539,25 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse cancelDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + 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); } /** - * Gets the job information for the specified job ID. + * Submits a job to the specified Data Lake Analytics account. * - * @param jobIdentity JobInfo ID. + * @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 get(String jobIdentity, String accountName) throws CloudException, IOException, IllegalArgumentException { + 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."); } @@ -576,28 +567,33 @@ public ServiceResponse get(String jobIdentity, String accountNam 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.get(jobIdentity, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); - return getDelegate(call.execute()); + Call call = service.create(jobIdentity, parameters, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return createDelegate(call.execute()); } /** - * Gets the job information for the specified job ID. + * Submits a job to the specified Data Lake Analytics account. * - * @param jobIdentity JobInfo ID. + * @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 getAsync(String jobIdentity, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + 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."); } @@ -613,6 +609,10 @@ public ServiceCall getAsync(String jobIdentity, String accountName, final Servic 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; @@ -621,15 +621,16 @@ public ServiceCall getAsync(String jobIdentity, String accountName, final Servic 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.get(jobIdentity, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + 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(getDelegate(response)); + serviceCallback.success(createDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -638,13 +639,117 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + 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. * 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 index d8828931aa11..7912d8ea8518 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 2e44c0058f60..3cb858cef566 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 38eac171d014..4014993ff193 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 4f4ac7de5b00..02f930b3748e 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 1454546c0645..f2f2c5765053 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index c67c4fea49ca..ddb453d36c38 100644 --- 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 @@ -3,13 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. @@ -23,7 +24,7 @@ public class CatalogItem { /** * Gets or sets the version of the catalog item. */ - private String version; + private UUID version; /** * Get the computeAccountName value. @@ -48,7 +49,7 @@ public void setComputeAccountName(String computeAccountName) { * * @return the version value */ - public String getVersion() { + public UUID getVersion() { return this.version; } @@ -57,7 +58,7 @@ public String getVersion() { * * @param version the version value to set */ - public void setVersion(String version) { + 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 index 420ceb7dc66c..9b96b0c5d695 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 8a835371256f..25a3142e591e 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 495652144079..1668945a443a 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index ef19b5b52c0f..5f62e8677281 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index dd7942e54b91..06229889fc0f 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 8e0068e5e052..e233a5df856b 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 95b7e1e70aa6..48947f662028 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 656475f59022..0f1f292285e3 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index d99728e55910..4b7adf7b31e5 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 00f929a6781c..a744a8ef75dc 100644 --- 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 @@ -3,13 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. @@ -24,7 +25,7 @@ public class EntityId { /** * Gets or sets the version of the external data source. */ - private String version; + private UUID version; /** * Get the name value. @@ -49,7 +50,7 @@ public void setName(DdlName name) { * * @return the version value */ - public String getVersion() { + public UUID getVersion() { return this.version; } @@ -58,7 +59,7 @@ public String getVersion() { * * @param version the version value to set */ - public void setVersion(String version) { + 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 index 32c470553f16..923ed0168954 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 36aa9d36ea5e..4da38e6e5291 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index c85cb3dd28b0..c9e86b1160e5 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 0099451ddae5..80f25ce1547d 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 21a36579a3aa..d2c61365db75 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 734b89c2a06d..4dc4f22a664e 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index febe79c72b11..898d7d18db8f 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 153544f6794e..78ba3b7e18d8 100644 --- 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 @@ -3,13 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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; @@ -21,7 +22,7 @@ public class JobDataPath { * Gets the id of the job this data is for. */ @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) - private String jobId; + private UUID jobId; /** * Gets the command that this job data relates to. @@ -40,7 +41,7 @@ public class JobDataPath { * * @return the jobId value */ - public String getJobId() { + public UUID getJobId() { return this.jobId; } 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 index 25a90de4abd1..e3f29be643cc 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 18020d9cf5e2..1ce54b31a2e9 100644 --- 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 @@ -3,13 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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; @@ -21,7 +22,7 @@ public class JobInformation { /** * Gets or sets the job's unique identifier (a GUID). */ - private String jobId; + private UUID jobId; /** * Gets or sets the friendly name of the job. @@ -113,7 +114,7 @@ public class JobInformation { * * @return the jobId value */ - public String getJobId() { + public UUID getJobId() { return this.jobId; } @@ -122,7 +123,7 @@ public String getJobId() { * * @param jobId the jobId value to set */ - public void setJobId(String jobId) { + public void setJobId(UUID jobId) { this.jobId = jobId; } 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 index 2e4f545760ed..e7527301b392 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index c7251e2aff5f..4b57029307af 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 5a026bd8009c..78d58444319d 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index d18aabed938a..6efbab0d8120 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index d80f1e827ede..65b7c7a135d3 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index ce1e5a8d4069..8755e70f5ecf 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 2950c9c52040..7286d00f9ad8 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 99578b99f9ed..d0c1d509c442 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ @@ -122,7 +122,7 @@ public class JobStatisticsVertexStage { * Gets the amount of time that failed vertices took up in this stage. */ @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) - private Long totalFailedTime; + private String totalFailedTime; /** * Gets the current progress of this stage, as a percentage. @@ -134,7 +134,7 @@ public class JobStatisticsVertexStage { * Gets the amount of time all successful vertices took in this stage. */ @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) - private Long totalSucceededTime; + private String totalSucceededTime; /** * Get the dataRead value. @@ -294,7 +294,7 @@ public Integer getTotalCount() { * * @return the totalFailedTime value */ - public Long getTotalFailedTime() { + public String getTotalFailedTime() { return this.totalFailedTime; } @@ -312,7 +312,7 @@ public Integer getTotalProgress() { * * @return the totalSucceededTime value */ - public Long getTotalSucceededTime() { + 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 index 9193c134c44e..6c401da2a707 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 6ed0c0a99d01..0a1c5249c8fa 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 84ad9d383073..ea298a8d5a02 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 6a847a626148..ae2689092ca0 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 571388827408..1879f3a067d3 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index f030ae0fa00c..5c52a2f5c697 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 2c9280f8adc1..8be1584ef963 100644 --- 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 @@ -3,13 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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; /** @@ -24,7 +25,8 @@ public class USqlAssembly extends CatalogItem { /** * Gets or sets the name of the assembly. */ - private String assemblyName; + @JsonProperty(value = "assemblyName") + private String name; /** * Gets or sets the name of the CLR. @@ -71,21 +73,21 @@ public void setDatabaseName(String databaseName) { } /** - * Get the assemblyName value. + * Get the name value. * - * @return the assemblyName value + * @return the name value */ - public String getAssemblyName() { - return this.assemblyName; + public String getName() { + return this.name; } /** - * Set the assemblyName value. + * Set the name value. * - * @param assemblyName the assemblyName value to set + * @param name the name value to set */ - public void setAssemblyName(String assemblyName) { - this.assemblyName = assemblyName; + 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/USqlAssemblyClr.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlAssemblyClr.java index 1e8f6ec836eb..224ddc1234e5 100644 --- 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 @@ -3,13 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. @@ -23,7 +24,8 @@ public class USqlAssemblyClr extends CatalogItem { /** * Gets or sets the name of the assembly. */ - private String assemblyClrName; + @JsonProperty(value = "assemblyClrName") + private String name; /** * Gets or sets the name of the CLR. @@ -49,21 +51,21 @@ public void setDatabaseName(String databaseName) { } /** - * Get the assemblyClrName value. + * Get the name value. * - * @return the assemblyClrName value + * @return the name value */ - public String getAssemblyClrName() { - return this.assemblyClrName; + public String getName() { + return this.name; } /** - * Set the assemblyClrName value. + * Set the name value. * - * @param assemblyClrName the assemblyClrName value to set + * @param name the name value to set */ - public void setAssemblyClrName(String assemblyClrName) { - this.assemblyClrName = assemblyClrName; + 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/USqlAssemblyDependencyInfo.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlAssemblyDependencyInfo.java index d996b2e90cb8..ea99672fadf1 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 87c88787e633..38c9fd495fcc 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 605972b19ee2..6ec28ee2d5a5 100644 --- 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 @@ -3,13 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. @@ -28,7 +29,8 @@ public class USqlCredential extends CatalogItem { /** * Gets or sets the name of the credential. */ - private String credentialName; + @JsonProperty(value = "credentialName") + private String name; /** * Gets or sets the user name associated with the credential. @@ -72,21 +74,21 @@ public void setIdentity(String identity) { } /** - * Get the credentialName value. + * Get the name value. * - * @return the credentialName value + * @return the name value */ - public String getCredentialName() { - return this.credentialName; + public String getName() { + return this.name; } /** - * Set the credentialName value. + * Set the name value. * - * @param credentialName the credentialName value to set + * @param name the name value to set */ - public void setCredentialName(String credentialName) { - this.credentialName = credentialName; + 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/USqlDatabase.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlDatabase.java index 95d7d9f128f4..36e1c93c0607 100644 --- 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 @@ -3,13 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. @@ -18,24 +19,25 @@ public class USqlDatabase extends CatalogItem { /** * Gets or sets the name of the database. */ - private String databaseName; + @JsonProperty(value = "databaseName") + private String name; /** - * Get the databaseName value. + * Get the name value. * - * @return the databaseName value + * @return the name value */ - public String getDatabaseName() { - return this.databaseName; + public String getName() { + return this.name; } /** - * Set the databaseName value. + * Set the name value. * - * @param databaseName the databaseName value to set + * @param name the name value to set */ - public void setDatabaseName(String databaseName) { - this.databaseName = databaseName; + 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 index bb0ca2f548cb..eb5c7aa6fab3 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 6fc62154bbc4..d848ed5c455b 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 2cccd5e3081d..a225d11e8a32 100644 --- 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 @@ -3,13 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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; /** @@ -24,7 +25,8 @@ public class USqlExternalDataSource extends CatalogItem { /** * Gets or sets the name of the external data source. */ - private String externalDataSourceName; + @JsonProperty(value = "externalDataSourceName") + private String name; /** * Gets or sets the name of the provider for the external data source. @@ -62,21 +64,21 @@ public void setDatabaseName(String databaseName) { } /** - * Get the externalDataSourceName value. + * Get the name value. * - * @return the externalDataSourceName value + * @return the name value */ - public String getExternalDataSourceName() { - return this.externalDataSourceName; + public String getName() { + return this.name; } /** - * Set the externalDataSourceName value. + * Set the name value. * - * @param externalDataSourceName the externalDataSourceName value to set + * @param name the name value to set */ - public void setExternalDataSourceName(String externalDataSourceName) { - this.externalDataSourceName = externalDataSourceName; + 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/USqlIndex.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlIndex.java index ee311ad55407..138b6cbd16be 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ @@ -11,6 +11,7 @@ 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. @@ -39,7 +40,7 @@ public class USqlIndex { /** * Gets or sets partition function ID for the index. */ - private String partitionFunction; + private UUID partitionFunction; /** * Gets or sets the list of partion keys in the index. @@ -144,7 +145,7 @@ public void setDistributionInfo(USqlDistributionInfo distributionInfo) { * * @return the partitionFunction value */ - public String getPartitionFunction() { + public UUID getPartitionFunction() { return this.partitionFunction; } @@ -153,7 +154,7 @@ public String getPartitionFunction() { * * @param partitionFunction the partitionFunction value to set */ - public void setPartitionFunction(String partitionFunction) { + public void setPartitionFunction(UUID partitionFunction) { this.partitionFunction = partitionFunction; } 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 index 3c05e02fc6ce..00db240b0443 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index c7ba1c05208f..66e72c1860e3 100644 --- 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 @@ -3,13 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. @@ -29,7 +30,8 @@ public class USqlProcedure extends CatalogItem { /** * Gets or sets the name of the procedure. */ - private String procName; + @JsonProperty(value = "procName") + private String name; /** * Gets or sets the defined query of the procedure. @@ -73,21 +75,21 @@ public void setSchemaName(String schemaName) { } /** - * Get the procName value. + * Get the name value. * - * @return the procName value + * @return the name value */ - public String getProcName() { - return this.procName; + public String getName() { + return this.name; } /** - * Set the procName value. + * Set the name value. * - * @param procName the procName value to set + * @param name the name value to set */ - public void setProcName(String procName) { - this.procName = procName; + 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/USqlSchema.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlSchema.java index a256ac06b9a8..dbc96cfe6b42 100644 --- 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 @@ -3,13 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. @@ -23,7 +24,8 @@ public class USqlSchema extends CatalogItem { /** * Gets or sets the name of the schema. */ - private String schemaName; + @JsonProperty(value = "schemaName") + private String name; /** * Get the databaseName value. @@ -44,21 +46,21 @@ public void setDatabaseName(String databaseName) { } /** - * Get the schemaName value. + * Get the name value. * - * @return the schemaName value + * @return the name value */ - public String getSchemaName() { - return this.schemaName; + public String getName() { + return this.name; } /** - * Set the schemaName value. + * Set the name value. * - * @param schemaName the schemaName value to set + * @param name the name value to set */ - public void setSchemaName(String schemaName) { - this.schemaName = schemaName; + 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 index 1f39eba80cce..cee443122fa3 100644 --- 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 @@ -3,13 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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; /** @@ -24,7 +25,8 @@ public class USqlSecret extends CatalogItem { /** * Gets or sets the name of the secret. */ - private String secretName; + @JsonProperty(value = "secretName") + private String name; /** * Gets or sets the creation time of the credential object. This is the @@ -62,21 +64,21 @@ public void setDatabaseName(String databaseName) { } /** - * Get the secretName value. + * Get the name value. * - * @return the secretName value + * @return the name value */ - public String getSecretName() { - return this.secretName; + public String getName() { + return this.name; } /** - * Set the secretName value. + * Set the name value. * - * @param secretName the secretName value to set + * @param name the name value to set */ - public void setSecretName(String secretName) { - this.secretName = secretName; + 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/USqlTable.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlTable.java index 6343225dee93..e83c0fba83f0 100644 --- 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 @@ -3,13 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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; /** @@ -30,7 +31,8 @@ public class USqlTable extends CatalogItem { /** * Gets or sets the name of the table. */ - private String tableName; + @JsonProperty(value = "tableName") + private String name; /** * Gets or sets the list of columns in this table. @@ -89,21 +91,21 @@ public void setSchemaName(String schemaName) { } /** - * Get the tableName value. + * Get the name value. * - * @return the tableName value + * @return the name value */ - public String getTableName() { - return this.tableName; + public String getName() { + return this.name; } /** - * Set the tableName value. + * Set the name value. * - * @param tableName the tableName value to set + * @param name the name value to set */ - public void setTableName(String tableName) { - this.tableName = tableName; + 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/USqlTableColumn.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlTableColumn.java index bb6d0ffc83d0..27ce6b41f2d0 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 73f4e98de73e..07581bcf141b 100644 --- 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 @@ -3,13 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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; @@ -36,7 +37,8 @@ public class USqlTableStatistics extends CatalogItem { /** * Gets or sets the name of the table statistics. */ - private String statisticsName; + @JsonProperty(value = "statisticsName") + private String name; /** * Gets or sets the name of the user statistics. @@ -139,21 +141,21 @@ public void setTableName(String tableName) { } /** - * Get the statisticsName value. + * Get the name value. * - * @return the statisticsName value + * @return the name value */ - public String getStatisticsName() { - return this.statisticsName; + public String getName() { + return this.name; } /** - * Set the statisticsName value. + * Set the name value. * - * @param statisticsName the statisticsName value to set + * @param name the name value to set */ - public void setStatisticsName(String statisticsName) { - this.statisticsName = statisticsName; + 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/USqlTableValuedFunction.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlTableValuedFunction.java index d92038fa34a8..024afd5bbe07 100644 --- 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 @@ -3,13 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. @@ -28,7 +29,8 @@ public class USqlTableValuedFunction extends CatalogItem { /** * Gets or sets the name of the table valued function. */ - private String tvfName; + @JsonProperty(value = "tvfName") + private String name; /** * Gets or sets the definition of the table valued function. @@ -72,21 +74,21 @@ public void setSchemaName(String schemaName) { } /** - * Get the tvfName value. + * Get the name value. * - * @return the tvfName value + * @return the name value */ - public String getTvfName() { - return this.tvfName; + public String getName() { + return this.name; } /** - * Set the tvfName value. + * Set the name value. * - * @param tvfName the tvfName value to set + * @param name the name value to set */ - public void setTvfName(String tvfName) { - this.tvfName = tvfName; + 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/USqlType.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlType.java index e227171ebd65..8abe187f8fd8 100644 --- 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 @@ -3,13 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. @@ -29,7 +30,8 @@ public class USqlType extends CatalogItem { /** * Gets or sets the name of type for this type. */ - private String typeName; + @JsonProperty(value = "typeName") + private String name; /** * Gets or sets the type family for this type. @@ -128,21 +130,21 @@ public void setSchemaName(String schemaName) { } /** - * Get the typeName value. + * Get the name value. * - * @return the typeName value + * @return the name value */ - public String getTypeName() { - return this.typeName; + public String getName() { + return this.name; } /** - * Set the typeName value. + * Set the name value. * - * @param typeName the typeName value to set + * @param name the name value to set */ - public void setTypeName(String typeName) { - this.typeName = typeName; + 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/USqlView.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/USqlView.java index 6a55dfa0790a..0406b55c4e6c 100644 --- 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 @@ -3,13 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. @@ -29,7 +30,8 @@ public class USqlView extends CatalogItem { /** * Gets or sets the name of the view. */ - private String viewName; + @JsonProperty(value = "viewName") + private String name; /** * Gets or sets the defined query of the view. @@ -73,21 +75,21 @@ public void setSchemaName(String schemaName) { } /** - * Get the viewName value. + * Get the name value. * - * @return the viewName value + * @return the name value */ - public String getViewName() { - return this.viewName; + public String getName() { + return this.name; } /** - * Set the viewName value. + * Set the name value. * - * @param viewName the viewName value to set + * @param name the name value to set */ - public void setViewName(String viewName) { - this.viewName = viewName; + 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/package-info.java b/azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/package-info.java index 53db045d389b..cf09f9019c63 100644 --- 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 @@ -2,12 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 +// 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 DataLakeAnalyticsCatalogManagementClient. - * Creates an Azure Data Lake Analytics catalog client. + * 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 index 338814b0f1c4..6be25ff10f99 100644 --- 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 @@ -2,12 +2,12 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 +// 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 DataLakeAnalyticsCatalogManagementClient. - * Creates an Azure Data Lake Analytics catalog client. + * 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 index 9d5cf192b1a3..93a2f99f5d2d 100644 --- 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 @@ -113,7 +113,7 @@ public void canCreateGetUpdateDeleteAdlaAccount() throws Exception { Assert.assertEquals(adlsAcct, getResponse.getProperties().getDataLakeStoreAccounts().get(0).getName()); // list all accounts and make sure there is one. - List listResult = dataLakeAnalyticsAccountManagementClient.getAccountOperations().list(null, null, null, null, null, null, null, null, null).getBody(); + List listResult = dataLakeAnalyticsAccountManagementClient.getAccountOperations().list().getBody(); DataLakeAnalyticsAccount discoveredAcct = null; for (DataLakeAnalyticsAccount acct : listResult) { if (acct.getName().equals(adlaAcct)) { @@ -133,7 +133,7 @@ public void canCreateGetUpdateDeleteAdlaAccount() throws Exception { Assert.assertNull(discoveredAcct.getProperties().getDataLakeStoreAccounts()); // list within a resource group - listResult = dataLakeAnalyticsAccountManagementClient.getAccountOperations().listByResourceGroup(rgName, null, null, null, null, null, null, null, null, null).getBody(); + listResult = dataLakeAnalyticsAccountManagementClient.getAccountOperations().listByResourceGroup(rgName).getBody(); discoveredAcct = null; for (DataLakeAnalyticsAccount acct : listResult) { if (acct.getName().equals(adlaAcct)) { @@ -160,7 +160,7 @@ public void canCreateGetUpdateDeleteAdlaAccount() throws Exception { dataLakeAnalyticsAccountManagementClient.getAccountOperations().addDataLakeStoreAccount(rgName, adlaAcct, adlsAcct2, addAdlsParams); // list ADLS accounts - List adlsListResult = dataLakeAnalyticsAccountManagementClient.getAccountOperations().listDataLakeStoreAccounts(rgName, adlaAcct, null, null, null, null, null, null, null, null, null).getBody(); + List adlsListResult = dataLakeAnalyticsAccountManagementClient.getAccountOperations().listDataLakeStoreAccounts(rgName, adlaAcct).getBody(); Assert.assertEquals(2, adlsListResult.size()); // get the one we just added @@ -171,7 +171,7 @@ public void canCreateGetUpdateDeleteAdlaAccount() throws Exception { dataLakeAnalyticsAccountManagementClient.getAccountOperations().deleteDataLakeStoreAccount(rgName, adlaAcct, adlsAcct2); // list again, confirming there is only one ADLS account - adlsListResult = dataLakeAnalyticsAccountManagementClient.getAccountOperations().listDataLakeStoreAccounts(rgName, adlaAcct, null, null, null, null, null, null, null, null, null).getBody(); + adlsListResult = dataLakeAnalyticsAccountManagementClient.getAccountOperations().listDataLakeStoreAccounts(rgName, adlaAcct).getBody(); Assert.assertEquals(1, adlsListResult.size()); // Add, list get and remove an azure blob account @@ -183,7 +183,7 @@ public void canCreateGetUpdateDeleteAdlaAccount() throws Exception { dataLakeAnalyticsAccountManagementClient.getAccountOperations().addStorageAccount(rgName, adlaAcct, storageAcct, addStoreParams); // list ADLS accounts - List storeListResult = dataLakeAnalyticsAccountManagementClient.getAccountOperations().listStorageAccounts(rgName, adlaAcct, null, null, null, null, null, null, null, null, null).getBody(); + List storeListResult = dataLakeAnalyticsAccountManagementClient.getAccountOperations().listStorageAccounts(rgName, adlaAcct).getBody(); Assert.assertEquals(1, storeListResult.size()); // get the one we just added @@ -194,7 +194,7 @@ public void canCreateGetUpdateDeleteAdlaAccount() throws Exception { dataLakeAnalyticsAccountManagementClient.getAccountOperations().deleteStorageAccount(rgName, adlaAcct, storageAcct); // list again, confirming there is only one ADLS account - storeListResult = dataLakeAnalyticsAccountManagementClient.getAccountOperations().listStorageAccounts(rgName, adlaAcct, null, null, null, null, null, null, null, null, null).getBody(); + storeListResult = dataLakeAnalyticsAccountManagementClient.getAccountOperations().listStorageAccounts(rgName, adlaAcct).getBody(); Assert.assertEquals(0, storeListResult.size()); // Delete the ADLA account 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 index 9aa26c207e00..7b86dc6064dc 100644 --- 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 @@ -1,17 +1,11 @@ package com.microsoft.azure.management.datalake.analytics; -import com.microsoft.azure.CloudException; 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.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.USqlCredential; import com.microsoft.azure.management.datalake.analytics.models.USqlDatabase; -import com.microsoft.azure.management.datalake.analytics.models.USqlJobProperties; 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; @@ -168,7 +162,7 @@ public static void setup() throws Exception { Thread.sleep(120000); // create the catalog - runJobToCompletion(dataLakeAnalyticsJobManagementClient, adlaAcct, UUID.randomUUID().toString(), catalogCreationScript); + runJobToCompletion(dataLakeAnalyticsJobManagementClient, adlaAcct, UUID.randomUUID(), catalogCreationScript); } @AfterClass @@ -184,13 +178,13 @@ public static void cleanup() throws Exception { } @Test public void canGetCatalogItems() throws Exception { - List dbListResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().listDatabases(adlaAcct, null, null, null, null, null, null, null).getBody(); + 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.getDatabaseName().equals(dbName)) { + if (db.getName().equals(dbName)) { foundCatalogElement = true; break; } @@ -200,17 +194,17 @@ public void canGetCatalogItems() throws Exception { // Get the specific Database as well USqlDatabase dbGetResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().getDatabase(dbName, adlaAcct).getBody(); - Assert.assertEquals(dbName, dbGetResponse.getDatabaseName()); + Assert.assertEquals(dbName, dbGetResponse.getName()); // Get the table list - List tableListResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().listTables(dbName, "dbo", adlaAcct, null, null, null, null, null, null, null).getBody(); + 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.getTableName().equals(tableName)) { + if (table.getName().equals(tableName)) { foundCatalogElement = true; break; } @@ -221,17 +215,17 @@ public void canGetCatalogItems() throws Exception { USqlTable tableGetResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().getTable( dbName, "dbo", tableName, adlaAcct).getBody(); - Assert.assertEquals(tableName, tableGetResponse.getTableName()); + Assert.assertEquals(tableName, tableGetResponse.getName()); // Get the TVF list - List tvfListResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().listTableValuedFunctions(dbName, "dbo", adlaAcct, null, null, null, null, null, null, null).getBody(); + 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.getTvfName().equals(tvfName)) { + if (tvf.getName().equals(tvfName)) { foundCatalogElement = true; break; } @@ -242,17 +236,17 @@ public void canGetCatalogItems() throws Exception { USqlTableValuedFunction tvfGetResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().getTableValuedFunction( dbName, "dbo", tvfName, adlaAcct).getBody(); - Assert.assertEquals(tvfName, tvfGetResponse.getTvfName()); + Assert.assertEquals(tvfName, tvfGetResponse.getName()); // Get the View list - List viewListResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().listViews(dbName, "dbo", adlaAcct, null, null, null, null, null, null, null).getBody(); + 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.getViewName().equals(viewName)) { + if (view.getName().equals(viewName)) { foundCatalogElement = true; break; } @@ -263,18 +257,18 @@ public void canGetCatalogItems() throws Exception { USqlView viewGetResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().getView( dbName, "dbo", viewName, adlaAcct).getBody(); - Assert.assertEquals(viewName, viewGetResponse.getViewName()); + Assert.assertEquals(viewName, viewGetResponse.getName()); // Get the Procedure list List procListResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().listProcedures( - dbName, "dbo", adlaAcct, null, null, null, null, null, null, null).getBody(); + dbName, "dbo", adlaAcct).getBody(); Assert.assertTrue(procListResponse.size() >= 1); // look for the procedure we created foundCatalogElement = false; for (USqlProcedure proc: procListResponse) { - if (proc.getProcName().equals(procName)) { + if (proc.getName().equals(procName)) { foundCatalogElement = true; break; } @@ -285,11 +279,11 @@ public void canGetCatalogItems() throws Exception { USqlProcedure procGetResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().getProcedure( dbName, "dbo", procName, adlaAcct).getBody(); - Assert.assertEquals(procName, procGetResponse.getProcName()); + Assert.assertEquals(procName, procGetResponse.getName()); // Get all the types List typeGetResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().listTypes( - dbName, "dbo", adlaAcct, null, null, null, null, null, null, null).getBody(); + dbName, "dbo", adlaAcct).getBody(); Assert.assertNotNull(typeGetResponse); @@ -358,17 +352,17 @@ public void canCreateUpdateDeleteSecretsAndCredentials() throws Exception { String.format("USE {0}; CREATE CREDENTIAL {1} WITH USER_NAME = \"scope@rkm4grspxa\", IDENTITY = \"{2}\";", dbName, credentialName, secretName); - runJobToCompletion(dataLakeAnalyticsJobManagementClient, adlaAcct, UUID.randomUUID().toString(), credentialCreationScript); + runJobToCompletion(dataLakeAnalyticsJobManagementClient, adlaAcct, UUID.randomUUID(), credentialCreationScript); // Get the Credential list List credListResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().listCredentials( - dbName, adlaAcct, null, null, null, null, null, null, null).getBody(); + dbName, adlaAcct).getBody(); Assert.assertTrue(credListResponse.size() >= 1); // look for the credential we created boolean foundCatalogElement = false; for (USqlCredential cred: credListResponse) { - if (cred.getCredentialName().equals(credentialName)) { + if (cred.getName().equals(credentialName)) { foundCatalogElement = true; break; } @@ -378,13 +372,13 @@ public void canCreateUpdateDeleteSecretsAndCredentials() throws Exception { // Get the specific credential as well USqlCredential credGetResponse = dataLakeAnalyticsCatalogManagementClient.getCatalogOperations().getCredential( dbName, credentialName, adlaAcct).getBody(); - Assert.assertEquals(credentialName, credGetResponse.getCredentialName()); + Assert.assertEquals(credentialName, credGetResponse.getName()); // Drop the credential (to enable secret deletion) String credentialDropScript = String.format("USE {0}; DROP CREDENTIAL {1};", dbName, credentialName); runJobToCompletion(dataLakeAnalyticsJobManagementClient, - adlaAcct, UUID.randomUUID().toString(), + adlaAcct, UUID.randomUUID(), credentialDropScript); // Delete the secret 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 index 2594f472e669..0cf553c4fdc4 100644 --- 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 @@ -78,8 +78,8 @@ public void canSubmitGetListAndCancelJobs() throws Exception { jobToSubmit.setDegreeOfParallelism(2); jobToSubmit.setType(JobType.USQL); jobToSubmit.setProperties(jobProperties); - String jobId = UUID.randomUUID().toString(); - String secondJobId = UUID.randomUUID().toString(); + UUID jobId = UUID.randomUUID(); + UUID secondJobId = UUID.randomUUID(); JobInformation jobCreateResponse = dataLakeAnalyticsJobManagementClient.getJobOperations().create(jobId, adlaAcct, jobToSubmit).getBody(); Assert.assertNotNull(jobCreateResponse); 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 index 45221d9f7505..934c05079ad6 100644 --- 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 @@ -1,6 +1,5 @@ package com.microsoft.azure.management.datalake.analytics; -import com.microsoft.azure.credentials.ApplicationTokenCredentials; import com.microsoft.azure.credentials.AzureEnvironment; import com.microsoft.azure.credentials.UserTokenCredentials; import com.microsoft.azure.management.datalake.analytics.models.JobInformation; @@ -8,10 +7,10 @@ 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.datalake.store.DataLakeStoreAccountManagementClientImpl; -import com.microsoft.azure.management.datalake.store.DataLakeStoreAccountManagementClient; import com.microsoft.azure.management.storage.StorageManagementClient; import com.microsoft.azure.management.storage.StorageManagementClientImpl; @@ -62,7 +61,7 @@ public static void createClients() { storageManagementClient.setSubscriptionId(System.getenv("arm.subscriptionid")); } - public static void runJobToCompletion(DataLakeAnalyticsJobManagementClient jobClient, String adlaAcct, String jobId, String scriptToRun) throws Exception { + 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(); 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 index 4aca63a0f309..0296f55a93c7 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ @@ -319,6 +319,26 @@ public interface AccountOperations { */ 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. * @@ -358,6 +378,24 @@ public interface AccountOperations { */ 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. * 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 index 676104654e70..9d7b10368a32 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ @@ -1140,6 +1140,99 @@ private ServiceResponse getDelegate(Response .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. * @@ -1242,6 +1335,90 @@ private ServiceResponse> listByResourceGroupDeleg .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. * 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 index 4abbd1444132..cf540e593fb4 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index a781f68fbaa9..b9cf751a1fa1 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 19a3df0d78b3..77df08d9e110 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index dcefd0ee23a7..1975307f7ff6 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 0129715b89c5..bb10f9368dbc 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ @@ -12,6 +12,7 @@ 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; @@ -34,14 +35,12 @@ public interface FileSystemOperations { * @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 op The constant value for the operation. - * @param appendMode Indicates the concurrent append call should create the file if it doesn't exist or just open the existing file for append * @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, InputStream streamContents, String op, String appendMode) throws CloudException, IOException, IllegalArgumentException; + ServiceResponse concurrentAppend(String filePath, String accountName, InputStream 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. @@ -49,65 +48,107 @@ public interface FileSystemOperations { * @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 op The constant value for the operation. - * @param appendMode Indicates the concurrent append call should create the file if it doesn't exist or just open the existing file for append * @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, InputStream streamContents, String op, String appendMode, final ServiceCallback serviceCallback) throws IllegalArgumentException; + ServiceCall concurrentAppendAsync(String filePath, String accountName, InputStream 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, InputStream 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, InputStream 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 op The constant value for the operation. * @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 op, String fsaction) throws CloudException, IOException, IllegalArgumentException; + 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 op The constant value for the operation. * @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 op, String fsaction, final ServiceCallback serviceCallback) throws IllegalArgumentException; + 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. - * @param op The constant value for the operation. * @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, String op) throws CloudException, IOException, IllegalArgumentException; + 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 op The constant value for the 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 mkdirsAsync(String path, String accountName, String op, final ServiceCallback serviceCallback) throws IllegalArgumentException; + ServiceCall mkdirsAsync(String path, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Concatenates the list of source files into the destination file. @@ -115,13 +156,12 @@ public interface FileSystemOperations { * @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 op The constant value for the operation. * @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, String op) throws CloudException, IOException, IllegalArgumentException; + ServiceResponse concat(String destinationPath, String accountName, List sources) throws CloudException, IOException, IllegalArgumentException; /** * Concatenates the list of source files into the destination file. @@ -129,12 +169,11 @@ public interface FileSystemOperations { * @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 op The constant value for the 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 concatAsync(String destinationPath, String accountName, List sources, String op, final ServiceCallback serviceCallback) throws IllegalArgumentException; + ServiceCall concatAsync(String destinationPath, String accountName, List sources, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Concatenates the list of source files into the destination file. 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. @@ -142,14 +181,37 @@ public interface FileSystemOperations { * @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 op The constant value for the operation. + * @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, InputStream streamContents) throws CloudException, IOException, IllegalArgumentException; + + /** + * Concatenates the list of source files into the destination file. 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, InputStream streamContents, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Concatenates the list of source files into the destination file. 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 Caution: Setting this parameter to true will delete the parent directory of all source files provided to the MsConcat method. * @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, InputStream streamContents, String op, Boolean deletesourcedirectory) throws CloudException, IOException, IllegalArgumentException; + ServiceResponse msConcat(String msConcatDestinationPath, String accountName, InputStream streamContents, Boolean deletesourcedirectory) throws CloudException, IOException, IllegalArgumentException; /** * Concatenates the list of source files into the destination file. 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. @@ -157,88 +219,81 @@ public interface FileSystemOperations { * @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 op The constant value for the operation. * @param deletesourcedirectory Caution: Setting this parameter to true will delete the parent directory of all source files provided to the MsConcat method. * @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, InputStream streamContents, String op, Boolean deletesourcedirectory, final ServiceCallback serviceCallback) throws IllegalArgumentException; + ServiceCall msConcatAsync(String msConcatDestinationPath, String accountName, InputStream 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. - * @param op The constant value for the operation. * @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, String op) throws CloudException, IOException, IllegalArgumentException; + 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 op The constant value for the 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 listFileStatusAsync(String listFilePath, String accountName, String op, final ServiceCallback serviceCallback) throws IllegalArgumentException; + 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. - * @param op The constant value for the operation. * @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, String op) throws CloudException, IOException, IllegalArgumentException; + 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 op The constant value for the 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 getContentSummaryAsync(String getContentSummaryFilePath, String accountName, String op, final ServiceCallback serviceCallback) throws IllegalArgumentException; + 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. - * @param op The constant value for the operation. * @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, String op) throws CloudException, IOException, IllegalArgumentException; + 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 op The constant value for the 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 getFileStatusAsync(String getFilePath, String accountName, String op, final ServiceCallback serviceCallback) throws IllegalArgumentException; + 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. @@ -246,14 +301,12 @@ public interface FileSystemOperations { * @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 op The constant value for the operation. - * @param append The constant value for the operation. * @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, InputStream streamContents, String op, String append) throws CloudException, IOException, IllegalArgumentException; + ServiceResponse append(String directFilePath, String accountName, InputStream 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. @@ -261,21 +314,39 @@ public interface FileSystemOperations { * @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 op The constant value for the operation. - * @param append The constant value for the 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 appendAsync(String directFilePath, String accountName, InputStream streamContents, String op, String append, final ServiceCallback serviceCallback) throws IllegalArgumentException; + ServiceCall appendAsync(String directFilePath, String accountName, InputStream 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 op The constant value for the operation. - * @param write The constant value for the 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 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 @@ -283,30 +354,48 @@ public interface FileSystemOperations { * @throws IllegalArgumentException exception thrown from invalid parameters * @return the {@link ServiceResponse} object if successful. */ - ServiceResponse create(String directFilePath, String accountName, String op, String write, InputStream streamContents, Boolean overwrite) throws CloudException, IOException, IllegalArgumentException; + ServiceResponse create(String directFilePath, String accountName, InputStream 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 op The constant value for the operation. - * @param write The constant value for the operation. * @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, String op, String write, InputStream streamContents, Boolean overwrite, final ServiceCallback serviceCallback) throws IllegalArgumentException; + ServiceCall createAsync(String directFilePath, String accountName, InputStream 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. - * @param op The constant value for the operation. - * @param read The constant value for the operation. + * @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 @@ -314,22 +403,20 @@ public interface FileSystemOperations { * @throws IllegalArgumentException exception thrown from invalid parameters * @return the InputStream object wrapped in {@link ServiceResponse} if successful. */ - ServiceResponse open(String directFilePath, String accountName, String op, String read, Long length, Long offset) throws CloudException, IOException, IllegalArgumentException; + 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 op The constant value for the operation. - * @param read The constant value for the operation. * @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, String op, String read, Long length, Long offset, final ServiceCallback serviceCallback) throws IllegalArgumentException; + 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. @@ -337,13 +424,12 @@ public interface FileSystemOperations { * @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 op The constant value for the operation. * @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, String op) throws CloudException, IOException, IllegalArgumentException; + ServiceResponse setAcl(String setAclFilePath, String accountName, String aclspec) throws CloudException, IOException, IllegalArgumentException; /** * Sets the Access Control List (ACL) for a file or folder. @@ -351,12 +437,11 @@ public interface FileSystemOperations { * @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 op The constant value for the 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 setAclAsync(String setAclFilePath, String accountName, String aclspec, String op, final ServiceCallback serviceCallback) throws IllegalArgumentException; + 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. @@ -364,13 +449,12 @@ public interface FileSystemOperations { * @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 op The constant value for the operation. * @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, String op) throws CloudException, IOException, IllegalArgumentException; + ServiceResponse modifyAclEntries(String modifyAclFilePath, String accountName, String aclspec) throws CloudException, IOException, IllegalArgumentException; /** * Modifies existing Access Control List (ACL) entries on a file or folder. @@ -378,12 +462,11 @@ public interface FileSystemOperations { * @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 op The constant value for the 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 modifyAclEntriesAsync(String modifyAclFilePath, String accountName, String aclspec, String op, final ServiceCallback serviceCallback) throws IllegalArgumentException; + 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. @@ -391,13 +474,12 @@ public interface FileSystemOperations { * @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 op The constant value for the operation. * @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, String op) throws CloudException, IOException, IllegalArgumentException; + ServiceResponse removeAclEntries(String removeAclFilePath, String accountName, String aclspec) throws CloudException, IOException, IllegalArgumentException; /** * Removes existing Access Control List (ACL) entries for a file or folder. @@ -405,89 +487,104 @@ public interface FileSystemOperations { * @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 op The constant value for the 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 removeAclEntriesAsync(String removeAclFilePath, String accountName, String aclspec, String op, final ServiceCallback serviceCallback) throws IllegalArgumentException; + 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. - * @param op The constant value for the operation. * @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, String op) throws CloudException, IOException, IllegalArgumentException; + 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 op The constant value for the 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 removeAclAsync(String aclFilePath, String accountName, String op, final ServiceCallback serviceCallback) throws IllegalArgumentException; + 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. - * @param op The constant value for the operation. * @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, String op) throws CloudException, IOException, IllegalArgumentException; + 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 op The constant value for the 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 getAclStatusAsync(String aclFilePath, String accountName, String op, final ServiceCallback serviceCallback) throws IllegalArgumentException; + 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 op The constant value for the 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 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, String op, Boolean recursive) throws CloudException, IOException, IllegalArgumentException; + 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 op The constant value for the operation. * @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, String op, Boolean recursive, final ServiceCallback serviceCallback) throws IllegalArgumentException; + ServiceCall deleteAsync(String filePath, String accountName, Boolean recursive, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Rename a file or directory. @@ -495,13 +592,12 @@ public interface FileSystemOperations { * @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 op The constant value for the operation. * @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, String op) throws CloudException, IOException, IllegalArgumentException; + ServiceResponse rename(String renameFilePath, String accountName, String destination) throws CloudException, IOException, IllegalArgumentException; /** * Rename a file or directory. @@ -509,19 +605,39 @@ public interface FileSystemOperations { * @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 op The constant value for the 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 renameAsync(String renameFilePath, String accountName, String destination, String op, final ServiceCallback serviceCallback) throws IllegalArgumentException; + 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. - * @param op The constant value for the operation. + * @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 @@ -529,47 +645,66 @@ public interface FileSystemOperations { * @throws IllegalArgumentException exception thrown from invalid parameters * @return the {@link ServiceResponse} object if successful. */ - ServiceResponse setOwner(String setOwnerFilePath, String accountName, String op, String owner, String group) throws CloudException, IOException, IllegalArgumentException; + 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 op The constant value for the operation. * @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 op, String owner, String group, final ServiceCallback serviceCallback) throws IllegalArgumentException; + 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. - * @param op The constant value for the operation. + * @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 op, String permission) throws CloudException, IOException, IllegalArgumentException; + 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 op The constant value for the operation. * @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 op, String permission, final ServiceCallback serviceCallback) throws IllegalArgumentException; + 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 index 9a6b02b3e95d..651329a0dcf1 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ @@ -14,6 +14,7 @@ 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; @@ -155,14 +156,12 @@ interface FileSystemService { * @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 op The constant value for the operation. - * @param appendMode Indicates the concurrent append call should create the file if it doesn't exist or just open the existing file for append * @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, InputStream streamContents, String op, String appendMode) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse concurrentAppend(String filePath, String accountName, InputStream streamContents) throws CloudException, IOException, IllegalArgumentException { if (filePath == null) { throw new IllegalArgumentException("Parameter filePath is required and cannot be null."); } @@ -175,18 +174,17 @@ public ServiceResponse concurrentAppend(String filePath, String accountNam if (streamContents == null) { throw new IllegalArgumentException("Parameter streamContents is required and cannot be null."); } - if (op == null) { - throw new IllegalArgumentException("Parameter op 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 op = "CONCURRENTAPPEND"; + AppendModeType appendMode = null; this.client.getBaseUrl().set("{accountName}", accountName); this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); - Call call = service.concurrentAppend(filePath, streamContents, appendMode, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + Call call = service.concurrentAppend(filePath, streamContents, this.client.getMapperAdapter().serializeRaw(appendMode), op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); return concurrentAppendDelegate(call.execute()); } @@ -196,13 +194,11 @@ public ServiceResponse concurrentAppend(String filePath, String accountNam * @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 op The constant value for the operation. - * @param appendMode Indicates the concurrent append call should create the file if it doesn't exist or just open the existing file for append * @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, InputStream streamContents, String op, String appendMode, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall concurrentAppendAsync(String filePath, String accountName, InputStream streamContents, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -222,8 +218,100 @@ public ServiceCall concurrentAppendAsync(String filePath, String accountName, In serviceCallback.failure(new IllegalArgumentException("Parameter streamContents is required and cannot be null.")); return null; } - if (op == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter op 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.")); + 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, 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, InputStream 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."); + } + String op = "CONCURRENTAPPEND"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.concurrentAppend(filePath, 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, InputStream 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) { @@ -234,9 +322,10 @@ public ServiceCall concurrentAppendAsync(String filePath, String accountName, In 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, streamContents, appendMode, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + Call call = service.concurrentAppend(filePath, 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 @@ -262,14 +351,12 @@ private ServiceResponse concurrentAppendDelegate(Response re * * @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 op The constant value for the operation. - * @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 op, String fsaction) throws CloudException, IOException, IllegalArgumentException { + 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."); } @@ -279,15 +366,14 @@ public ServiceResponse checkAccess(String path, String accountName, String if (this.client.getAdlsFileSystemDnsSuffix() == null) { throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); } - if (op == null) { - throw new IllegalArgumentException("Parameter op 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 op = "CHECKACCESS"; + 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()); @@ -299,13 +385,11 @@ public ServiceResponse checkAccess(String path, String accountName, String * * @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 op The constant value for the operation. - * @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 op, String fsaction, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall checkAccessAsync(String path, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -321,8 +405,91 @@ public ServiceCall checkAccessAsync(String path, String accountName, String op, serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); return null; } - if (op == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter op 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.")); + 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."); + } + 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) { @@ -333,6 +500,7 @@ public ServiceCall checkAccessAsync(String path, String accountName, String op, 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()); @@ -361,13 +529,12 @@ private ServiceResponse checkAccessDelegate(Response respons * * @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 op The constant value for the operation. * @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, String op) throws CloudException, IOException, IllegalArgumentException { + 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."); } @@ -377,15 +544,13 @@ public ServiceResponse mkdirs(String path, String accountNa if (this.client.getAdlsFileSystemDnsSuffix() == null) { throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); } - if (op == null) { - throw new IllegalArgumentException("Parameter op 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 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()); @@ -397,12 +562,11 @@ public ServiceResponse mkdirs(String path, String accountNa * * @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 op The constant value for the 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 mkdirsAsync(String path, String accountName, String op, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall mkdirsAsync(String path, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -418,10 +582,6 @@ public ServiceCall mkdirsAsync(String path, String accountName, String op, final serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); return null; } - if (op == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter op 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; @@ -430,6 +590,7 @@ public ServiceCall mkdirsAsync(String path, String accountName, String op, final 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()); @@ -460,13 +621,12 @@ private ServiceResponse mkdirsDelegate(Response concat(String destinationPath, String accountName, List sources, String op) throws CloudException, IOException, IllegalArgumentException { + 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."); } @@ -479,9 +639,6 @@ public ServiceResponse concat(String destinationPath, String accountName, if (sources == null) { throw new IllegalArgumentException("Parameter sources is required and cannot be null."); } - if (op == null) { - throw new IllegalArgumentException("Parameter op is required and cannot be null."); - } if (this.client.getApiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.getApiVersion() is required and cannot be null."); } @@ -489,6 +646,7 @@ public ServiceResponse concat(String destinationPath, String accountName, throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } Validator.validate(sources); + 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()); @@ -501,12 +659,11 @@ public ServiceResponse concat(String destinationPath, String accountName, * @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 op The constant value for the 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 concatAsync(String destinationPath, String accountName, List sources, String op, final ServiceCallback serviceCallback) throws IllegalArgumentException { + 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."); } @@ -526,10 +683,6 @@ public ServiceCall concatAsync(String destinationPath, String accountName, List< serviceCallback.failure(new IllegalArgumentException("Parameter sources is required and cannot be null.")); return null; } - if (op == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter op 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; @@ -539,6 +692,7 @@ public ServiceCall concatAsync(String destinationPath, String accountName, List< 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()); @@ -568,14 +722,12 @@ private ServiceResponse concatDelegate(Response response) th * @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 op The constant value for the operation. - * @param deletesourcedirectory Caution: Setting this parameter to true will delete the parent directory of all source files provided to the MsConcat method. * @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, InputStream streamContents, String op, Boolean deletesourcedirectory) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse msConcat(String msConcatDestinationPath, String accountName, InputStream streamContents) throws CloudException, IOException, IllegalArgumentException { if (msConcatDestinationPath == null) { throw new IllegalArgumentException("Parameter msConcatDestinationPath is required and cannot be null."); } @@ -588,15 +740,14 @@ public ServiceResponse msConcat(String msConcatDestinationPath, String acc if (streamContents == null) { throw new IllegalArgumentException("Parameter streamContents is required and cannot be null."); } - if (op == null) { - throw new IllegalArgumentException("Parameter op 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 op = "MSCONCAT"; + Boolean deletesourcedirectory = null; this.client.getBaseUrl().set("{accountName}", accountName); this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); Call call = service.msConcat(msConcatDestinationPath, deletesourcedirectory, streamContents, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); @@ -609,13 +760,11 @@ public ServiceResponse msConcat(String msConcatDestinationPath, String acc * @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 op The constant value for the operation. - * @param deletesourcedirectory Caution: Setting this parameter to true will delete the parent directory of all source files provided to the MsConcat method. * @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, InputStream streamContents, String op, Boolean deletesourcedirectory, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall msConcatAsync(String msConcatDestinationPath, String accountName, InputStream streamContents, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -635,10 +784,6 @@ public ServiceCall msConcatAsync(String msConcatDestinationPath, String accountN serviceCallback.failure(new IllegalArgumentException("Parameter streamContents is required and cannot be null.")); return null; } - if (op == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter op 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; @@ -647,6 +792,8 @@ public ServiceCall msConcatAsync(String msConcatDestinationPath, String accountN 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, streamContents, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); @@ -664,26 +811,21 @@ public void onResponse(Call call, Response response) 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. + * Concatenates the list of source files into the destination file. 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 listFilePath The Data Lake Store path (starting with '/') of the directory to list. + * @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 op The constant value for the operation. + * @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 Caution: Setting this parameter to true will delete the parent directory of all source files provided to the MsConcat method. * @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. + * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse listFileStatus(String listFilePath, String accountName, String op) throws CloudException, IOException, IllegalArgumentException { - if (listFilePath == null) { - throw new IllegalArgumentException("Parameter listFilePath is required and cannot be null."); + public ServiceResponse msConcat(String msConcatDestinationPath, String accountName, InputStream 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."); @@ -691,8 +833,8 @@ public ServiceResponse listFileStatus(String listFilePath, S if (this.client.getAdlsFileSystemDnsSuffix() == null) { throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); } - if (op == null) { - throw new IllegalArgumentException("Parameter op 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."); @@ -700,28 +842,30 @@ public ServiceResponse listFileStatus(String listFilePath, S if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } + String op = "MSCONCAT"; 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()); + Call call = service.msConcat(msConcatDestinationPath, deletesourcedirectory, streamContents, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return msConcatDelegate(call.execute()); } /** - * Get the list of file status objects specified by the file path, with optional pagination parameters. + * Concatenates the list of source files into the destination file. 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 listFilePath The Data Lake Store path (starting with '/') of the directory to list. + * @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 op The constant value for the operation. + * @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 Caution: Setting this parameter to true will delete the parent directory of all source files provided to the MsConcat method. * @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, String op, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall msConcatAsync(String msConcatDestinationPath, String accountName, InputStream streamContents, Boolean deletesourcedirectory, 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.")); + if (msConcatDestinationPath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter msConcatDestinationPath is required and cannot be null.")); return null; } if (accountName == null) { @@ -732,8 +876,8 @@ public ServiceCall listFileStatusAsync(String listFilePath, String accountName, serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); return null; } - if (op == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter op is required and cannot be null.")); + if (streamContents == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter streamContents is required and cannot be null.")); return null; } if (this.client.getApiVersion() == null) { @@ -744,15 +888,16 @@ public ServiceCall listFileStatusAsync(String listFilePath, String accountName, 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.listFileStatus(listFilePath, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + Call call = service.msConcat(msConcatDestinationPath, deletesourcedirectory, streamContents, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); final ServiceCall serviceCall = new ServiceCall(call); - call.enqueue(new ServiceResponseCallback(serviceCallback) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(listFileStatusDelegate(response)); + serviceCallback.success(msConcatDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -761,27 +906,25 @@ public void onResponse(Call call, Response response) 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) + private ServiceResponse msConcatDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) .build(response); } /** - * Gets the file content summary object specified by the file path. + * Get the list of file status objects specified by the file path, with optional pagination parameters. * - * @param getContentSummaryFilePath The Data Lake Store path (starting with '/') of the file for which to retrieve the summary. + * @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 op The constant value for the operation. * @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. + * @return the FileStatusesResult object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getContentSummary(String getContentSummaryFilePath, String accountName, String op) throws CloudException, IOException, IllegalArgumentException { - if (getContentSummaryFilePath == null) { - throw new IllegalArgumentException("Parameter getContentSummaryFilePath is required and cannot be null."); + 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."); @@ -789,37 +932,34 @@ public ServiceResponse getContentSummary(String getContent if (this.client.getAdlsFileSystemDnsSuffix() == null) { throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); } - if (op == null) { - throw new IllegalArgumentException("Parameter op 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 op = "LISTSTATUS"; 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()); + Call call = service.listFileStatus(listFilePath, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return listFileStatusDelegate(call.execute()); } /** - * Gets the file content summary object specified by the file path. + * Get the list of file status objects specified by the file path, with optional pagination parameters. * - * @param getContentSummaryFilePath The Data Lake Store path (starting with '/') of the file for which to retrieve the summary. + * @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 op The constant value for the 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 getContentSummaryAsync(String getContentSummaryFilePath, String accountName, String op, final ServiceCallback serviceCallback) throws IllegalArgumentException { + 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 (getContentSummaryFilePath == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter getContentSummaryFilePath is required and cannot be null.")); + if (listFilePath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter listFilePath is required and cannot be null.")); return null; } if (accountName == null) { @@ -830,10 +970,6 @@ public ServiceCall getContentSummaryAsync(String getContentSummaryFilePath, Stri serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); return null; } - if (op == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter op 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; @@ -842,9 +978,101 @@ public ServiceCall getContentSummaryAsync(String getContentSummaryFilePath, Stri 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.getContentSummary(getContentSummaryFilePath, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + 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."); + } + 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 @@ -871,13 +1099,12 @@ private ServiceResponse getContentSummaryDelegate(Response * * @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 op The constant value for the operation. * @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, String op) throws CloudException, IOException, IllegalArgumentException { + 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."); } @@ -887,15 +1114,13 @@ public ServiceResponse getFileStatus(String getFilePath, Strin if (this.client.getAdlsFileSystemDnsSuffix() == null) { throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); } - if (op == null) { - throw new IllegalArgumentException("Parameter op 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 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()); @@ -907,12 +1132,11 @@ public ServiceResponse getFileStatus(String getFilePath, Strin * * @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 op The constant value for the 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 getFileStatusAsync(String getFilePath, String accountName, String op, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getFileStatusAsync(String getFilePath, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -928,10 +1152,6 @@ public ServiceCall getFileStatusAsync(String getFilePath, String accountName, St serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); return null; } - if (op == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter op 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; @@ -940,6 +1160,7 @@ public ServiceCall getFileStatusAsync(String getFilePath, String accountName, St 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()); @@ -970,14 +1191,12 @@ private ServiceResponse getFileStatusDelegate(Response append(String directFilePath, String accountName, InputStream streamContents, String op, String append) throws CloudException, IOException, IllegalArgumentException { + public ServiceResponse append(String directFilePath, String accountName, InputStream streamContents) throws CloudException, IOException, IllegalArgumentException { if (directFilePath == null) { throw new IllegalArgumentException("Parameter directFilePath is required and cannot be null."); } @@ -990,18 +1209,14 @@ public ServiceResponse append(String directFilePath, String accountName, I if (streamContents == null) { throw new IllegalArgumentException("Parameter streamContents is required and cannot be null."); } - if (op == null) { - throw new IllegalArgumentException("Parameter op is required and cannot be null."); - } - if (append == null) { - throw new IllegalArgumentException("Parameter append 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 op = "APPEND"; + String append = "true"; this.client.getBaseUrl().set("{accountName}", accountName); this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); Call call = service.append(directFilePath, streamContents, op, append, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); @@ -1014,13 +1229,11 @@ public ServiceResponse append(String directFilePath, String accountName, I * @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 op The constant value for the operation. - * @param append The constant value for the 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 appendAsync(String directFilePath, String accountName, InputStream streamContents, String op, String append, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall appendAsync(String directFilePath, String accountName, InputStream streamContents, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -1040,14 +1253,6 @@ public ServiceCall appendAsync(String directFilePath, String accountName, InputS serviceCallback.failure(new IllegalArgumentException("Parameter streamContents is required and cannot be null.")); return null; } - if (op == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter op is required and cannot be null.")); - return null; - } - if (append == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter append 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; @@ -1056,6 +1261,8 @@ public ServiceCall appendAsync(String directFilePath, String accountName, InputS 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, streamContents, op, append, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); @@ -1084,16 +1291,12 @@ private ServiceResponse appendDelegate(Response response) th * * @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 op The constant value for the operation. - * @param write The constant value for the operation. - * @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, String op, String write, InputStream streamContents, Boolean overwrite) throws CloudException, IOException, IllegalArgumentException { + 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."); } @@ -1103,18 +1306,16 @@ public ServiceResponse create(String directFilePath, String accountName, S if (this.client.getAdlsFileSystemDnsSuffix() == null) { throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); } - if (op == null) { - throw new IllegalArgumentException("Parameter op is required and cannot be null."); - } - if (write == null) { - throw new IllegalArgumentException("Parameter write 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 op = "CREATE"; + String write = "true"; + InputStream streamContents = null; + Boolean overwrite = null; this.client.getBaseUrl().set("{accountName}", accountName); this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); Call call = service.create(directFilePath, streamContents, overwrite, op, write, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); @@ -1126,15 +1327,11 @@ public ServiceResponse create(String directFilePath, String accountName, S * * @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 op The constant value for the operation. - * @param write The constant value for the operation. - * @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, String op, String write, InputStream streamContents, Boolean overwrite, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall createAsync(String directFilePath, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -1150,12 +1347,96 @@ public ServiceCall createAsync(String directFilePath, String accountName, String serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); return null; } - if (op == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter op 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.")); return null; } - if (write == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter write 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.")); + return null; + } + final String op = "CREATE"; + final String write = "true"; + final InputStream streamContents = null; + final Boolean overwrite = null; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.create(directFilePath, 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, InputStream 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."); + } + String op = "CREATE"; + String write = "true"; + this.client.getBaseUrl().set("{accountName}", accountName); + this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); + Call call = service.create(directFilePath, 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, InputStream 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) { @@ -1166,6 +1447,8 @@ public ServiceCall createAsync(String directFilePath, String accountName, String 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, streamContents, overwrite, op, write, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); @@ -1194,16 +1477,12 @@ private ServiceResponse createDelegate(Response response) th * * @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 op The constant value for the operation. - * @param read The constant value for the operation. - * @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, String op, String read, Long length, Long offset) throws CloudException, IOException, IllegalArgumentException { + 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."); } @@ -1213,18 +1492,16 @@ public ServiceResponse open(String directFilePath, String accountNa if (this.client.getAdlsFileSystemDnsSuffix() == null) { throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); } - if (op == null) { - throw new IllegalArgumentException("Parameter op is required and cannot be null."); - } - if (read == null) { - throw new IllegalArgumentException("Parameter read 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 op = "OPEN"; + String read = "true"; + Long length = null; + 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()); @@ -1236,15 +1513,11 @@ public ServiceResponse open(String directFilePath, String accountNa * * @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 op The constant value for the operation. - * @param read The constant value for the operation. - * @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, String op, String read, Long length, Long offset, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall openAsync(String directFilePath, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -1260,12 +1533,96 @@ public ServiceCall openAsync(String directFilePath, String accountName, String o serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); return null; } - if (op == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter op 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.")); return null; } - if (read == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter read 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.")); + 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."); + } + String op = "OPEN"; + 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) { @@ -1276,6 +1633,8 @@ public ServiceCall openAsync(String directFilePath, String accountName, String o 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()); @@ -1306,13 +1665,12 @@ private ServiceResponse openDelegate(Response respons * @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 op The constant value for the operation. * @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, String op) throws CloudException, IOException, IllegalArgumentException { + 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."); } @@ -1325,15 +1683,13 @@ public ServiceResponse setAcl(String setAclFilePath, String accountName, S if (aclspec == null) { throw new IllegalArgumentException("Parameter aclspec is required and cannot be null."); } - if (op == null) { - throw new IllegalArgumentException("Parameter op 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 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()); @@ -1346,12 +1702,11 @@ public ServiceResponse setAcl(String setAclFilePath, String accountName, S * @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 op The constant value for the 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 setAclAsync(String setAclFilePath, String accountName, String aclspec, String op, final ServiceCallback serviceCallback) throws IllegalArgumentException { + 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."); } @@ -1371,10 +1726,6 @@ public ServiceCall setAclAsync(String setAclFilePath, String accountName, String serviceCallback.failure(new IllegalArgumentException("Parameter aclspec is required and cannot be null.")); return null; } - if (op == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter op 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; @@ -1383,6 +1734,7 @@ public ServiceCall setAclAsync(String setAclFilePath, String accountName, String 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()); @@ -1412,13 +1764,12 @@ private ServiceResponse setAclDelegate(Response response) th * @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 op The constant value for the operation. * @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, String op) throws CloudException, IOException, IllegalArgumentException { + 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."); } @@ -1431,15 +1782,13 @@ public ServiceResponse modifyAclEntries(String modifyAclFilePath, String a if (aclspec == null) { throw new IllegalArgumentException("Parameter aclspec is required and cannot be null."); } - if (op == null) { - throw new IllegalArgumentException("Parameter op 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 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()); @@ -1452,12 +1801,11 @@ public ServiceResponse modifyAclEntries(String modifyAclFilePath, String a * @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 op The constant value for the 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 modifyAclEntriesAsync(String modifyAclFilePath, String accountName, String aclspec, String op, final ServiceCallback serviceCallback) throws IllegalArgumentException { + 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."); } @@ -1477,10 +1825,6 @@ public ServiceCall modifyAclEntriesAsync(String modifyAclFilePath, String accoun serviceCallback.failure(new IllegalArgumentException("Parameter aclspec is required and cannot be null.")); return null; } - if (op == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter op 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; @@ -1489,6 +1833,7 @@ public ServiceCall modifyAclEntriesAsync(String modifyAclFilePath, String accoun 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()); @@ -1518,13 +1863,12 @@ private ServiceResponse modifyAclEntriesDelegate(Response re * @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 op The constant value for the operation. * @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, String op) throws CloudException, IOException, IllegalArgumentException { + 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."); } @@ -1537,15 +1881,13 @@ public ServiceResponse removeAclEntries(String removeAclFilePath, String a if (aclspec == null) { throw new IllegalArgumentException("Parameter aclspec is required and cannot be null."); } - if (op == null) { - throw new IllegalArgumentException("Parameter op 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 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()); @@ -1558,17 +1900,110 @@ public ServiceResponse removeAclEntries(String removeAclFilePath, String a * @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 op The constant value for the 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 removeAclEntriesAsync(String removeAclFilePath, String accountName, String aclspec, String op, final ServiceCallback serviceCallback) throws IllegalArgumentException { + 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."); + } + 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 (removeAclFilePath == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter removeAclFilePath is required and cannot be null.")); + if (aclFilePath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter aclFilePath is required and cannot be null.")); return null; } if (accountName == null) { @@ -1579,14 +2014,6 @@ public ServiceCall removeAclEntriesAsync(String removeAclFilePath, String accoun 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 (op == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter op 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; @@ -1595,15 +2022,16 @@ public ServiceCall removeAclEntriesAsync(String removeAclFilePath, String accoun 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.removeAclEntries(removeAclFilePath, aclspec, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + 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(removeAclEntriesDelegate(response)); + serviceCallback.success(removeAclDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -1612,24 +2040,23 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse removeAclEntriesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse removeAclDelegate(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. + * 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 with the ACL being removed. + * @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 op The constant value for the operation. * @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. + * @return the AclStatusResult object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse removeAcl(String aclFilePath, String accountName, String op) throws CloudException, IOException, IllegalArgumentException { + 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."); } @@ -1639,32 +2066,29 @@ public ServiceResponse removeAcl(String aclFilePath, String accountName, S if (this.client.getAdlsFileSystemDnsSuffix() == null) { throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); } - if (op == null) { - throw new IllegalArgumentException("Parameter op 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 op = "GETACLSTATUS"; 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()); + Call call = service.getAclStatus(aclFilePath, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return getAclStatusDelegate(call.execute()); } /** - * Removes the existing Access Control List (ACL) of the specified file or directory. + * 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 with the ACL being removed. + * @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 op The constant value for the 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 removeAclAsync(String aclFilePath, String accountName, String op, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall getAclStatusAsync(String aclFilePath, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -1680,10 +2104,6 @@ public ServiceCall removeAclAsync(String aclFilePath, String accountName, String serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); return null; } - if (op == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter op 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; @@ -1692,15 +2112,16 @@ public ServiceCall removeAclAsync(String aclFilePath, String accountName, String 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.removeAcl(aclFilePath, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + 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) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(removeAclDelegate(response)); + serviceCallback.success(getAclStatusDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -1709,26 +2130,26 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse removeAclDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) - .register(200, new TypeToken() { }.getType()) + 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); } /** - * Gets Access Control List (ACL) entries for the specified file or directory. + * Deletes the requested file or directory, optionally recursively. * - * @param aclFilePath The Data Lake Store path (starting with '/') of the file or directory for which to get the ACL. + * @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 op The constant value for the operation. * @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. + * @return the FileOperationResult object wrapped in {@link ServiceResponse} if successful. */ - public ServiceResponse getAclStatus(String aclFilePath, String accountName, String op) throws CloudException, IOException, IllegalArgumentException { - if (aclFilePath == null) { - throw new IllegalArgumentException("Parameter aclFilePath is required and cannot be null."); + 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."); @@ -1736,37 +2157,35 @@ public ServiceResponse getAclStatus(String aclFilePath, String if (this.client.getAdlsFileSystemDnsSuffix() == null) { throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); } - if (op == null) { - throw new IllegalArgumentException("Parameter op 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 op = "DELETE"; + Boolean recursive = null; 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()); + Call call = service.delete(filePath, recursive, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + return deleteDelegate(call.execute()); } /** - * Gets Access Control List (ACL) entries for the specified file or directory. + * Deletes the requested file or directory, optionally recursively. * - * @param aclFilePath The Data Lake Store path (starting with '/') of the file or directory for which to get the ACL. + * @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 op The constant value for the 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 getAclStatusAsync(String aclFilePath, String accountName, String op, final ServiceCallback serviceCallback) throws IllegalArgumentException { + 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 (aclFilePath == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter aclFilePath is required and cannot be null.")); + if (filePath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter filePath is required and cannot be null.")); return null; } if (accountName == null) { @@ -1777,10 +2196,6 @@ public ServiceCall getAclStatusAsync(String aclFilePath, String accountName, Str serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); return null; } - if (op == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter op 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; @@ -1789,15 +2204,17 @@ public ServiceCall getAclStatusAsync(String aclFilePath, String accountName, Str 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.getAclStatus(aclFilePath, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + 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) { + call.enqueue(new ServiceResponseCallback(serviceCallback) { @Override public void onResponse(Call call, Response response) { try { - serviceCallback.success(getAclStatusDelegate(response)); + serviceCallback.success(deleteDelegate(response)); } catch (CloudException | IOException exception) { serviceCallback.failure(exception); } @@ -1806,26 +2223,18 @@ public void onResponse(Call call, Response response) 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. - * @param op The constant value for the operation. * @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, String op, Boolean recursive) throws CloudException, IOException, IllegalArgumentException { + 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."); } @@ -1835,15 +2244,13 @@ public ServiceResponse delete(String filePath, String accou if (this.client.getAdlsFileSystemDnsSuffix() == null) { throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); } - if (op == null) { - throw new IllegalArgumentException("Parameter op 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 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()); @@ -1855,13 +2262,12 @@ public ServiceResponse delete(String filePath, String accou * * @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 op The constant value for the operation. * @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, String op, Boolean recursive, final ServiceCallback serviceCallback) throws IllegalArgumentException { + 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."); } @@ -1877,10 +2283,6 @@ public ServiceCall deleteAsync(String filePath, String accountName, String op, B serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); return null; } - if (op == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter op 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; @@ -1889,6 +2291,7 @@ public ServiceCall deleteAsync(String filePath, String accountName, String op, B 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()); @@ -1919,13 +2322,12 @@ private ServiceResponse deleteDelegate(Response rename(String renameFilePath, String accountName, String destination, String op) throws CloudException, IOException, IllegalArgumentException { + 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."); } @@ -1938,15 +2340,13 @@ public ServiceResponse rename(String renameFilePath, String if (destination == null) { throw new IllegalArgumentException("Parameter destination is required and cannot be null."); } - if (op == null) { - throw new IllegalArgumentException("Parameter op 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 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()); @@ -1959,12 +2359,11 @@ public ServiceResponse rename(String renameFilePath, String * @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 op The constant value for the 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 renameAsync(String renameFilePath, String accountName, String destination, String op, final ServiceCallback serviceCallback) throws IllegalArgumentException { + 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."); } @@ -1984,10 +2383,6 @@ public ServiceCall renameAsync(String renameFilePath, String accountName, String serviceCallback.failure(new IllegalArgumentException("Parameter destination is required and cannot be null.")); return null; } - if (op == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter op 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; @@ -1996,6 +2391,7 @@ public ServiceCall renameAsync(String renameFilePath, String accountName, String 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()); @@ -2025,7 +2421,94 @@ private ServiceResponse renameDelegate(Response 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."); + } + String op = "SETOWNER"; + String owner = null; + 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 @@ -2033,7 +2516,7 @@ private ServiceResponse renameDelegate(Response setOwner(String setOwnerFilePath, String accountName, String op, String owner, String group) throws CloudException, IOException, IllegalArgumentException { + 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."); } @@ -2043,15 +2526,13 @@ public ServiceResponse setOwner(String setOwnerFilePath, String accountNam if (this.client.getAdlsFileSystemDnsSuffix() == null) { throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); } - if (op == null) { - throw new IllegalArgumentException("Parameter op 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 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()); @@ -2063,14 +2544,13 @@ public ServiceResponse setOwner(String setOwnerFilePath, String accountNam * * @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 op The constant value for the operation. * @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 op, String owner, String group, final ServiceCallback serviceCallback) throws IllegalArgumentException { + 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."); } @@ -2086,10 +2566,6 @@ public ServiceCall setOwnerAsync(String setOwnerFilePath, String accountName, St serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); return null; } - if (op == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter op 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; @@ -2098,6 +2574,7 @@ public ServiceCall setOwnerAsync(String setOwnerFilePath, String accountName, St 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()); @@ -2126,14 +2603,12 @@ private ServiceResponse setOwnerDelegate(Response response) * * @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 op The constant value for the operation. - * @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 op, String permission) throws CloudException, IOException, IllegalArgumentException { + 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."); } @@ -2143,15 +2618,14 @@ public ServiceResponse setPermission(String setPermissionFilePath, String if (this.client.getAdlsFileSystemDnsSuffix() == null) { throw new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null."); } - if (op == null) { - throw new IllegalArgumentException("Parameter op 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 op = "SETPERMISSION"; + 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()); @@ -2163,13 +2637,11 @@ public ServiceResponse setPermission(String setPermissionFilePath, String * * @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 op The constant value for the operation. - * @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 op, String permission, final ServiceCallback serviceCallback) throws IllegalArgumentException { + public ServiceCall setPermissionAsync(String setPermissionFilePath, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } @@ -2185,8 +2657,91 @@ public ServiceCall setPermissionAsync(String setPermissionFilePath, String accou serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getAdlsFileSystemDnsSuffix() is required and cannot be null.")); return null; } - if (op == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter op 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.")); + 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."); + } + 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) { @@ -2197,6 +2752,7 @@ public ServiceCall setPermissionAsync(String setPermissionFilePath, String accou 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()); 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 index 23274a1085e4..1badfac52978 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 4a79eae572c8..515fa8bbe01e 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index a2285a7946a6..e49ce41bfceb 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 3e183dda6bfc..cbdb67455991 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 068162c653bf..27378b753851 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 4e3db1c6524d..251be733d495 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 6cb073337848..9faadc8a785a 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index f599d96400a3..2df7cb8fc212 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 7452976de9e1..dcc09b2976c2 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index b1a58ad164f7..03d61ddc2508 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index d8e907b82d24..c6fefe0dd6e1 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 482cfa247047..593a7245e2ea 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ @@ -20,15 +20,15 @@ public class FileOperationResult { * Gets the result of the operation or request. */ @JsonProperty(value = "boolean", access = JsonProperty.Access.WRITE_ONLY) - private Boolean booleanProperty; + private Boolean operationResult; /** - * Get the booleanProperty value. + * Get the operationResult value. * - * @return the booleanProperty value + * @return the operationResult value */ - public Boolean getBooleanProperty() { - return this.booleanProperty; + 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 index 9d9c90d40bfd..5972261fd930 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 0249a6294ee9..d7944d2ad8c8 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 4547231c459b..82d711bee09e 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 2aed22885801..20fb9a65dd73 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 866aefae759d..dda36248fe2f 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 232063cef78e..de6f2ba79c20 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 333553418598..e0c803551a48 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 3e94acc10a99..ee24c8e1a97f 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 04cda67881ed..f2c30ff221cb 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 3af3c4c58846..bed78cd9d173 100644 --- 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 @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for * license information. * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 + * 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. */ 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 index 16bc30496754..7648d07efee1 100644 --- 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 @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 +// 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. 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 index 3c8f0c804e52..25b7396aaccd 100644 --- 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 @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 +// 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. 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 index 3277a9f6ad97..0642eb183fcf 100644 --- 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 @@ -73,7 +73,7 @@ public void canCreateGetUpdateDeleteAdlsAccount() throws Exception { Assert.assertEquals(2, getResponse.getTags().size()); // list all accounts and make sure there is one. - List listResult = dataLakeStoreAccountManagementClient.getAccountOperations().list(null, null, null, null, null, null, null, null, null).getBody(); + List listResult = dataLakeStoreAccountManagementClient.getAccountOperations().list().getBody(); DataLakeStoreAccount discoveredAcct = null; for (DataLakeStoreAccount acct : listResult) { if (acct.getName().equals(adlsAcct)) { @@ -93,7 +93,7 @@ public void canCreateGetUpdateDeleteAdlsAccount() throws Exception { Assert.assertNull(discoveredAcct.getProperties().getDefaultGroup()); // list within a resource group - listResult = dataLakeStoreAccountManagementClient.getAccountOperations().listByResourceGroup(rgName, null, null, null, null, null, null, null, null, null).getBody(); + listResult = dataLakeStoreAccountManagementClient.getAccountOperations().listByResourceGroup(rgName).getBody(); discoveredAcct = null; for (DataLakeStoreAccount acct : listResult) { if (acct.getName().equals(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 index d0a686e16601..ebccbd78c827 100644 --- 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 @@ -152,7 +152,7 @@ public void DataLakeStoreFileSystemListFolderContents() throws Exception GetAndCompareFileOrFolder(adlsAcct, filePath, FileType.FILE, 0); // List all the contents in the folder - FileStatusesResult listFolderResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().listFileStatus(folderPath, adlsAcct, null).getBody(); + 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()); @@ -185,7 +185,7 @@ public void DataLakeStoreFileSystemAppendToFile() throws Exception // Append to the file that we created dataLakeStoreFileSystemManagementClient.getFileSystemOperations().append(filePath, adlsAcct, - new ByteArrayInputStream(fileContentsToAdd.getBytes()), null, "true"); + new ByteArrayInputStream(fileContentsToAdd.getBytes())); GetAndCompareFileOrFolder(adlsAcct, filePath, FileType.FILE, fileContentsToAppend.length()); @@ -209,7 +209,7 @@ public void DataLakeStoreFileSystemConcatenateFiles() throws Exception dataLakeStoreFileSystemManagementClient.getFileSystemOperations().concat( String.format("{0}/{1}", targetFolder, fileToConcatTo), adlsAcct, - Arrays.asList(new String[]{filePath1, filePath2}), null + Arrays.asList(new String[]{filePath1, filePath2}) ); GetAndCompareFileOrFolder(adlsAcct, @@ -220,7 +220,7 @@ public void DataLakeStoreFileSystemConcatenateFiles() throws Exception // Attempt to get the files that were concatted together, which should fail and throw try { dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(filePath1, - adlsAcct, null); + adlsAcct); Assert.assertTrue("Able to get the old file after concat", false); } catch (Exception e) { @@ -229,7 +229,7 @@ public void DataLakeStoreFileSystemConcatenateFiles() throws Exception try { dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(filePath2, - adlsAcct, null); + adlsAcct); Assert.assertTrue("Able to get the old file after concat", false); } catch (Exception e) { @@ -254,7 +254,6 @@ public void DataLakeStoreFileSystemMsConcatenateFiles() throws Exception String.format("{0}/{1}", targetFolder, fileToConcatTo), adlsAcct, new ByteArrayInputStream(String.format("sources={0},{1}", filePath1, filePath2).getBytes()), - null, false); GetAndCompareFileOrFolder(adlsAcct, @@ -265,7 +264,7 @@ public void DataLakeStoreFileSystemMsConcatenateFiles() throws Exception // Attempt to get the files that were concatted together, which should fail and throw try { dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(filePath1, - adlsAcct, null); + adlsAcct); Assert.assertTrue("Able to get the old file after concat", false); } catch (Exception e) { @@ -274,7 +273,7 @@ public void DataLakeStoreFileSystemMsConcatenateFiles() throws Exception try { dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(filePath2, - adlsAcct, null); + adlsAcct); Assert.assertTrue("Able to get the old file after concat", false); } catch (Exception e) { @@ -303,7 +302,6 @@ public void DataLakeStoreFileSystemMsConcatDeleteDir() throws Exception String.format("{0}/{1}", targetFolder, fileToConcatTo), adlsAcct, new ByteArrayInputStream(String.format("sources={0},{1}", filePath1, filePath2).getBytes()), - null, true); GetAndCompareFileOrFolder(adlsAcct, @@ -313,7 +311,7 @@ public void DataLakeStoreFileSystemMsConcatDeleteDir() throws Exception // Attempt to get the files that were concatted together, which should fail and throw try { - dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(filePath1, adlsAcct, null); + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(filePath1, adlsAcct); Assert.assertTrue("Able to get the old file after concat", false); } catch (Exception e) { @@ -321,7 +319,7 @@ public void DataLakeStoreFileSystemMsConcatDeleteDir() throws Exception } try { - dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(filePath2, adlsAcct, null); + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(filePath2, adlsAcct); Assert.assertTrue("Able to get the old file after concat", false); } catch (Exception e) { @@ -330,7 +328,7 @@ public void DataLakeStoreFileSystemMsConcatDeleteDir() throws Exception // Attempt to get the folder that was created for concat, which should fail and be deleted. try { - dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(concatFolderPath, adlsAcct, null); + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(concatFolderPath, adlsAcct); Assert.assertTrue("Able to get the old folder after concat", false); } catch (Exception e) { @@ -351,9 +349,8 @@ public void DataLakeStoreFileSystemMoveFileAndFolder() throws Exception // Move file first FileOperationResult moveFileResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().rename(filePath, adlsAcct, - String.format("{0}/{1}", targetFolder1, fileToMove), - null).getBody(); - Assert.assertTrue(moveFileResponse.getBooleanProperty()); + String.format("{0}/{1}", targetFolder1, fileToMove)).getBody(); + Assert.assertTrue(moveFileResponse.getOperationResult()); GetAndCompareFileOrFolder(adlsAcct, String.format("{0}/{1}", targetFolder1, fileToMove), FileType.FILE, @@ -361,7 +358,7 @@ public void DataLakeStoreFileSystemMoveFileAndFolder() throws Exception // Ensure the old file is gone try { - dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(filePath, adlsAcct, null); + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(filePath, adlsAcct); Assert.assertTrue("Able to get the old file after rename", false); } catch (Exception e) { @@ -371,9 +368,8 @@ public void DataLakeStoreFileSystemMoveFileAndFolder() throws Exception // Now move folder completely. FileOperationResult moveFolderResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().rename(targetFolder1, adlsAcct, - targetFolder2, - null).getBody(); - Assert.assertTrue(moveFolderResponse.getBooleanProperty()); + targetFolder2).getBody(); + Assert.assertTrue(moveFolderResponse.getOperationResult()); GetAndCompareFileOrFolder(adlsAcct, targetFolder2, FileType.DIRECTORY, 0); @@ -381,14 +377,14 @@ public void DataLakeStoreFileSystemMoveFileAndFolder() throws Exception // ensure all the contents of the folder moved // List all the contents in the folder FileStatusesResult listFolderResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().listFileStatus(targetFolder2, - adlsAcct, null).getBody(); + 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, null); + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(targetFolder1, adlsAcct); Assert.assertTrue("Able to get the old folder after rename", false); } catch (Exception e) { @@ -439,7 +435,7 @@ public void DataLakeStoreFileSystemDeleteFile() throws Exception public void DataLakeStoreFileSystemGetAndSetAcl() throws Exception { AclStatusResult currentAcl = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getAclStatus("/", - adlsAcct, null).getBody(); + adlsAcct).getBody(); List aclToReplaceWith = new ArrayList(currentAcl.getAclStatus().getEntries()); String originalOther = ""; @@ -459,17 +455,15 @@ public void DataLakeStoreFileSystemGetAndSetAcl() throws Exception // Set the other acl to RWX dataLakeStoreFileSystemManagementClient.getFileSystemOperations().setAcl("/", adlsAcct, - String.join(",", aclToReplaceWith), - null); + String.join(",", aclToReplaceWith)); AclStatusResult newAcl = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getAclStatus("/", - adlsAcct, - null).getBody(); + 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, null, "rwx"); + adlsAcct, "rwx"); boolean foundIt = false; for (String entry: newAcl.getAclStatus().getEntries()) @@ -485,12 +479,11 @@ public void DataLakeStoreFileSystemGetAndSetAcl() throws Exception // Set it back using specific entry dataLakeStoreFileSystemManagementClient.getFileSystemOperations().modifyAclEntries("/", - adlsAcct, originalOther, null); + adlsAcct, originalOther); // Now confirm that it equals the original ACL List finalEntries = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getAclStatus("/", - adlsAcct, - null).getBody() + adlsAcct).getBody() .getAclStatus().getEntries(); for (String entry: finalEntries) { @@ -516,7 +509,7 @@ public void DataLakeStoreFileSystemSetFileProperties() throws Exception String filePath = CreateFile(adlsAcct, true, true, folderToCreate); FileStatusProperties originalFileStatus = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(filePath, - adlsAcct, null).getBody().getFileStatus(); + 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, @@ -566,7 +559,7 @@ public void DataLakeStoreFileSystemSetFileProperties() throws Exception public void DataLakeStoreFileSystemGetAcl() throws Exception { AclStatusResult aclGetResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getAclStatus("/", - adlsAcct, null).getBody(); + adlsAcct).getBody(); Assert.assertNotNull(aclGetResponse.getAclStatus()); Assert.assertTrue(aclGetResponse.getAclStatus().getEntries().size() > 0); @@ -577,7 +570,7 @@ public void DataLakeStoreFileSystemGetAcl() throws Exception @Test public void DataLakeStoreFileSystemSetAcl() throws Exception { - AclStatusResult aclGetResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getAclStatus("/", adlsAcct, null).getBody(); + AclStatusResult aclGetResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getAclStatus("/", adlsAcct).getBody(); Assert.assertNotNull(aclGetResponse.getAclStatus()); Assert.assertTrue(aclGetResponse.getAclStatus().getEntries().size() > 0); @@ -590,12 +583,11 @@ public void DataLakeStoreFileSystemSetAcl() throws Exception dataLakeStoreFileSystemManagementClient.getFileSystemOperations().setAcl("/", adlsAcct, - newAcls, - null); + newAcls); // retrieve the ACL again and confirm the new entry is present aclGetResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getAclStatus("/", - adlsAcct, null).getBody(); + adlsAcct).getBody(); Assert.assertNotNull(aclGetResponse.getAclStatus()); Assert.assertTrue(aclGetResponse.getAclStatus().getEntries().size() > 0); @@ -615,7 +607,7 @@ public void DataLakeStoreFileSystemSetAcl() throws Exception @Test public void DataLakeStoreFileSystemSetDeleteAclEntry() throws Exception { - AclStatusResult aclGetResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getAclStatus("/", adlsAcct, null).getBody(); + AclStatusResult aclGetResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getAclStatus("/", adlsAcct).getBody(); Assert.assertNotNull(aclGetResponse.getAclStatus()); Assert.assertTrue(aclGetResponse.getAclStatus().getEntries().size() > 0); @@ -626,13 +618,11 @@ public void DataLakeStoreFileSystemSetDeleteAclEntry() throws Exception dataLakeStoreFileSystemManagementClient.getFileSystemOperations().modifyAclEntries("/", adlsAcct, - newAce, - null); + newAce); // retrieve the ACL again and confirm the new entry is present aclGetResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getAclStatus("/", - adlsAcct, - null).getBody(); + adlsAcct).getBody(); Assert.assertNotNull(aclGetResponse.getAclStatus()); Assert.assertTrue(aclGetResponse.getAclStatus().getEntries().size() > 0); @@ -652,13 +642,11 @@ public void DataLakeStoreFileSystemSetDeleteAclEntry() throws Exception String aceToRemove = String.format(",user:{0}", aclUserId); dataLakeStoreFileSystemManagementClient.getFileSystemOperations().removeAclEntries("/", adlsAcct, - aceToRemove, - null); + aceToRemove); // retrieve the ACL again and confirm the new entry is present aclGetResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getAclStatus("/", - adlsAcct, - null).getBody(); + adlsAcct).getBody(); Assert.assertNotNull(aclGetResponse.getAclStatus()); Assert.assertTrue(aclGetResponse.getAclStatus().getEntries().size() > 0); @@ -683,8 +671,8 @@ private String CreateFolder(String caboAccountName, boolean randomName) throws E ? generateName(folderToCreate) : folderToCreate; - FileOperationResult response = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().mkdirs(folderPath, caboAccountName, null).getBody(); - Assert.assertTrue(response.getBooleanProperty()); + FileOperationResult response = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().mkdirs(folderPath, caboAccountName).getBody(); + Assert.assertTrue(response.getOperationResult()); return folderPath; } @@ -697,19 +685,15 @@ private String CreateFile(String caboAccountName, boolean withContents, boolean { dataLakeStoreFileSystemManagementClient.getFileSystemOperations().create( filePath, - caboAccountName, - null, - "true", - new ByteArrayInputStream(new byte[]{}), null); + caboAccountName); } else { dataLakeStoreFileSystemManagementClient.getFileSystemOperations().create( filePath, caboAccountName, - null, - "true", - new ByteArrayInputStream(fileContentsToAdd.getBytes()), null); + new ByteArrayInputStream(fileContentsToAdd.getBytes()), + false); // never overwrite during create, because if it exists we want to fail. } return filePath; @@ -717,7 +701,7 @@ private String CreateFile(String caboAccountName, boolean withContents, boolean private FileStatusResult GetAndCompareFileOrFolder(String caboAccountName, String fileOrFolderPath, FileType expectedType, long expectedLength) throws Exception { - FileStatusResult getResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(fileOrFolderPath, caboAccountName, null).getBody(); + FileStatusResult getResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().getFileStatus(fileOrFolderPath, caboAccountName).getBody(); Assert.assertEquals(expectedLength, (long) getResponse.getFileStatus().getLength()); Assert.assertEquals(expectedType, getResponse.getFileStatus().getType()); @@ -727,7 +711,7 @@ private FileStatusResult GetAndCompareFileOrFolder(String caboAccountName, Strin 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, null, null, null, null).getBody(); + InputStream openResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().open(filePath, caboAccountName).getBody(); Assert.assertNotNull(openResponse); String toCompare = new String(IOUtils.readFully(openResponse, -1, true)); @@ -741,8 +725,8 @@ private void DeleteFolder(String caboAccountName, String folderPath, boolean rec // try to delete a folder that doesn't exist or should fail try { - FileOperationResult deleteFolderResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().delete(folderPath, caboAccountName, null, recursive).getBody(); - Assert.assertTrue(!deleteFolderResponse.getBooleanProperty()); + FileOperationResult deleteFolderResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().delete(folderPath, caboAccountName, recursive).getBody(); + Assert.assertTrue(!deleteFolderResponse.getOperationResult()); } catch (Exception e) { @@ -752,8 +736,8 @@ private void DeleteFolder(String caboAccountName, String folderPath, boolean rec else { // Delete a folder - FileOperationResult deleteFolderResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().delete(folderPath, caboAccountName, null, recursive).getBody(); - Assert.assertTrue(deleteFolderResponse.getBooleanProperty()); + FileOperationResult deleteFolderResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().delete(folderPath, caboAccountName, recursive).getBody(); + Assert.assertTrue(deleteFolderResponse.getOperationResult()); } } @@ -764,8 +748,8 @@ private void DeleteFile(String caboAccountName, String filePath, boolean failure // try to delete a file that doesn't exist try { - FileOperationResult deleteFileResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().delete(filePath, caboAccountName, null, false).getBody(); - Assert.assertTrue(!deleteFileResponse.getBooleanProperty()); + FileOperationResult deleteFileResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().delete(filePath, caboAccountName, false).getBody(); + Assert.assertTrue(!deleteFileResponse.getOperationResult()); } catch (Exception e) { @@ -775,8 +759,8 @@ private void DeleteFile(String caboAccountName, String filePath, boolean failure else { // Delete a file - FileOperationResult deleteFileResponse = dataLakeStoreFileSystemManagementClient.getFileSystemOperations().delete(filePath, caboAccountName, null, false).getBody(); - Assert.assertTrue(deleteFileResponse.getBooleanProperty()); + 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 index 396a206c0bbd..7de156f02561 100644 --- 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 @@ -1,16 +1,10 @@ package com.microsoft.azure.management.datalake.store; -import com.microsoft.azure.credentials.ApplicationTokenCredentials; 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 org.junit.Assert; - -import java.util.UUID; - import okhttp3.logging.HttpLoggingInterceptor; public abstract class DataLakeStoreManagementTestBase { diff --git a/gulpfile.js b/gulpfile.js index b0bed819361b..f7b18a81967f 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -88,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.15.0-Nightly20160304'; // default +var autoRestVersion = '0.16.0-Nightly20160314'; // default if (args['autorest'] !== undefined) { autoRestVersion = args['autorest']; } From 402cfa1188d764051dfcad6547be838a52d92508 Mon Sep 17 00:00:00 2001 From: begoldsm Date: Tue, 22 Mar 2016 18:24:40 -0700 Subject: [PATCH 8/9] tests and latest generation. Fixes upload/download. --- .gitignore | 3 + ...taLakeAnalyticsCatalogOperationsTests.java | 18 +- .../DataLakeAnalyticsJobOperationsTests.java | 2 +- .../datalake/store/FileSystemOperations.java | 40 ++-- .../store/FileSystemOperationsImpl.java | 172 +++++++++--------- .../store/models/FileStatusProperties.java | 4 +- .../datalake/store/models/FileType.java | 8 +- ...ataLakeStoreFilesystemOperationsTests.java | 53 +++--- 8 files changed, 152 insertions(+), 148 deletions(-) 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/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 index 7b86dc6064dc..3d98f9e7ca25 100644 --- 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 @@ -41,9 +41,9 @@ public class DataLakeAnalyticsCatalogOperationsTests extends DataLakeAnalyticsMa private static String secretPwd = generateName("testsecretpwd1"); private static String catalogCreationScript = String.format("\n" + - "DROP DATABASE IF EXISTS {0}; CREATE DATABASE {0}; \n" + + "DROP DATABASE IF EXISTS %s; CREATE DATABASE %s; \n" + "//Create Table\n" + - "CREATE TABLE {0}.dbo.{1}\n" + + "CREATE TABLE %s.dbo.%s\n" + "(\n" + " //Define schema of table\n" + " UserId int, \n" + @@ -57,10 +57,10 @@ public class DataLakeAnalyticsCatalogOperationsTests extends DataLakeAnalyticsMa " CLUSTERED (Region ASC) //Column to cluster by\n" + " PARTITIONED BY HASH (Region) //Column to partition by\n" + ");\n" + - "DROP FUNCTION IF EXISTS {0}.dbo.{2};\n" + + "DROP FUNCTION IF EXISTS %s.dbo.%s;\n" + "\n" + "//create table weblogs on space-delimited website log data\n" + - "CREATE FUNCTION {0}.dbo.{2}()\n" + + "CREATE FUNCTION %s.dbo.%s()\n" + "RETURNS @result TABLE\n" + "(\n" + " s_date DateTime,\n" + @@ -111,7 +111,7 @@ public class DataLakeAnalyticsCatalogOperationsTests extends DataLakeAnalyticsMa "\n" + "RETURN;\n" + "END;\n" + - "CREATE VIEW {0}.dbo.{3} \n" + + "CREATE VIEW %s.dbo.%s \n" + "AS \n" + " SELECT * FROM \n" + " (\n" + @@ -119,9 +119,9 @@ public class DataLakeAnalyticsCatalogOperationsTests extends DataLakeAnalyticsMa " ) \n" + "AS \n" + "T(a, b);\n" + - "CREATE PROCEDURE {0}.dbo.{4}()\n" + + "CREATE PROCEDURE %s.dbo.%s()\n" + "AS BEGIN\n" + - " CREATE VIEW {0}.dbo.{3} \n" + + " CREATE VIEW %s.dbo.%s \n" + " AS \n" + " SELECT * FROM \n" + " (\n" + @@ -349,7 +349,7 @@ public void canCreateUpdateDeleteSecretsAndCredentials() throws Exception { // Create a credential with the secret String credentialCreationScript = - String.format("USE {0}; CREATE CREDENTIAL {1} WITH USER_NAME = \"scope@rkm4grspxa\", IDENTITY = \"{2}\";", + String.format("USE %s; CREATE CREDENTIAL %s WITH USER_NAME = \"scope@rkm4grspxa\", IDENTITY = \"%s\";", dbName, credentialName, secretName); runJobToCompletion(dataLakeAnalyticsJobManagementClient, adlaAcct, UUID.randomUUID(), credentialCreationScript); @@ -376,7 +376,7 @@ public void canCreateUpdateDeleteSecretsAndCredentials() throws Exception { // Drop the credential (to enable secret deletion) String credentialDropScript = - String.format("USE {0}; DROP CREDENTIAL {1};", dbName, credentialName); + String.format("USE %s; DROP CREDENTIAL %s;", dbName, credentialName); runJobToCompletion(dataLakeAnalyticsJobManagementClient, adlaAcct, UUID.randomUUID(), credentialDropScript); 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 index 0cf553c4fdc4..2e678e988cdd 100644 --- 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 @@ -116,7 +116,7 @@ public void canSubmitGetListAndCancelJobs() throws Exception { // 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}", + 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); 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 index bb10f9368dbc..1f53d7563b5e 100644 --- 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 @@ -40,7 +40,7 @@ public interface FileSystemOperations { * @throws IllegalArgumentException exception thrown from invalid parameters * @return the {@link ServiceResponse} object if successful. */ - ServiceResponse concurrentAppend(String filePath, String accountName, InputStream streamContents) throws CloudException, IOException, IllegalArgumentException; + 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. @@ -52,7 +52,7 @@ public interface FileSystemOperations { * @throws IllegalArgumentException thrown if callback is null * @return the {@link ServiceCall} object */ - ServiceCall concurrentAppendAsync(String filePath, String accountName, InputStream streamContents, final ServiceCallback serviceCallback) throws IllegalArgumentException; + 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. * @@ -65,7 +65,7 @@ public interface FileSystemOperations { * @throws IllegalArgumentException exception thrown from invalid parameters * @return the {@link ServiceResponse} object if successful. */ - ServiceResponse concurrentAppend(String filePath, String accountName, InputStream streamContents, AppendModeType appendMode) throws CloudException, IOException, IllegalArgumentException; + 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. @@ -78,7 +78,7 @@ public interface FileSystemOperations { * @throws IllegalArgumentException thrown if callback is null * @return the {@link ServiceCall} object */ - ServiceCall concurrentAppendAsync(String filePath, String accountName, InputStream streamContents, AppendModeType appendMode, final ServiceCallback serviceCallback) throws IllegalArgumentException; + 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. @@ -151,7 +151,7 @@ public interface FileSystemOperations { ServiceCall mkdirsAsync(String path, String accountName, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** - * Concatenates the list of source files into the destination file. + * 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. @@ -164,7 +164,7 @@ public interface FileSystemOperations { ServiceResponse concat(String destinationPath, String accountName, List sources) throws CloudException, IOException, IllegalArgumentException; /** - * Concatenates the list of source files into the destination file. + * 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. @@ -176,7 +176,7 @@ public interface FileSystemOperations { ServiceCall concatAsync(String destinationPath, String accountName, List sources, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** - * Concatenates the list of source files into the destination file. 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. + * 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. @@ -186,10 +186,10 @@ public interface FileSystemOperations { * @throws IllegalArgumentException exception thrown from invalid parameters * @return the {@link ServiceResponse} object if successful. */ - ServiceResponse msConcat(String msConcatDestinationPath, String accountName, InputStream streamContents) throws CloudException, IOException, IllegalArgumentException; + ServiceResponse msConcat(String msConcatDestinationPath, String accountName, byte[] streamContents) throws CloudException, IOException, IllegalArgumentException; /** - * Concatenates the list of source files into the destination file. 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. + * 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. @@ -198,33 +198,33 @@ public interface FileSystemOperations { * @throws IllegalArgumentException thrown if callback is null * @return the {@link ServiceCall} object */ - ServiceCall msConcatAsync(String msConcatDestinationPath, String accountName, InputStream streamContents, final ServiceCallback serviceCallback) throws IllegalArgumentException; + ServiceCall msConcatAsync(String msConcatDestinationPath, String accountName, byte[] streamContents, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** - * Concatenates the list of source files into the destination file. 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. + * 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 Caution: Setting this parameter to true will delete the parent directory of all source files provided to the MsConcat method. + * @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, InputStream streamContents, Boolean deletesourcedirectory) throws CloudException, IOException, IllegalArgumentException; + ServiceResponse msConcat(String msConcatDestinationPath, String accountName, byte[] streamContents, Boolean deleteSourceDirectory) throws CloudException, IOException, IllegalArgumentException; /** - * Concatenates the list of source files into the destination file. 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. + * 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 Caution: Setting this parameter to true will delete the parent directory of all source files provided to the MsConcat method. + * @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, InputStream streamContents, Boolean deletesourcedirectory, final ServiceCallback serviceCallback) throws IllegalArgumentException; + 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. @@ -306,7 +306,7 @@ public interface FileSystemOperations { * @throws IllegalArgumentException exception thrown from invalid parameters * @return the {@link ServiceResponse} object if successful. */ - ServiceResponse append(String directFilePath, String accountName, InputStream streamContents) throws CloudException, IOException, IllegalArgumentException; + 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. @@ -318,7 +318,7 @@ public interface FileSystemOperations { * @throws IllegalArgumentException thrown if callback is null * @return the {@link ServiceCall} object */ - ServiceCall appendAsync(String directFilePath, String accountName, InputStream streamContents, final ServiceCallback serviceCallback) throws IllegalArgumentException; + ServiceCall appendAsync(String directFilePath, String accountName, byte[] streamContents, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Creates a file with optionally specified content. @@ -354,7 +354,7 @@ public interface FileSystemOperations { * @throws IllegalArgumentException exception thrown from invalid parameters * @return the {@link ServiceResponse} object if successful. */ - ServiceResponse create(String directFilePath, String accountName, InputStream streamContents, Boolean overwrite) throws CloudException, IOException, IllegalArgumentException; + ServiceResponse create(String directFilePath, String accountName, byte[] streamContents, Boolean overwrite) throws CloudException, IOException, IllegalArgumentException; /** * Creates a file with optionally specified content. @@ -367,7 +367,7 @@ public interface FileSystemOperations { * @throws IllegalArgumentException thrown if callback is null * @return the {@link ServiceCall} object */ - ServiceCall createAsync(String directFilePath, String accountName, InputStream streamContents, Boolean overwrite, final ServiceCallback serviceCallback) throws IllegalArgumentException; + ServiceCall createAsync(String directFilePath, String accountName, byte[] streamContents, Boolean overwrite, final ServiceCallback serviceCallback) throws IllegalArgumentException; /** * Opens and reads from the specified file. 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 index 651329a0dcf1..0c14f863512f 100644 --- 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 @@ -28,6 +28,8 @@ 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; @@ -39,6 +41,7 @@ import retrofit2.http.POST; import retrofit2.http.PUT; import retrofit2.http.Query; +import retrofit2.http.Streaming; import retrofit2.Response; import retrofit2.Retrofit; @@ -70,7 +73,7 @@ public FileSystemOperationsImpl(Retrofit retrofit, DataLakeStoreFileSystemManage interface FileSystemService { @Headers("Content-Type: application/octet-stream") @POST("WebHdfsExt/{filePath}") - Call concurrentAppend(@Path("filePath") String filePath, @Body InputStream streamContents, @Query("appendMode") String appendMode, @Query("op") String op, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + 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}") @@ -86,7 +89,7 @@ interface FileSystemService { @Headers("Content-Type: application/octet-stream") @POST("webhdfs/v1/{msConcatDestinationPath}") - Call msConcat(@Path("msConcatDestinationPath") String msConcatDestinationPath, @Query("deletesourcedirectory") Boolean deletesourcedirectory, @Body InputStream streamContents, @Query("op") String op, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + 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}") @@ -102,14 +105,15 @@ interface FileSystemService { @Headers("Content-Type: application/octet-stream") @POST("webhdfs/v1/{directFilePath}") - Call append(@Path("directFilePath") String directFilePath, @Body InputStream streamContents, @Query("op") String op, @Query("append") String append, @Query("api-version") String apiVersion, @Header("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage); + 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 InputStream 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); + 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") @@ -161,7 +165,7 @@ interface FileSystemService { * @throws IllegalArgumentException exception thrown from invalid parameters * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse concurrentAppend(String filePath, String accountName, InputStream streamContents) throws CloudException, IOException, IllegalArgumentException { + 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."); } @@ -180,11 +184,11 @@ public ServiceResponse concurrentAppend(String filePath, String accountNam if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - String op = "CONCURRENTAPPEND"; - AppendModeType appendMode = 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, streamContents, this.client.getMapperAdapter().serializeRaw(appendMode), op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + 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()); } @@ -198,7 +202,7 @@ public ServiceResponse concurrentAppend(String filePath, String accountNam * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall concurrentAppendAsync(String filePath, String accountName, InputStream streamContents, final ServiceCallback serviceCallback) throws IllegalArgumentException { + 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."); } @@ -230,7 +234,7 @@ public ServiceCall concurrentAppendAsync(String filePath, String accountName, In final AppendModeType appendMode = null; this.client.getBaseUrl().set("{accountName}", accountName); this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); - Call call = service.concurrentAppend(filePath, streamContents, this.client.getMapperAdapter().serializeRaw(appendMode), op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + 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 @@ -257,7 +261,7 @@ public void onResponse(Call call, Response response) * @throws IllegalArgumentException exception thrown from invalid parameters * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse concurrentAppend(String filePath, String accountName, InputStream streamContents, AppendModeType appendMode) throws CloudException, IOException, IllegalArgumentException { + 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."); } @@ -276,10 +280,10 @@ public ServiceResponse concurrentAppend(String filePath, String accountNam if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - String op = "CONCURRENTAPPEND"; + final String op = "CONCURRENTAPPEND"; this.client.getBaseUrl().set("{accountName}", accountName); this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); - Call call = service.concurrentAppend(filePath, streamContents, this.client.getMapperAdapter().serializeRaw(appendMode), op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + 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()); } @@ -294,7 +298,7 @@ public ServiceResponse concurrentAppend(String filePath, String accountNam * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall concurrentAppendAsync(String filePath, String accountName, InputStream streamContents, AppendModeType appendMode, final ServiceCallback serviceCallback) throws IllegalArgumentException { + 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."); } @@ -325,7 +329,7 @@ public ServiceCall concurrentAppendAsync(String filePath, String accountName, In final String op = "CONCURRENTAPPEND"; this.client.getBaseUrl().set("{accountName}", accountName); this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); - Call call = service.concurrentAppend(filePath, streamContents, this.client.getMapperAdapter().serializeRaw(appendMode), op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + 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 @@ -372,8 +376,8 @@ public ServiceResponse checkAccess(String path, String accountName) throws if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - String op = "CHECKACCESS"; - String fsaction = 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()); @@ -459,7 +463,7 @@ public ServiceResponse checkAccess(String path, String accountName, String if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - String op = "CHECKACCESS"; + 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()); @@ -550,7 +554,7 @@ public ServiceResponse mkdirs(String path, String accountNa if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - String op = "MKDIRS"; + 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()); @@ -616,7 +620,7 @@ private ServiceResponse mkdirsDelegate(Response concat(String destinationPath, String accountName, throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } Validator.validate(sources); - String op = "CONCAT"; + 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()); @@ -654,7 +658,7 @@ public ServiceResponse concat(String destinationPath, String accountName, } /** - * Concatenates the list of source files into the destination file. + * 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. @@ -717,7 +721,7 @@ private ServiceResponse concatDelegate(Response response) th } /** - * Concatenates the list of source files into the destination file. 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. + * 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. @@ -727,7 +731,7 @@ private ServiceResponse concatDelegate(Response response) th * @throws IllegalArgumentException exception thrown from invalid parameters * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse msConcat(String msConcatDestinationPath, String accountName, InputStream streamContents) throws CloudException, IOException, IllegalArgumentException { + 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."); } @@ -746,16 +750,16 @@ public ServiceResponse msConcat(String msConcatDestinationPath, String acc if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - String op = "MSCONCAT"; - Boolean deletesourcedirectory = 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, streamContents, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + 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. 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. + * 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. @@ -764,7 +768,7 @@ public ServiceResponse msConcat(String msConcatDestinationPath, String acc * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall msConcatAsync(String msConcatDestinationPath, String accountName, InputStream streamContents, final ServiceCallback serviceCallback) throws IllegalArgumentException { + 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."); } @@ -793,10 +797,10 @@ public ServiceCall msConcatAsync(String msConcatDestinationPath, String accountN return null; } final String op = "MSCONCAT"; - final Boolean deletesourcedirectory = null; + final Boolean deleteSourceDirectory = null; this.client.getBaseUrl().set("{accountName}", accountName); this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); - Call call = service.msConcat(msConcatDestinationPath, deletesourcedirectory, streamContents, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + 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 @@ -812,18 +816,18 @@ public void onResponse(Call call, Response response) } /** - * Concatenates the list of source files into the destination file. 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. + * 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 Caution: Setting this parameter to true will delete the parent directory of all source files provided to the MsConcat method. + * @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, InputStream streamContents, Boolean deletesourcedirectory) throws CloudException, IOException, IllegalArgumentException { + 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."); } @@ -842,25 +846,25 @@ public ServiceResponse msConcat(String msConcatDestinationPath, String acc if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - String op = "MSCONCAT"; + final String op = "MSCONCAT"; this.client.getBaseUrl().set("{accountName}", accountName); this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); - Call call = service.msConcat(msConcatDestinationPath, deletesourcedirectory, streamContents, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + 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. 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. + * 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 Caution: Setting this parameter to true will delete the parent directory of all source files provided to the MsConcat method. + * @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, InputStream streamContents, Boolean deletesourcedirectory, final ServiceCallback serviceCallback) throws IllegalArgumentException { + 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."); } @@ -891,7 +895,7 @@ public ServiceCall msConcatAsync(String msConcatDestinationPath, String accountN final String op = "MSCONCAT"; this.client.getBaseUrl().set("{accountName}", accountName); this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); - Call call = service.msConcat(msConcatDestinationPath, deletesourcedirectory, streamContents, op, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + 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 @@ -938,7 +942,7 @@ public ServiceResponse listFileStatus(String listFilePath, S if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - String op = "LISTSTATUS"; + 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()); @@ -1029,7 +1033,7 @@ public ServiceResponse getContentSummary(String getContent if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - String op = "GETCONTENTSUMMARY"; + 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()); @@ -1120,7 +1124,7 @@ public ServiceResponse getFileStatus(String getFilePath, Strin if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - String op = "GETFILESTATUS"; + 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()); @@ -1196,7 +1200,7 @@ private ServiceResponse getFileStatusDelegate(Response append(String directFilePath, String accountName, InputStream streamContents) throws CloudException, IOException, IllegalArgumentException { + 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."); } @@ -1215,11 +1219,11 @@ public ServiceResponse append(String directFilePath, String accountName, I if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - String op = "APPEND"; - String append = "true"; + 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, streamContents, op, append, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + 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()); } @@ -1233,7 +1237,7 @@ public ServiceResponse append(String directFilePath, String accountName, I * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall appendAsync(String directFilePath, String accountName, InputStream streamContents, final ServiceCallback serviceCallback) throws IllegalArgumentException { + 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."); } @@ -1265,7 +1269,7 @@ public ServiceCall appendAsync(String directFilePath, String accountName, InputS final String append = "true"; this.client.getBaseUrl().set("{accountName}", accountName); this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); - Call call = service.append(directFilePath, streamContents, op, append, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + 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 @@ -1312,13 +1316,13 @@ public ServiceResponse create(String directFilePath, String accountName) t if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - String op = "CREATE"; - String write = "true"; - InputStream streamContents = null; - Boolean overwrite = 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, streamContents, overwrite, op, write, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + 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()); } @@ -1357,11 +1361,11 @@ public ServiceCall createAsync(String directFilePath, String accountName, final } final String op = "CREATE"; final String write = "true"; - final InputStream streamContents = null; + 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, streamContents, overwrite, op, write, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + 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 @@ -1388,7 +1392,7 @@ public void onResponse(Call call, Response response) * @throws IllegalArgumentException exception thrown from invalid parameters * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse create(String directFilePath, String accountName, InputStream streamContents, Boolean overwrite) throws CloudException, IOException, IllegalArgumentException { + 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."); } @@ -1404,11 +1408,11 @@ public ServiceResponse create(String directFilePath, String accountName, I if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - String op = "CREATE"; - String write = "true"; + 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, streamContents, overwrite, op, write, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + 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()); } @@ -1423,7 +1427,7 @@ public ServiceResponse create(String directFilePath, String accountName, I * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ - public ServiceCall createAsync(String directFilePath, String accountName, InputStream streamContents, Boolean overwrite, final ServiceCallback serviceCallback) throws IllegalArgumentException { + 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."); } @@ -1451,7 +1455,7 @@ public ServiceCall createAsync(String directFilePath, String accountName, InputS final String write = "true"; this.client.getBaseUrl().set("{accountName}", accountName); this.client.getBaseUrl().set("{adlsFileSystemDnsSuffix}", this.client.getAdlsFileSystemDnsSuffix()); - Call call = service.create(directFilePath, streamContents, overwrite, op, write, this.client.getApiVersion(), this.client.getSubscriptionId(), this.client.getAcceptLanguage()); + 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 @@ -1498,10 +1502,10 @@ public ServiceResponse open(String directFilePath, String accountNa if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - String op = "OPEN"; - String read = "true"; - Long length = null; - Long offset = 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()); @@ -1590,8 +1594,8 @@ public ServiceResponse open(String directFilePath, String accountNa if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - String op = "OPEN"; - String read = "true"; + 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()); @@ -1689,7 +1693,7 @@ public ServiceResponse setAcl(String setAclFilePath, String accountName, S if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - String op = "SETACL"; + 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()); @@ -1788,7 +1792,7 @@ public ServiceResponse modifyAclEntries(String modifyAclFilePath, String a if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - String op = "MODIFYACLENTRIES"; + 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()); @@ -1887,7 +1891,7 @@ public ServiceResponse removeAclEntries(String removeAclFilePath, String a if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - String op = "REMOVEACLENTRIES"; + 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()); @@ -1982,7 +1986,7 @@ public ServiceResponse removeAcl(String aclFilePath, String accountName) t if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - String op = "REMOVEACL"; + 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()); @@ -2072,7 +2076,7 @@ public ServiceResponse getAclStatus(String aclFilePath, String if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - String op = "GETACLSTATUS"; + 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()); @@ -2163,8 +2167,8 @@ public ServiceResponse delete(String filePath, String accou if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - String op = "DELETE"; - Boolean recursive = 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()); @@ -2250,7 +2254,7 @@ public ServiceResponse delete(String filePath, String accou if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - String op = "DELETE"; + 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()); @@ -2346,7 +2350,7 @@ public ServiceResponse rename(String renameFilePath, String if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - String op = "RENAME"; + 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()); @@ -2442,9 +2446,9 @@ public ServiceResponse setOwner(String setOwnerFilePath, String accountNam if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - String op = "SETOWNER"; - String owner = null; - String group = 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()); @@ -2532,7 +2536,7 @@ public ServiceResponse setOwner(String setOwnerFilePath, String accountNam if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - String op = "SETOWNER"; + 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()); @@ -2624,8 +2628,8 @@ public ServiceResponse setPermission(String setPermissionFilePath, String if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - String op = "SETPERMISSION"; - String permission = 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()); @@ -2711,7 +2715,7 @@ public ServiceResponse setPermission(String setPermissionFilePath, String if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); } - String op = "SETPERMISSION"; + 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()); 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 index 5972261fd930..084b97c892c2 100644 --- 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 @@ -71,8 +71,8 @@ public class FileStatusProperties { private String permission; /** - * Gets the type of the path object. Possible values include: 'File', - * 'Directory'. + * Gets the type of the path object. Possible values include: 'FILE', + * 'DIRECTORY'. */ @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) private FileType type; 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 index dda36248fe2f..5892f4840a9c 100644 --- 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 @@ -17,11 +17,11 @@ * Defines values for FileType. */ public enum FileType { - /** Enum value File. */ - FILE("File"), + /** Enum value FILE. */ + FILE("FILE"), - /** Enum value Directory. */ - DIRECTORY("Directory"); + /** Enum value DIRECTORY. */ + DIRECTORY("DIRECTORY"); /** The actual serialized value for a FileType instance. */ private String value; 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 index ebccbd78c827..2349a53cbb93 100644 --- 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 @@ -16,12 +16,9 @@ import org.junit.BeforeClass; import org.junit.Test; -import java.io.ByteArrayInputStream; import java.io.InputStream; -import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashMap; import java.util.List; import sun.misc.IOUtils; @@ -29,18 +26,13 @@ public class DataLakeStoreFilesystemOperationsTests extends DataLakeStoreManagementTestBase { // constants private static String folderToCreate = "SDKTestFolder01"; - private static String folderToMove = "SDKTestMoveFolder01"; - private static String fileToCreate = "SDKTestFile01.txt"; private static String fileToCreateWithContents = "SDKTestFile02.txt"; private static String fileToCopy = "SDKTestCopyFile01.txt"; private static String fileToConcatTo = "SDKTestConcatFile01.txt"; - private static String fileToMove = "SDKTestMoveFile01.txt"; private static String fileContentsToAdd = "These are some random test contents 1234!@"; - private static String fileContentsToAppend = "More test contents, that were appended!"; private static String rgName = generateName("javaadlsrg"); - private static String location = "eastus2"; private static String adlsAcct = generateName("javaadlsacct"); private static String aclUserId = "027c28d5-c91d-49f0-98c5-d10134b169b3"; @@ -48,6 +40,7 @@ public class DataLakeStoreFilesystemOperationsTests extends DataLakeStoreManagem public static void setup() throws Exception { createClients(); ResourceGroup group = new ResourceGroup(); + String location = "eastus2"; group.setLocation(location); resourceManagementClient.getResourceGroupsOperations().createOrUpdate(rgName, group); @@ -183,9 +176,10 @@ public void DataLakeStoreFileSystemAppendToFile() throws Exception 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, - new ByteArrayInputStream(fileContentsToAdd.getBytes())); + fileContentsToAppend.getBytes()); GetAndCompareFileOrFolder(adlsAcct, filePath, FileType.FILE, fileContentsToAppend.length()); @@ -194,8 +188,6 @@ public void DataLakeStoreFileSystemAppendToFile() throws Exception @Test public void DataLakeStoreFileSystemConcatenateFiles() throws Exception { - - String filePath1 = CreateFile(adlsAcct, true, true, folderToCreate); GetAndCompareFileOrFolder(adlsAcct, filePath1, FileType.FILE, fileContentsToAdd.length()); @@ -207,13 +199,13 @@ public void DataLakeStoreFileSystemConcatenateFiles() throws Exception String targetFolder = CreateFolder(adlsAcct, true); dataLakeStoreFileSystemManagementClient.getFileSystemOperations().concat( - String.format("{0}/{1}", targetFolder, fileToConcatTo), + String.format("%s/%s", targetFolder, fileToConcatTo), adlsAcct, Arrays.asList(new String[]{filePath1, filePath2}) ); GetAndCompareFileOrFolder(adlsAcct, - String.format("{0}/{1}", targetFolder, fileToConcatTo), + String.format("%s/%s", targetFolder, fileToConcatTo), FileType.FILE, fileContentsToAdd.length() * 2); @@ -251,13 +243,13 @@ public void DataLakeStoreFileSystemMsConcatenateFiles() throws Exception String targetFolder = CreateFolder(adlsAcct, true); dataLakeStoreFileSystemManagementClient.getFileSystemOperations().msConcat( - String.format("{0}/{1}", targetFolder, fileToConcatTo), + String.format("%s/%s", targetFolder, fileToConcatTo), adlsAcct, - new ByteArrayInputStream(String.format("sources={0},{1}", filePath1, filePath2).getBytes()), + String.format("sources=%s,%s", filePath1, filePath2).getBytes(), false); GetAndCompareFileOrFolder(adlsAcct, - String.format("{0}/{1}", targetFolder, fileToConcatTo), + String.format("%s/%s", targetFolder, fileToConcatTo), FileType.FILE, fileContentsToAdd.length() * 2); @@ -284,7 +276,7 @@ public void DataLakeStoreFileSystemMsConcatenateFiles() throws Exception @Test public void DataLakeStoreFileSystemMsConcatDeleteDir() throws Exception { - String concatFolderPath = String.format("{0}/{1}", folderToCreate, + String concatFolderPath = String.format("%s/%s", folderToCreate, "msconcatFolder"); String filePath1 = CreateFile(adlsAcct, true, true, concatFolderPath); @@ -298,14 +290,16 @@ public void DataLakeStoreFileSystemMsConcatDeleteDir() throws Exception String targetFolder = CreateFolder(adlsAcct, true); + String destination = String.format("%s/%s", targetFolder, fileToConcatTo); + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().msConcat( - String.format("{0}/{1}", targetFolder, fileToConcatTo), + destination, adlsAcct, - new ByteArrayInputStream(String.format("sources={0},{1}", filePath1, filePath2).getBytes()), + String.format("sources=%s,%s", filePath1, filePath2).getBytes(), true); GetAndCompareFileOrFolder(adlsAcct, - String.format("{0}/{1}", targetFolder, fileToConcatTo), + String.format("%s/%s", targetFolder, fileToConcatTo), FileType.FILE, fileContentsToAdd.length()*2); @@ -344,15 +338,17 @@ public void DataLakeStoreFileSystemMoveFileAndFolder() throws Exception 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("{0}/{1}", targetFolder1, fileToMove)).getBody(); + String.format("%s/%s", targetFolder1, fileToMove)).getBody(); Assert.assertTrue(moveFileResponse.getOperationResult()); GetAndCompareFileOrFolder(adlsAcct, - String.format("{0}/{1}", targetFolder1, fileToMove), + String.format("%s/%s", targetFolder1, fileToMove), FileType.FILE, fileContentsToAdd.length()); @@ -579,7 +575,7 @@ public void DataLakeStoreFileSystemSetAcl() throws Exception // add an entry to the ACL Entries String newAcls = String.join(",", aclGetResponse.getAclStatus().getEntries()); - newAcls += String.format(",user:{0}:rwx", aclUserId); + newAcls += String.format(",user:%s:rwx", aclUserId); dataLakeStoreFileSystemManagementClient.getFileSystemOperations().setAcl("/", adlsAcct, @@ -614,9 +610,9 @@ public void DataLakeStoreFileSystemSetDeleteAclEntry() throws Exception int currentCount = aclGetResponse.getAclStatus().getEntries().size(); // add an entry to the ACL Entries - String newAce = String.format("user:{0}:rwx", aclUserId); + String newAce = String.format("user:%s:rwx", aclUserId); - dataLakeStoreFileSystemManagementClient.getFileSystemOperations().modifyAclEntries("/", + dataLakeStoreFileSystemManagementClient.getFileSystemOperations().modifyAclEntries("", adlsAcct, newAce); @@ -639,7 +635,7 @@ public void DataLakeStoreFileSystemSetDeleteAclEntry() throws Exception Assert.assertTrue(found); // now remove the entry - String aceToRemove = String.format(",user:{0}", aclUserId); + String aceToRemove = String.format(",user:%s", aclUserId); dataLakeStoreFileSystemManagementClient.getFileSystemOperations().removeAclEntries("/", adlsAcct, aceToRemove); @@ -679,7 +675,8 @@ private String CreateFolder(String caboAccountName, boolean randomName) throws E private String CreateFile(String caboAccountName, boolean withContents, boolean randomName, String folderName) throws Exception { - String filePath = randomName ? generateName(String.format("{0}/{1}", folderName, fileToCreate)) : String.format("{0}/{1}", folderName, fileToCreate); + String fileToCreate = "SDKTestFile01.txt"; + String filePath = randomName ? generateName(String.format("%s/%s", folderName, fileToCreate)) : String.format("%s/%s", folderName, fileToCreate); if (!withContents) { @@ -692,7 +689,7 @@ private String CreateFile(String caboAccountName, boolean withContents, boolean dataLakeStoreFileSystemManagementClient.getFileSystemOperations().create( filePath, caboAccountName, - new ByteArrayInputStream(fileContentsToAdd.getBytes()), + fileContentsToAdd.getBytes(), false); // never overwrite during create, because if it exists we want to fail. } From 401c94f671e292e57608e967689139ebcbc8e1a2 Mon Sep 17 00:00:00 2001 From: begoldsm Date: Wed, 23 Mar 2016 11:48:33 -0700 Subject: [PATCH 9/9] Add oss repo --- azure/pom.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/azure/pom.xml b/azure/pom.xml index 7db5552919f4..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 + +