From 9f3cfc1624c6eb13d1773a5eddd4092809f7943e Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 12 Jul 2021 04:51:31 +0000 Subject: [PATCH] CodeGen from PR 15149 in Azure/azure-rest-api-specs Merge 6864adf0715ccefeda4a82f74ff098cc7bc77728 into 5e85541d5c4d00459a8e2dcb14512c964e2c1ce9 --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../README.md | 101 + .../pom.xml | 86 + .../hybriddatamanager/HybridDataManager.java | 311 +++ .../fluent/DataManagersClient.java | 324 +++ .../fluent/DataServicesClient.java | 77 + .../fluent/DataStoreTypesClient.java | 77 + .../fluent/DataStoresClient.java | 220 ++ .../fluent/HybridDataManagementClient.java | 102 + .../fluent/JobDefinitionsClient.java | 379 +++ .../hybriddatamanager/fluent/JobsClient.java | 350 +++ .../fluent/OperationsClient.java | 36 + .../fluent/PublicKeysClient.java | 76 + .../AvailableProviderOperationInner.java | 148 ++ .../fluent/models/DataManagerInner.java | 96 + .../fluent/models/DataServiceInner.java | 114 + .../fluent/models/DataStoreInner.java | 184 ++ .../fluent/models/DataStoreTypeInner.java | 143 ++ .../fluent/models/JobDefinitionInner.java | 300 +++ .../fluent/models/JobDetailsInner.java | 140 ++ .../fluent/models/JobInner.java | 367 +++ .../fluent/models/PublicKeyInner.java | 98 + .../fluent/models/package-info.java | 6 + .../fluent/package-info.java | 6 + .../AvailableProviderOperationImpl.java | 46 + .../implementation/DataManagerImpl.java | 203 ++ .../DataManagersClientImpl.java | 1493 ++++++++++++ .../implementation/DataManagersImpl.java | 170 ++ .../implementation/DataServiceImpl.java | 65 + .../DataServicesClientImpl.java | 534 +++++ .../implementation/DataServicesImpl.java | 75 + .../implementation/DataStoreImpl.java | 176 ++ .../implementation/DataStoreTypeImpl.java | 69 + .../DataStoreTypesClientImpl.java | 535 +++++ .../implementation/DataStoreTypesImpl.java | 76 + .../implementation/DataStoresClientImpl.java | 1174 +++++++++ .../implementation/DataStoresImpl.java | 191 ++ .../HybridDataManagementClientBuilder.java | 146 ++ .../HybridDataManagementClientImpl.java | 391 +++ .../implementation/JobDefinitionImpl.java | 253 ++ .../JobDefinitionsClientImpl.java | 2024 ++++++++++++++++ .../implementation/JobDefinitionsImpl.java | 278 +++ .../implementation/JobDetailsImpl.java | 65 + .../implementation/JobImpl.java | 98 + .../implementation/JobsClientImpl.java | 2129 +++++++++++++++++ .../implementation/JobsImpl.java | 171 ++ .../implementation/OperationsClientImpl.java | 270 +++ .../implementation/OperationsImpl.java | 46 + .../implementation/PublicKeyImpl.java | 49 + .../implementation/PublicKeysClientImpl.java | 531 ++++ .../implementation/PublicKeysImpl.java | 75 + .../implementation/Utils.java | 204 ++ .../implementation/package-info.java | 6 + .../models/AvailableProviderOperation.java | 47 + .../AvailableProviderOperationDisplay.java | 166 ++ .../models/AvailableProviderOperations.java | 81 + .../models/CustomerSecret.java | 118 + .../hybriddatamanager/models/DataManager.java | 250 ++ .../models/DataManagerList.java | 81 + .../models/DataManagerUpdateParameter.java | 84 + .../models/DataManagers.java | 160 ++ .../hybriddatamanager/models/DataService.java | 60 + .../models/DataServiceList.java | 81 + .../models/DataServices.java | 69 + .../hybriddatamanager/models/DataStore.java | 287 +++ .../models/DataStoreList.java | 81 + .../models/DataStoreType.java | 68 + .../models/DataStoreTypeList.java | 81 + .../models/DataStoreTypes.java | 69 + .../hybriddatamanager/models/DataStores.java | 150 ++ .../models/DmsBaseObject.java | 69 + .../hybriddatamanager/models/Error.java | 80 + .../models/ErrorDetails.java | 128 + .../models/IsJobCancellable.java | 47 + .../hybriddatamanager/models/Job.java | 123 + .../models/JobDefinition.java | 427 ++++ .../models/JobDefinitionList.java | 81 + .../models/JobDefinitions.java | 238 ++ .../hybriddatamanager/models/JobDetails.java | 46 + .../hybriddatamanager/models/JobList.java | 81 + .../hybriddatamanager/models/JobStages.java | 137 ++ .../hybriddatamanager/models/JobStatus.java | 65 + .../hybriddatamanager/models/Jobs.java | 241 ++ .../hybriddatamanager/models/Key.java | 117 + .../hybriddatamanager/models/Operations.java | 31 + .../hybriddatamanager/models/PublicKey.java | 52 + .../models/PublicKeyList.java | 81 + .../hybriddatamanager/models/PublicKeys.java | 69 + .../hybriddatamanager/models/RunLocation.java | 122 + .../models/RunParameters.java | 115 + .../hybriddatamanager/models/Schedule.java | 77 + .../hybriddatamanager/models/Sku.java | 76 + .../hybriddatamanager/models/State.java | 50 + .../models/SupportedAlgorithm.java | 53 + .../models/UserConfirmation.java | 47 + .../models/package-info.java | 6 + .../hybriddatamanager/package-info.java | 6 + .../src/main/java/module-info.java | 19 + sdk/hybriddatamanager/ci.yml | 33 + sdk/hybriddatamanager/pom.xml | 53 + 102 files changed, 19994 insertions(+) create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/CHANGELOG.md create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/README.md create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/pom.xml create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/HybridDataManager.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/DataManagersClient.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/DataServicesClient.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/DataStoreTypesClient.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/DataStoresClient.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/HybridDataManagementClient.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/JobDefinitionsClient.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/JobsClient.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/OperationsClient.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/PublicKeysClient.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/AvailableProviderOperationInner.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/DataManagerInner.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/DataServiceInner.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/DataStoreInner.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/DataStoreTypeInner.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/JobDefinitionInner.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/JobDetailsInner.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/JobInner.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/PublicKeyInner.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/package-info.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/package-info.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/AvailableProviderOperationImpl.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataManagerImpl.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataManagersClientImpl.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataManagersImpl.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataServiceImpl.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataServicesClientImpl.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataServicesImpl.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataStoreImpl.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataStoreTypeImpl.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataStoreTypesClientImpl.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataStoreTypesImpl.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataStoresClientImpl.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataStoresImpl.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/HybridDataManagementClientBuilder.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/HybridDataManagementClientImpl.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/JobDefinitionImpl.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/JobDefinitionsClientImpl.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/JobDefinitionsImpl.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/JobDetailsImpl.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/JobImpl.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/JobsClientImpl.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/JobsImpl.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/OperationsClientImpl.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/OperationsImpl.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/PublicKeyImpl.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/PublicKeysClientImpl.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/PublicKeysImpl.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/Utils.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/package-info.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/AvailableProviderOperation.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/AvailableProviderOperationDisplay.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/AvailableProviderOperations.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/CustomerSecret.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataManager.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataManagerList.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataManagerUpdateParameter.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataManagers.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataService.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataServiceList.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataServices.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataStore.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataStoreList.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataStoreType.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataStoreTypeList.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataStoreTypes.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataStores.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DmsBaseObject.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/Error.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/ErrorDetails.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/IsJobCancellable.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/Job.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/JobDefinition.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/JobDefinitionList.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/JobDefinitions.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/JobDetails.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/JobList.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/JobStages.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/JobStatus.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/Jobs.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/Key.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/Operations.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/PublicKey.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/PublicKeyList.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/PublicKeys.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/RunLocation.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/RunParameters.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/Schedule.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/Sku.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/State.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/SupportedAlgorithm.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/UserConfirmation.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/package-info.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/package-info.java create mode 100644 sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/module-info.java create mode 100644 sdk/hybriddatamanager/ci.yml create mode 100644 sdk/hybriddatamanager/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 112dc6d1a68f..9180f55f0aa1 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -305,6 +305,7 @@ com.azure.resourcemanager:azure-resourcemanager-deviceprovisioningservices;1.0.0 com.azure.resourcemanager:azure-resourcemanager-postgresqlflexibleserver;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-elastic;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-webpubsub;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-hybriddatamanager;1.0.0-beta.1;1.0.0-beta.1 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current # version. Unreleased dependencies are only valid for dependency versions. diff --git a/pom.xml b/pom.xml index d50033058ed5..5191002dbac3 100644 --- a/pom.xml +++ b/pom.xml @@ -760,6 +760,7 @@ sdk/healthbot sdk/healthcareapis sdk/hybridcompute + sdk/hybriddatamanager sdk/hybridkubernetes sdk/identity sdk/imagebuilder diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/CHANGELOG.md b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/CHANGELOG.md new file mode 100644 index 000000000000..6325e5464855 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-07-12) + +- Azure Resource Manager HybridData client library for Java. This package contains Microsoft Azure SDK for HybridData Management SDK. Package tag package-2019-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/README.md b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/README.md new file mode 100644 index 000000000000..aaf7b7c5f2a0 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/README.md @@ -0,0 +1,101 @@ +# Azure Resource Manager HybridData client library for Java + +Azure Resource Manager HybridData client library for Java. + +This package contains Microsoft Azure SDK for HybridData Management SDK. Package tag package-2019-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-hybriddatamanager;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-hybriddatamanager + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +HybridDataManager manager = HybridDataManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/pom.xml b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/pom.xml new file mode 100644 index 000000000000..9365deec21f4 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/pom.xml @@ -0,0 +1,86 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-hybriddatamanager + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for HybridData Management + This package contains Microsoft Azure SDK for HybridData Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2019-06. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + + com.azure + azure-core + 1.18.0 + + + com.azure + azure-core-management + 1.3.1 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + + diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/HybridDataManager.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/HybridDataManager.java new file mode 100644 index 000000000000..894fc119ee39 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/HybridDataManager.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybriddatamanager.fluent.HybridDataManagementClient; +import com.azure.resourcemanager.hybriddatamanager.implementation.DataManagersImpl; +import com.azure.resourcemanager.hybriddatamanager.implementation.DataServicesImpl; +import com.azure.resourcemanager.hybriddatamanager.implementation.DataStoreTypesImpl; +import com.azure.resourcemanager.hybriddatamanager.implementation.DataStoresImpl; +import com.azure.resourcemanager.hybriddatamanager.implementation.HybridDataManagementClientBuilder; +import com.azure.resourcemanager.hybriddatamanager.implementation.JobDefinitionsImpl; +import com.azure.resourcemanager.hybriddatamanager.implementation.JobsImpl; +import com.azure.resourcemanager.hybriddatamanager.implementation.OperationsImpl; +import com.azure.resourcemanager.hybriddatamanager.implementation.PublicKeysImpl; +import com.azure.resourcemanager.hybriddatamanager.models.DataManagers; +import com.azure.resourcemanager.hybriddatamanager.models.DataServices; +import com.azure.resourcemanager.hybriddatamanager.models.DataStoreTypes; +import com.azure.resourcemanager.hybriddatamanager.models.DataStores; +import com.azure.resourcemanager.hybriddatamanager.models.JobDefinitions; +import com.azure.resourcemanager.hybriddatamanager.models.Jobs; +import com.azure.resourcemanager.hybriddatamanager.models.Operations; +import com.azure.resourcemanager.hybriddatamanager.models.PublicKeys; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Entry point to HybridDataManager. */ +public final class HybridDataManager { + private Operations operations; + + private DataManagers dataManagers; + + private DataServices dataServices; + + private JobDefinitions jobDefinitions; + + private Jobs jobs; + + private DataStores dataStores; + + private DataStoreTypes dataStoreTypes; + + private PublicKeys publicKeys; + + private final HybridDataManagementClient clientObject; + + private HybridDataManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new HybridDataManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of HybridData service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the HybridData service API instance. + */ + public static HybridDataManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create HybridDataManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new HybridDataManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of HybridData service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the HybridData service API instance. + */ + public HybridDataManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.hybriddatamanager") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.addAll(this.policies); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new HybridDataManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of DataManagers. */ + public DataManagers dataManagers() { + if (this.dataManagers == null) { + this.dataManagers = new DataManagersImpl(clientObject.getDataManagers(), this); + } + return dataManagers; + } + + /** @return Resource collection API of DataServices. */ + public DataServices dataServices() { + if (this.dataServices == null) { + this.dataServices = new DataServicesImpl(clientObject.getDataServices(), this); + } + return dataServices; + } + + /** @return Resource collection API of JobDefinitions. */ + public JobDefinitions jobDefinitions() { + if (this.jobDefinitions == null) { + this.jobDefinitions = new JobDefinitionsImpl(clientObject.getJobDefinitions(), this); + } + return jobDefinitions; + } + + /** @return Resource collection API of Jobs. */ + public Jobs jobs() { + if (this.jobs == null) { + this.jobs = new JobsImpl(clientObject.getJobs(), this); + } + return jobs; + } + + /** @return Resource collection API of DataStores. */ + public DataStores dataStores() { + if (this.dataStores == null) { + this.dataStores = new DataStoresImpl(clientObject.getDataStores(), this); + } + return dataStores; + } + + /** @return Resource collection API of DataStoreTypes. */ + public DataStoreTypes dataStoreTypes() { + if (this.dataStoreTypes == null) { + this.dataStoreTypes = new DataStoreTypesImpl(clientObject.getDataStoreTypes(), this); + } + return dataStoreTypes; + } + + /** @return Resource collection API of PublicKeys. */ + public PublicKeys publicKeys() { + if (this.publicKeys == null) { + this.publicKeys = new PublicKeysImpl(clientObject.getPublicKeys(), this); + } + return publicKeys; + } + + /** + * @return Wrapped service client HybridDataManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + */ + public HybridDataManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/DataManagersClient.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/DataManagersClient.java new file mode 100644 index 000000000000..ac3f7b457d56 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/DataManagersClient.java @@ -0,0 +1,324 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.DataManagerInner; +import com.azure.resourcemanager.hybriddatamanager.models.DataManagerUpdateParameter; + +/** An instance of this class provides access to all the operations defined in DataManagersClient. */ +public interface DataManagersClient { + /** + * Lists all the data manager resources available under the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dataManager resources Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the data manager resources available under the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dataManager resources Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists all the data manager resources available under the given resource group. + * + * @param resourceGroupName The Resource Group Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dataManager resources Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the data manager resources available under the given resource group. + * + * @param resourceGroupName The Resource Group Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dataManager resources Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets information about the specified data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified data manager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataManagerInner getByResourceGroup(String resourceGroupName, String dataManagerName); + + /** + * Gets information about the specified data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified data manager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String dataManagerName, Context context); + + /** + * Creates a new data manager resource with the specified parameters. Existing resources cannot be updated with this + * API and should instead be updated with the Update data manager resource API. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManager Data manager resource details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DataManagerInner> beginCreate( + String resourceGroupName, String dataManagerName, DataManagerInner dataManager); + + /** + * Creates a new data manager resource with the specified parameters. Existing resources cannot be updated with this + * API and should instead be updated with the Update data manager resource API. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManager Data manager resource details from request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DataManagerInner> beginCreate( + String resourceGroupName, String dataManagerName, DataManagerInner dataManager, Context context); + + /** + * Creates a new data manager resource with the specified parameters. Existing resources cannot be updated with this + * API and should instead be updated with the Update data manager resource API. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManager Data manager resource details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataManagerInner create(String resourceGroupName, String dataManagerName, DataManagerInner dataManager); + + /** + * Creates a new data manager resource with the specified parameters. Existing resources cannot be updated with this + * API and should instead be updated with the Update data manager resource API. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManager Data manager resource details from request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataManagerInner create( + String resourceGroupName, String dataManagerName, DataManagerInner dataManager, Context context); + + /** + * Deletes a data manager resource in Microsoft Azure. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String dataManagerName); + + /** + * Deletes a data manager resource in Microsoft Azure. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String dataManagerName, Context context); + + /** + * Deletes a data manager resource in Microsoft Azure. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String dataManagerName); + + /** + * Deletes a data manager resource in Microsoft Azure. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String dataManagerName, Context context); + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the data manager + * resource on the server matches this value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DataManagerInner> beginUpdate( + String resourceGroupName, + String dataManagerName, + DataManagerUpdateParameter dataManagerUpdateParameter, + String ifMatch); + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the data manager + * resource on the server matches this value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DataManagerInner> beginUpdate( + String resourceGroupName, + String dataManagerName, + DataManagerUpdateParameter dataManagerUpdateParameter, + String ifMatch, + Context context); + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the data manager + * resource on the server matches this value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataManagerInner update( + String resourceGroupName, + String dataManagerName, + DataManagerUpdateParameter dataManagerUpdateParameter, + String ifMatch); + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataManagerInner update( + String resourceGroupName, String dataManagerName, DataManagerUpdateParameter dataManagerUpdateParameter); + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the data manager + * resource on the server matches this value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataManagerInner update( + String resourceGroupName, + String dataManagerName, + DataManagerUpdateParameter dataManagerUpdateParameter, + String ifMatch, + Context context); +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/DataServicesClient.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/DataServicesClient.java new file mode 100644 index 000000000000..6f7a9ba68f2c --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/DataServicesClient.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.DataServiceInner; + +/** An instance of this class provides access to all the operations defined in DataServicesClient. */ +public interface DataServicesClient { + /** + * This method gets all the data services. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Service Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataManager(String resourceGroupName, String dataManagerName); + + /** + * This method gets all the data services. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Service Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataManager( + String resourceGroupName, String dataManagerName, Context context); + + /** + * Gets the data service that matches the data service name given. + * + * @param dataServiceName The name of the data service that is being queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data service that matches the data service name given. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataServiceInner get(String dataServiceName, String resourceGroupName, String dataManagerName); + + /** + * Gets the data service that matches the data service name given. + * + * @param dataServiceName The name of the data service that is being queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data service that matches the data service name given. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String dataServiceName, String resourceGroupName, String dataManagerName, Context context); +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/DataStoreTypesClient.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/DataStoreTypesClient.java new file mode 100644 index 000000000000..7c559d966037 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/DataStoreTypesClient.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.DataStoreTypeInner; + +/** An instance of this class provides access to all the operations defined in DataStoreTypesClient. */ +public interface DataStoreTypesClient { + /** + * Gets all the data store/repository types that the resource supports. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data store/repository types that the resource supports. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataManager(String resourceGroupName, String dataManagerName); + + /** + * Gets all the data store/repository types that the resource supports. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data store/repository types that the resource supports. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataManager( + String resourceGroupName, String dataManagerName, Context context); + + /** + * Gets the data store/repository type given its name. + * + * @param dataStoreTypeName The data store/repository type name for which details are needed. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data store/repository type given its name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataStoreTypeInner get(String dataStoreTypeName, String resourceGroupName, String dataManagerName); + + /** + * Gets the data store/repository type given its name. + * + * @param dataStoreTypeName The data store/repository type name for which details are needed. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data store/repository type given its name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String dataStoreTypeName, String resourceGroupName, String dataManagerName, Context context); +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/DataStoresClient.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/DataStoresClient.java new file mode 100644 index 000000000000..3aa1f1f47dc8 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/DataStoresClient.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.DataStoreInner; + +/** An instance of this class provides access to all the operations defined in DataStoresClient. */ +public interface DataStoresClient { + /** + * Gets all the data stores/repositories in the given resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data stores/repositories in the given resource. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataManager(String resourceGroupName, String dataManagerName); + + /** + * Gets all the data stores/repositories in the given resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data stores/repositories in the given resource. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataManager( + String resourceGroupName, String dataManagerName, String filter, Context context); + + /** + * This method gets the data store/repository by name. + * + * @param dataStoreName The data store/repository name queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data store. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataStoreInner get(String dataStoreName, String resourceGroupName, String dataManagerName); + + /** + * This method gets the data store/repository by name. + * + * @param dataStoreName The data store/repository name queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data store. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String dataStoreName, String resourceGroupName, String dataManagerName, Context context); + + /** + * Creates or updates the data store/repository in the data manager. + * + * @param dataStoreName The data store/repository name to be created or updated. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataStore The data store/repository object to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data store. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DataStoreInner> beginCreateOrUpdate( + String dataStoreName, String resourceGroupName, String dataManagerName, DataStoreInner dataStore); + + /** + * Creates or updates the data store/repository in the data manager. + * + * @param dataStoreName The data store/repository name to be created or updated. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataStore The data store/repository object to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data store. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DataStoreInner> beginCreateOrUpdate( + String dataStoreName, + String resourceGroupName, + String dataManagerName, + DataStoreInner dataStore, + Context context); + + /** + * Creates or updates the data store/repository in the data manager. + * + * @param dataStoreName The data store/repository name to be created or updated. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataStore The data store/repository object to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data store. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataStoreInner createOrUpdate( + String dataStoreName, String resourceGroupName, String dataManagerName, DataStoreInner dataStore); + + /** + * Creates or updates the data store/repository in the data manager. + * + * @param dataStoreName The data store/repository name to be created or updated. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataStore The data store/repository object to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data store. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataStoreInner createOrUpdate( + String dataStoreName, + String resourceGroupName, + String dataManagerName, + DataStoreInner dataStore, + Context context); + + /** + * This method deletes the given data store/repository. + * + * @param dataStoreName The data store/repository name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String dataStoreName, String resourceGroupName, String dataManagerName); + + /** + * This method deletes the given data store/repository. + * + * @param dataStoreName The data store/repository name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String dataStoreName, String resourceGroupName, String dataManagerName, Context context); + + /** + * This method deletes the given data store/repository. + * + * @param dataStoreName The data store/repository name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String dataStoreName, String resourceGroupName, String dataManagerName); + + /** + * This method deletes the given data store/repository. + * + * @param dataStoreName The data store/repository name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String dataStoreName, String resourceGroupName, String dataManagerName, Context context); +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/HybridDataManagementClient.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/HybridDataManagementClient.java new file mode 100644 index 000000000000..90a7fd36c4c8 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/HybridDataManagementClient.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for HybridDataManagementClient class. */ +public interface HybridDataManagementClient { + /** + * Gets The Subscription Id. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the DataManagersClient object to access its operations. + * + * @return the DataManagersClient object. + */ + DataManagersClient getDataManagers(); + + /** + * Gets the DataServicesClient object to access its operations. + * + * @return the DataServicesClient object. + */ + DataServicesClient getDataServices(); + + /** + * Gets the JobDefinitionsClient object to access its operations. + * + * @return the JobDefinitionsClient object. + */ + JobDefinitionsClient getJobDefinitions(); + + /** + * Gets the JobsClient object to access its operations. + * + * @return the JobsClient object. + */ + JobsClient getJobs(); + + /** + * Gets the DataStoresClient object to access its operations. + * + * @return the DataStoresClient object. + */ + DataStoresClient getDataStores(); + + /** + * Gets the DataStoreTypesClient object to access its operations. + * + * @return the DataStoreTypesClient object. + */ + DataStoreTypesClient getDataStoreTypes(); + + /** + * Gets the PublicKeysClient object to access its operations. + * + * @return the PublicKeysClient object. + */ + PublicKeysClient getPublicKeys(); +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/JobDefinitionsClient.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/JobDefinitionsClient.java new file mode 100644 index 000000000000..1493648623d4 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/JobDefinitionsClient.java @@ -0,0 +1,379 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.JobDefinitionInner; +import com.azure.resourcemanager.hybriddatamanager.models.RunParameters; + +/** An instance of this class provides access to all the operations defined in JobDefinitionsClient. */ +public interface JobDefinitionsClient { + /** + * This method gets all the job definitions of the given data service name. + * + * @param dataServiceName The data service type of interest. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataService( + String dataServiceName, String resourceGroupName, String dataManagerName); + + /** + * This method gets all the job definitions of the given data service name. + * + * @param dataServiceName The data service type of interest. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataService( + String dataServiceName, String resourceGroupName, String dataManagerName, String filter, Context context); + + /** + * This method gets job definition object by name. + * + * @param dataServiceName The data service name of the job definition. + * @param jobDefinitionName The job definition name that is being queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobDefinitionInner get( + String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName); + + /** + * This method gets job definition object by name. + * + * @param dataServiceName The data service name of the job definition. + * @param jobDefinitionName The job definition name that is being queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + Context context); + + /** + * Creates or updates a job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be created or updated. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param jobDefinition Job Definition object to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, JobDefinitionInner> beginCreateOrUpdate( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + JobDefinitionInner jobDefinition); + + /** + * Creates or updates a job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be created or updated. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param jobDefinition Job Definition object to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, JobDefinitionInner> beginCreateOrUpdate( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + JobDefinitionInner jobDefinition, + Context context); + + /** + * Creates or updates a job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be created or updated. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param jobDefinition Job Definition object to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobDefinitionInner createOrUpdate( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + JobDefinitionInner jobDefinition); + + /** + * Creates or updates a job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be created or updated. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param jobDefinition Job Definition object to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobDefinitionInner createOrUpdate( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + JobDefinitionInner jobDefinition, + Context context); + + /** + * This method deletes the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName); + + /** + * This method deletes the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + Context context); + + /** + * This method deletes the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName); + + /** + * This method deletes the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + Context context); + + /** + * This method runs a job instance of the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName Name of the job definition. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param runParameters Run time parameters for the job definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRun( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + RunParameters runParameters); + + /** + * This method runs a job instance of the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName Name of the job definition. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param runParameters Run time parameters for the job definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRun( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + RunParameters runParameters, + Context context); + + /** + * This method runs a job instance of the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName Name of the job definition. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param runParameters Run time parameters for the job definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void run( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + RunParameters runParameters); + + /** + * This method runs a job instance of the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName Name of the job definition. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param runParameters Run time parameters for the job definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void run( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + RunParameters runParameters, + Context context); + + /** + * This method gets all the job definitions of the given data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataManager(String resourceGroupName, String dataManagerName); + + /** + * This method gets all the job definitions of the given data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataManager( + String resourceGroupName, String dataManagerName, String filter, Context context); +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/JobsClient.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/JobsClient.java new file mode 100644 index 000000000000..36d177f45607 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/JobsClient.java @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.JobInner; + +/** An instance of this class provides access to all the operations defined in JobsClient. */ +public interface JobsClient { + /** + * This method gets all the jobs of a given job definition. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition for which jobs are needed. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByJobDefinition( + String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName); + + /** + * This method gets all the jobs of a given job definition. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition for which jobs are needed. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByJobDefinition( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + String filter, + Context context); + + /** + * This method gets a data manager job given the jobId. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data service job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobInner get( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName); + + /** + * This method gets a data manager job given the jobId. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param expand $expand is supported on details parameter for job, which provides details on the job stages. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data service job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName, + String expand, + Context context); + + /** + * Cancels the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginCancel( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName); + + /** + * Cancels the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginCancel( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName, + Context context); + + /** + * Cancels the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void cancel( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName); + + /** + * Cancels the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void cancel( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName, + Context context); + + /** + * Resumes the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginResume( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName); + + /** + * Resumes the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginResume( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName, + Context context); + + /** + * Resumes the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void resume( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName); + + /** + * Resumes the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void resume( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName, + Context context); + + /** + * This method gets all the jobs of a data service type in a given resource. + * + * @param dataServiceName The name of the data service of interest. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataService(String dataServiceName, String resourceGroupName, String dataManagerName); + + /** + * This method gets all the jobs of a data service type in a given resource. + * + * @param dataServiceName The name of the data service of interest. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataService( + String dataServiceName, String resourceGroupName, String dataManagerName, String filter, Context context); + + /** + * This method gets all the jobs at the data manager resource level. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataManager(String resourceGroupName, String dataManagerName); + + /** + * This method gets all the jobs at the data manager resource level. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataManager( + String resourceGroupName, String dataManagerName, String filter, Context context); +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/OperationsClient.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/OperationsClient.java new file mode 100644 index 000000000000..ce7c30aecc9c --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.AvailableProviderOperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * The list of operations for Microsoft.HybridData provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class for set of operations used for discovery of available provider operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * The list of operations for Microsoft.HybridData provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class for set of operations used for discovery of available provider operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/PublicKeysClient.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/PublicKeysClient.java new file mode 100644 index 000000000000..a8054df5c1f3 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/PublicKeysClient.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.PublicKeyInner; + +/** An instance of this class provides access to all the operations defined in PublicKeysClient. */ +public interface PublicKeysClient { + /** + * This method gets the list view of public keys, however it will only have one element. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publicKey Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataManager(String resourceGroupName, String dataManagerName); + + /** + * This method gets the list view of public keys, however it will only have one element. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publicKey Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataManager(String resourceGroupName, String dataManagerName, Context context); + + /** + * This method gets the public keys. + * + * @param publicKeyName Name of the public key. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PublicKeyInner get(String publicKeyName, String resourceGroupName, String dataManagerName); + + /** + * This method gets the public keys. + * + * @param publicKeyName Name of the public key. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String publicKeyName, String resourceGroupName, String dataManagerName, Context context); +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/AvailableProviderOperationInner.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/AvailableProviderOperationInner.java new file mode 100644 index 000000000000..930e8d42a295 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/AvailableProviderOperationInner.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybriddatamanager.models.AvailableProviderOperationDisplay; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Class represents provider operation. */ +@Fluent +public final class AvailableProviderOperationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableProviderOperationInner.class); + + /* + * Gets or Sets Name of the operations + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Gets or sets Display information + * Contains the localized display information for this particular + * operation/action + */ + @JsonProperty(value = "display") + private AvailableProviderOperationDisplay display; + + /* + * Gets or sets Origin + * The intended executor of the operation; governs the display of the + * operation in the RBAC UX and the audit logs UX. + * Default value is “user,system” + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * Gets or sets Properties + * Reserved for future use + */ + @JsonProperty(value = "properties") + private Object properties; + + /** + * Get the name property: Gets or Sets Name of the operations. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets or Sets Name of the operations. + * + * @param name the name value to set. + * @return the AvailableProviderOperationInner object itself. + */ + public AvailableProviderOperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display property: Gets or sets Display information Contains the localized display information for this + * particular operation/action. + * + * @return the display value. + */ + public AvailableProviderOperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Gets or sets Display information Contains the localized display information for this + * particular operation/action. + * + * @param display the display value to set. + * @return the AvailableProviderOperationInner object itself. + */ + public AvailableProviderOperationInner withDisplay(AvailableProviderOperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: Gets or sets Origin The intended executor of the operation; governs the display of the + * operation in the RBAC UX and the audit logs UX. Default value is “user,system”. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: Gets or sets Origin The intended executor of the operation; governs the display of the + * operation in the RBAC UX and the audit logs UX. Default value is “user,system”. + * + * @param origin the origin value to set. + * @return the AvailableProviderOperationInner object itself. + */ + public AvailableProviderOperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the properties property: Gets or sets Properties Reserved for future use. + * + * @return the properties value. + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties property: Gets or sets Properties Reserved for future use. + * + * @param properties the properties value to set. + * @return the AvailableProviderOperationInner object itself. + */ + public AvailableProviderOperationInner withProperties(Object properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model AvailableProviderOperationInner")); + } + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/DataManagerInner.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/DataManagerInner.java new file mode 100644 index 000000000000..2f94ef2fce10 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/DataManagerInner.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybriddatamanager.models.Sku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The DataManager resource. */ +@Fluent +public final class DataManagerInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataManagerInner.class); + + /* + * Etag of the Resource. + */ + @JsonProperty(value = "etag") + private String etag; + + /* + * The sku type. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the etag property: Etag of the Resource. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: Etag of the Resource. + * + * @param etag the etag value to set. + * @return the DataManagerInner object itself. + */ + public DataManagerInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the sku property: The sku type. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The sku type. + * + * @param sku the sku value to set. + * @return the DataManagerInner object itself. + */ + public DataManagerInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** {@inheritDoc} */ + @Override + public DataManagerInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataManagerInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/DataServiceInner.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/DataServiceInner.java new file mode 100644 index 000000000000..728b986011bb --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/DataServiceInner.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybriddatamanager.models.DmsBaseObject; +import com.azure.resourcemanager.hybriddatamanager.models.State; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Data Service. */ +@JsonFlatten +@Fluent +public class DataServiceInner extends DmsBaseObject { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataServiceInner.class); + + /* + * State of the data service. + */ + @JsonProperty(value = "properties.state", required = true) + private State state; + + /* + * Supported data store types which can be used as a sink. + */ + @JsonProperty(value = "properties.supportedDataSinkTypes") + private List supportedDataSinkTypes; + + /* + * Supported data store types which can be used as a source. + */ + @JsonProperty(value = "properties.supportedDataSourceTypes") + private List supportedDataSourceTypes; + + /** + * Get the state property: State of the data service. + * + * @return the state value. + */ + public State state() { + return this.state; + } + + /** + * Set the state property: State of the data service. + * + * @param state the state value to set. + * @return the DataServiceInner object itself. + */ + public DataServiceInner withState(State state) { + this.state = state; + return this; + } + + /** + * Get the supportedDataSinkTypes property: Supported data store types which can be used as a sink. + * + * @return the supportedDataSinkTypes value. + */ + public List supportedDataSinkTypes() { + return this.supportedDataSinkTypes; + } + + /** + * Set the supportedDataSinkTypes property: Supported data store types which can be used as a sink. + * + * @param supportedDataSinkTypes the supportedDataSinkTypes value to set. + * @return the DataServiceInner object itself. + */ + public DataServiceInner withSupportedDataSinkTypes(List supportedDataSinkTypes) { + this.supportedDataSinkTypes = supportedDataSinkTypes; + return this; + } + + /** + * Get the supportedDataSourceTypes property: Supported data store types which can be used as a source. + * + * @return the supportedDataSourceTypes value. + */ + public List supportedDataSourceTypes() { + return this.supportedDataSourceTypes; + } + + /** + * Set the supportedDataSourceTypes property: Supported data store types which can be used as a source. + * + * @param supportedDataSourceTypes the supportedDataSourceTypes value to set. + * @return the DataServiceInner object itself. + */ + public DataServiceInner withSupportedDataSourceTypes(List supportedDataSourceTypes) { + this.supportedDataSourceTypes = supportedDataSourceTypes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (state() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property state in model DataServiceInner")); + } + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/DataStoreInner.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/DataStoreInner.java new file mode 100644 index 000000000000..6f62e9fb0286 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/DataStoreInner.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybriddatamanager.models.CustomerSecret; +import com.azure.resourcemanager.hybriddatamanager.models.DmsBaseObject; +import com.azure.resourcemanager.hybriddatamanager.models.State; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Data store. */ +@JsonFlatten +@Fluent +public class DataStoreInner extends DmsBaseObject { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataStoreInner.class); + + /* + * Arm Id for the manager resource to which the data source is associated. + * This is optional. + */ + @JsonProperty(value = "properties.repositoryId") + private String repositoryId; + + /* + * State of the data source. + */ + @JsonProperty(value = "properties.state", required = true) + private State state; + + /* + * A generic json used differently by each data source type. + */ + @JsonProperty(value = "properties.extendedProperties") + private Object extendedProperties; + + /* + * The arm id of the data store type. + */ + @JsonProperty(value = "properties.dataStoreTypeId", required = true) + private String dataStoreTypeId; + + /* + * List of customer secrets containing a key identifier and key value. The + * key identifier is a way for the specific data source to understand the + * key. Value contains customer secret encrypted by the encryptionKeys. + */ + @JsonProperty(value = "properties.customerSecrets") + private List customerSecrets; + + /** + * Get the repositoryId property: Arm Id for the manager resource to which the data source is associated. This is + * optional. + * + * @return the repositoryId value. + */ + public String repositoryId() { + return this.repositoryId; + } + + /** + * Set the repositoryId property: Arm Id for the manager resource to which the data source is associated. This is + * optional. + * + * @param repositoryId the repositoryId value to set. + * @return the DataStoreInner object itself. + */ + public DataStoreInner withRepositoryId(String repositoryId) { + this.repositoryId = repositoryId; + return this; + } + + /** + * Get the state property: State of the data source. + * + * @return the state value. + */ + public State state() { + return this.state; + } + + /** + * Set the state property: State of the data source. + * + * @param state the state value to set. + * @return the DataStoreInner object itself. + */ + public DataStoreInner withState(State state) { + this.state = state; + return this; + } + + /** + * Get the extendedProperties property: A generic json used differently by each data source type. + * + * @return the extendedProperties value. + */ + public Object extendedProperties() { + return this.extendedProperties; + } + + /** + * Set the extendedProperties property: A generic json used differently by each data source type. + * + * @param extendedProperties the extendedProperties value to set. + * @return the DataStoreInner object itself. + */ + public DataStoreInner withExtendedProperties(Object extendedProperties) { + this.extendedProperties = extendedProperties; + return this; + } + + /** + * Get the dataStoreTypeId property: The arm id of the data store type. + * + * @return the dataStoreTypeId value. + */ + public String dataStoreTypeId() { + return this.dataStoreTypeId; + } + + /** + * Set the dataStoreTypeId property: The arm id of the data store type. + * + * @param dataStoreTypeId the dataStoreTypeId value to set. + * @return the DataStoreInner object itself. + */ + public DataStoreInner withDataStoreTypeId(String dataStoreTypeId) { + this.dataStoreTypeId = dataStoreTypeId; + return this; + } + + /** + * Get the customerSecrets property: List of customer secrets containing a key identifier and key value. The key + * identifier is a way for the specific data source to understand the key. Value contains customer secret encrypted + * by the encryptionKeys. + * + * @return the customerSecrets value. + */ + public List customerSecrets() { + return this.customerSecrets; + } + + /** + * Set the customerSecrets property: List of customer secrets containing a key identifier and key value. The key + * identifier is a way for the specific data source to understand the key. Value contains customer secret encrypted + * by the encryptionKeys. + * + * @param customerSecrets the customerSecrets value to set. + * @return the DataStoreInner object itself. + */ + public DataStoreInner withCustomerSecrets(List customerSecrets) { + this.customerSecrets = customerSecrets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (state() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property state in model DataStoreInner")); + } + if (dataStoreTypeId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property dataStoreTypeId in model DataStoreInner")); + } + if (customerSecrets() != null) { + customerSecrets().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/DataStoreTypeInner.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/DataStoreTypeInner.java new file mode 100644 index 000000000000..705536cf6685 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/DataStoreTypeInner.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybriddatamanager.models.DmsBaseObject; +import com.azure.resourcemanager.hybriddatamanager.models.State; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Data Store Type. */ +@JsonFlatten +@Fluent +public class DataStoreTypeInner extends DmsBaseObject { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataStoreTypeInner.class); + + /* + * Arm type for the manager resource to which the data source type is + * associated. This is optional. + */ + @JsonProperty(value = "properties.repositoryType") + private String repositoryType; + + /* + * State of the data store type. + */ + @JsonProperty(value = "properties.state", required = true) + private State state; + + /* + * Supported data services where it can be used as a sink. + */ + @JsonProperty(value = "properties.supportedDataServicesAsSink") + private List supportedDataServicesAsSink; + + /* + * Supported data services where it can be used as a source. + */ + @JsonProperty(value = "properties.supportedDataServicesAsSource") + private List supportedDataServicesAsSource; + + /** + * Get the repositoryType property: Arm type for the manager resource to which the data source type is associated. + * This is optional. + * + * @return the repositoryType value. + */ + public String repositoryType() { + return this.repositoryType; + } + + /** + * Set the repositoryType property: Arm type for the manager resource to which the data source type is associated. + * This is optional. + * + * @param repositoryType the repositoryType value to set. + * @return the DataStoreTypeInner object itself. + */ + public DataStoreTypeInner withRepositoryType(String repositoryType) { + this.repositoryType = repositoryType; + return this; + } + + /** + * Get the state property: State of the data store type. + * + * @return the state value. + */ + public State state() { + return this.state; + } + + /** + * Set the state property: State of the data store type. + * + * @param state the state value to set. + * @return the DataStoreTypeInner object itself. + */ + public DataStoreTypeInner withState(State state) { + this.state = state; + return this; + } + + /** + * Get the supportedDataServicesAsSink property: Supported data services where it can be used as a sink. + * + * @return the supportedDataServicesAsSink value. + */ + public List supportedDataServicesAsSink() { + return this.supportedDataServicesAsSink; + } + + /** + * Set the supportedDataServicesAsSink property: Supported data services where it can be used as a sink. + * + * @param supportedDataServicesAsSink the supportedDataServicesAsSink value to set. + * @return the DataStoreTypeInner object itself. + */ + public DataStoreTypeInner withSupportedDataServicesAsSink(List supportedDataServicesAsSink) { + this.supportedDataServicesAsSink = supportedDataServicesAsSink; + return this; + } + + /** + * Get the supportedDataServicesAsSource property: Supported data services where it can be used as a source. + * + * @return the supportedDataServicesAsSource value. + */ + public List supportedDataServicesAsSource() { + return this.supportedDataServicesAsSource; + } + + /** + * Set the supportedDataServicesAsSource property: Supported data services where it can be used as a source. + * + * @param supportedDataServicesAsSource the supportedDataServicesAsSource value to set. + * @return the DataStoreTypeInner object itself. + */ + public DataStoreTypeInner withSupportedDataServicesAsSource(List supportedDataServicesAsSource) { + this.supportedDataServicesAsSource = supportedDataServicesAsSource; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (state() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property state in model DataStoreTypeInner")); + } + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/JobDefinitionInner.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/JobDefinitionInner.java new file mode 100644 index 000000000000..53dedf871b39 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/JobDefinitionInner.java @@ -0,0 +1,300 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybriddatamanager.models.CustomerSecret; +import com.azure.resourcemanager.hybriddatamanager.models.DmsBaseObject; +import com.azure.resourcemanager.hybriddatamanager.models.RunLocation; +import com.azure.resourcemanager.hybriddatamanager.models.Schedule; +import com.azure.resourcemanager.hybriddatamanager.models.State; +import com.azure.resourcemanager.hybriddatamanager.models.UserConfirmation; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Job Definition. */ +@JsonFlatten +@Fluent +public class JobDefinitionInner extends DmsBaseObject { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobDefinitionInner.class); + + /* + * Data Source Id associated to the job definition. + */ + @JsonProperty(value = "properties.dataSourceId", required = true) + private String dataSourceId; + + /* + * Data Sink Id associated to the job definition. + */ + @JsonProperty(value = "properties.dataSinkId", required = true) + private String dataSinkId; + + /* + * Schedule for running the job definition + */ + @JsonProperty(value = "properties.schedules") + private List schedules; + + /* + * State of the job definition. + */ + @JsonProperty(value = "properties.state", required = true) + private State state; + + /* + * Last modified time of the job definition. + */ + @JsonProperty(value = "properties.lastModifiedTime") + private OffsetDateTime lastModifiedTime; + + /* + * This is the preferred geo location for the job to run. + */ + @JsonProperty(value = "properties.runLocation") + private RunLocation runLocation; + + /* + * Enum to detect if user confirmation is required. If not passed will + * default to NotRequired. + */ + @JsonProperty(value = "properties.userConfirmation") + private UserConfirmation userConfirmation; + + /* + * A generic json used differently by each data service type. + */ + @JsonProperty(value = "properties.dataServiceInput") + private Object dataServiceInput; + + /* + * List of customer secrets containing a key identifier and key value. The + * key identifier is a way for the specific data source to understand the + * key. Value contains customer secret encrypted by the encryptionKeys. + */ + @JsonProperty(value = "properties.customerSecrets") + private List customerSecrets; + + /** + * Get the dataSourceId property: Data Source Id associated to the job definition. + * + * @return the dataSourceId value. + */ + public String dataSourceId() { + return this.dataSourceId; + } + + /** + * Set the dataSourceId property: Data Source Id associated to the job definition. + * + * @param dataSourceId the dataSourceId value to set. + * @return the JobDefinitionInner object itself. + */ + public JobDefinitionInner withDataSourceId(String dataSourceId) { + this.dataSourceId = dataSourceId; + return this; + } + + /** + * Get the dataSinkId property: Data Sink Id associated to the job definition. + * + * @return the dataSinkId value. + */ + public String dataSinkId() { + return this.dataSinkId; + } + + /** + * Set the dataSinkId property: Data Sink Id associated to the job definition. + * + * @param dataSinkId the dataSinkId value to set. + * @return the JobDefinitionInner object itself. + */ + public JobDefinitionInner withDataSinkId(String dataSinkId) { + this.dataSinkId = dataSinkId; + return this; + } + + /** + * Get the schedules property: Schedule for running the job definition. + * + * @return the schedules value. + */ + public List schedules() { + return this.schedules; + } + + /** + * Set the schedules property: Schedule for running the job definition. + * + * @param schedules the schedules value to set. + * @return the JobDefinitionInner object itself. + */ + public JobDefinitionInner withSchedules(List schedules) { + this.schedules = schedules; + return this; + } + + /** + * Get the state property: State of the job definition. + * + * @return the state value. + */ + public State state() { + return this.state; + } + + /** + * Set the state property: State of the job definition. + * + * @param state the state value to set. + * @return the JobDefinitionInner object itself. + */ + public JobDefinitionInner withState(State state) { + this.state = state; + return this; + } + + /** + * Get the lastModifiedTime property: Last modified time of the job definition. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Set the lastModifiedTime property: Last modified time of the job definition. + * + * @param lastModifiedTime the lastModifiedTime value to set. + * @return the JobDefinitionInner object itself. + */ + public JobDefinitionInner withLastModifiedTime(OffsetDateTime lastModifiedTime) { + this.lastModifiedTime = lastModifiedTime; + return this; + } + + /** + * Get the runLocation property: This is the preferred geo location for the job to run. + * + * @return the runLocation value. + */ + public RunLocation runLocation() { + return this.runLocation; + } + + /** + * Set the runLocation property: This is the preferred geo location for the job to run. + * + * @param runLocation the runLocation value to set. + * @return the JobDefinitionInner object itself. + */ + public JobDefinitionInner withRunLocation(RunLocation runLocation) { + this.runLocation = runLocation; + return this; + } + + /** + * Get the userConfirmation property: Enum to detect if user confirmation is required. If not passed will default to + * NotRequired. + * + * @return the userConfirmation value. + */ + public UserConfirmation userConfirmation() { + return this.userConfirmation; + } + + /** + * Set the userConfirmation property: Enum to detect if user confirmation is required. If not passed will default to + * NotRequired. + * + * @param userConfirmation the userConfirmation value to set. + * @return the JobDefinitionInner object itself. + */ + public JobDefinitionInner withUserConfirmation(UserConfirmation userConfirmation) { + this.userConfirmation = userConfirmation; + return this; + } + + /** + * Get the dataServiceInput property: A generic json used differently by each data service type. + * + * @return the dataServiceInput value. + */ + public Object dataServiceInput() { + return this.dataServiceInput; + } + + /** + * Set the dataServiceInput property: A generic json used differently by each data service type. + * + * @param dataServiceInput the dataServiceInput value to set. + * @return the JobDefinitionInner object itself. + */ + public JobDefinitionInner withDataServiceInput(Object dataServiceInput) { + this.dataServiceInput = dataServiceInput; + return this; + } + + /** + * Get the customerSecrets property: List of customer secrets containing a key identifier and key value. The key + * identifier is a way for the specific data source to understand the key. Value contains customer secret encrypted + * by the encryptionKeys. + * + * @return the customerSecrets value. + */ + public List customerSecrets() { + return this.customerSecrets; + } + + /** + * Set the customerSecrets property: List of customer secrets containing a key identifier and key value. The key + * identifier is a way for the specific data source to understand the key. Value contains customer secret encrypted + * by the encryptionKeys. + * + * @param customerSecrets the customerSecrets value to set. + * @return the JobDefinitionInner object itself. + */ + public JobDefinitionInner withCustomerSecrets(List customerSecrets) { + this.customerSecrets = customerSecrets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (dataSourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property dataSourceId in model JobDefinitionInner")); + } + if (dataSinkId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property dataSinkId in model JobDefinitionInner")); + } + if (schedules() != null) { + schedules().forEach(e -> e.validate()); + } + if (state() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property state in model JobDefinitionInner")); + } + if (customerSecrets() != null) { + customerSecrets().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/JobDetailsInner.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/JobDetailsInner.java new file mode 100644 index 000000000000..5e6c3666b9ce --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/JobDetailsInner.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybriddatamanager.models.ErrorDetails; +import com.azure.resourcemanager.hybriddatamanager.models.JobStages; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Job details. */ +@Fluent +public final class JobDetailsInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobDetailsInner.class); + + /* + * List of stages that ran in the job + */ + @JsonProperty(value = "jobStages") + private List jobStages; + + /* + * JobDefinition at the time of the run + */ + @JsonProperty(value = "jobDefinition") + private JobDefinitionInner jobDefinition; + + /* + * Error details for failure. This is optional. + */ + @JsonProperty(value = "errorDetails") + private List errorDetails; + + /* + * Item Details Link to download files or see details + */ + @JsonProperty(value = "itemDetailsLink") + private String itemDetailsLink; + + /** + * Get the jobStages property: List of stages that ran in the job. + * + * @return the jobStages value. + */ + public List jobStages() { + return this.jobStages; + } + + /** + * Set the jobStages property: List of stages that ran in the job. + * + * @param jobStages the jobStages value to set. + * @return the JobDetailsInner object itself. + */ + public JobDetailsInner withJobStages(List jobStages) { + this.jobStages = jobStages; + return this; + } + + /** + * Get the jobDefinition property: JobDefinition at the time of the run. + * + * @return the jobDefinition value. + */ + public JobDefinitionInner jobDefinition() { + return this.jobDefinition; + } + + /** + * Set the jobDefinition property: JobDefinition at the time of the run. + * + * @param jobDefinition the jobDefinition value to set. + * @return the JobDetailsInner object itself. + */ + public JobDetailsInner withJobDefinition(JobDefinitionInner jobDefinition) { + this.jobDefinition = jobDefinition; + return this; + } + + /** + * Get the errorDetails property: Error details for failure. This is optional. + * + * @return the errorDetails value. + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Set the errorDetails property: Error details for failure. This is optional. + * + * @param errorDetails the errorDetails value to set. + * @return the JobDetailsInner object itself. + */ + public JobDetailsInner withErrorDetails(List errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + /** + * Get the itemDetailsLink property: Item Details Link to download files or see details. + * + * @return the itemDetailsLink value. + */ + public String itemDetailsLink() { + return this.itemDetailsLink; + } + + /** + * Set the itemDetailsLink property: Item Details Link to download files or see details. + * + * @param itemDetailsLink the itemDetailsLink value to set. + * @return the JobDetailsInner object itself. + */ + public JobDetailsInner withItemDetailsLink(String itemDetailsLink) { + this.itemDetailsLink = itemDetailsLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (jobStages() != null) { + jobStages().forEach(e -> e.validate()); + } + if (jobDefinition() != null) { + jobDefinition().validate(); + } + if (errorDetails() != null) { + errorDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/JobInner.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/JobInner.java new file mode 100644 index 000000000000..2ec7daff4af9 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/JobInner.java @@ -0,0 +1,367 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybriddatamanager.models.DmsBaseObject; +import com.azure.resourcemanager.hybriddatamanager.models.Error; +import com.azure.resourcemanager.hybriddatamanager.models.IsJobCancellable; +import com.azure.resourcemanager.hybriddatamanager.models.JobStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Data service job. */ +@JsonFlatten +@Fluent +public class JobInner extends DmsBaseObject { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobInner.class); + + /* + * Status of the job. + */ + @JsonProperty(value = "status", required = true) + private JobStatus status; + + /* + * Time at which the job was started in UTC ISO 8601 format. + */ + @JsonProperty(value = "startTime", required = true) + private OffsetDateTime startTime; + + /* + * Time at which the job ended in UTC ISO 8601 format. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * Top level error for the job. + */ + @JsonProperty(value = "error") + private Error error; + + /* + * Describes whether the job is cancellable. + */ + @JsonProperty(value = "properties.isCancellable", required = true) + private IsJobCancellable isCancellable; + + /* + * Number of bytes processed by the job as of now. + */ + @JsonProperty(value = "properties.bytesProcessed") + private Long bytesProcessed; + + /* + * Number of items processed by the job as of now + */ + @JsonProperty(value = "properties.itemsProcessed") + private Long itemsProcessed; + + /* + * Number of bytes to be processed by the job in total. + */ + @JsonProperty(value = "properties.totalBytesToProcess") + private Long totalBytesToProcess; + + /* + * Number of items to be processed by the job in total + */ + @JsonProperty(value = "properties.totalItemsToProcess") + private Long totalItemsToProcess; + + /* + * Details of a job run. This field will only be sent for expand details + * filter. + */ + @JsonProperty(value = "properties.details") + private JobDetailsInner details; + + /* + * Name of the data source on which the job was triggered. + */ + @JsonProperty(value = "properties.dataSourceName") + private String dataSourceName; + + /* + * Name of the data sink on which the job was triggered. + */ + @JsonProperty(value = "properties.dataSinkName") + private String dataSinkName; + + /** + * Get the status property: Status of the job. + * + * @return the status value. + */ + public JobStatus status() { + return this.status; + } + + /** + * Set the status property: Status of the job. + * + * @param status the status value to set. + * @return the JobInner object itself. + */ + public JobInner withStatus(JobStatus status) { + this.status = status; + return this; + } + + /** + * Get the startTime property: Time at which the job was started in UTC ISO 8601 format. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: Time at which the job was started in UTC ISO 8601 format. + * + * @param startTime the startTime value to set. + * @return the JobInner object itself. + */ + public JobInner withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: Time at which the job ended in UTC ISO 8601 format. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: Time at which the job ended in UTC ISO 8601 format. + * + * @param endTime the endTime value to set. + * @return the JobInner object itself. + */ + public JobInner withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the error property: Top level error for the job. + * + * @return the error value. + */ + public Error error() { + return this.error; + } + + /** + * Set the error property: Top level error for the job. + * + * @param error the error value to set. + * @return the JobInner object itself. + */ + public JobInner withError(Error error) { + this.error = error; + return this; + } + + /** + * Get the isCancellable property: Describes whether the job is cancellable. + * + * @return the isCancellable value. + */ + public IsJobCancellable isCancellable() { + return this.isCancellable; + } + + /** + * Set the isCancellable property: Describes whether the job is cancellable. + * + * @param isCancellable the isCancellable value to set. + * @return the JobInner object itself. + */ + public JobInner withIsCancellable(IsJobCancellable isCancellable) { + this.isCancellable = isCancellable; + return this; + } + + /** + * Get the bytesProcessed property: Number of bytes processed by the job as of now. + * + * @return the bytesProcessed value. + */ + public Long bytesProcessed() { + return this.bytesProcessed; + } + + /** + * Set the bytesProcessed property: Number of bytes processed by the job as of now. + * + * @param bytesProcessed the bytesProcessed value to set. + * @return the JobInner object itself. + */ + public JobInner withBytesProcessed(Long bytesProcessed) { + this.bytesProcessed = bytesProcessed; + return this; + } + + /** + * Get the itemsProcessed property: Number of items processed by the job as of now. + * + * @return the itemsProcessed value. + */ + public Long itemsProcessed() { + return this.itemsProcessed; + } + + /** + * Set the itemsProcessed property: Number of items processed by the job as of now. + * + * @param itemsProcessed the itemsProcessed value to set. + * @return the JobInner object itself. + */ + public JobInner withItemsProcessed(Long itemsProcessed) { + this.itemsProcessed = itemsProcessed; + return this; + } + + /** + * Get the totalBytesToProcess property: Number of bytes to be processed by the job in total. + * + * @return the totalBytesToProcess value. + */ + public Long totalBytesToProcess() { + return this.totalBytesToProcess; + } + + /** + * Set the totalBytesToProcess property: Number of bytes to be processed by the job in total. + * + * @param totalBytesToProcess the totalBytesToProcess value to set. + * @return the JobInner object itself. + */ + public JobInner withTotalBytesToProcess(Long totalBytesToProcess) { + this.totalBytesToProcess = totalBytesToProcess; + return this; + } + + /** + * Get the totalItemsToProcess property: Number of items to be processed by the job in total. + * + * @return the totalItemsToProcess value. + */ + public Long totalItemsToProcess() { + return this.totalItemsToProcess; + } + + /** + * Set the totalItemsToProcess property: Number of items to be processed by the job in total. + * + * @param totalItemsToProcess the totalItemsToProcess value to set. + * @return the JobInner object itself. + */ + public JobInner withTotalItemsToProcess(Long totalItemsToProcess) { + this.totalItemsToProcess = totalItemsToProcess; + return this; + } + + /** + * Get the details property: Details of a job run. This field will only be sent for expand details filter. + * + * @return the details value. + */ + public JobDetailsInner details() { + return this.details; + } + + /** + * Set the details property: Details of a job run. This field will only be sent for expand details filter. + * + * @param details the details value to set. + * @return the JobInner object itself. + */ + public JobInner withDetails(JobDetailsInner details) { + this.details = details; + return this; + } + + /** + * Get the dataSourceName property: Name of the data source on which the job was triggered. + * + * @return the dataSourceName value. + */ + public String dataSourceName() { + return this.dataSourceName; + } + + /** + * Set the dataSourceName property: Name of the data source on which the job was triggered. + * + * @param dataSourceName the dataSourceName value to set. + * @return the JobInner object itself. + */ + public JobInner withDataSourceName(String dataSourceName) { + this.dataSourceName = dataSourceName; + return this; + } + + /** + * Get the dataSinkName property: Name of the data sink on which the job was triggered. + * + * @return the dataSinkName value. + */ + public String dataSinkName() { + return this.dataSinkName; + } + + /** + * Set the dataSinkName property: Name of the data sink on which the job was triggered. + * + * @param dataSinkName the dataSinkName value to set. + * @return the JobInner object itself. + */ + public JobInner withDataSinkName(String dataSinkName) { + this.dataSinkName = dataSinkName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (status() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property status in model JobInner")); + } + if (startTime() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property startTime in model JobInner")); + } + if (error() != null) { + error().validate(); + } + if (isCancellable() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property isCancellable in model JobInner")); + } + if (details() != null) { + details().validate(); + } + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/PublicKeyInner.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/PublicKeyInner.java new file mode 100644 index 000000000000..c21eb97fe3da --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/PublicKeyInner.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybriddatamanager.models.DmsBaseObject; +import com.azure.resourcemanager.hybriddatamanager.models.Key; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Public key. */ +@JsonFlatten +@Fluent +public class PublicKeyInner extends DmsBaseObject { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicKeyInner.class); + + /* + * Level one public key for encryption + */ + @JsonProperty(value = "properties.dataServiceLevel1Key", required = true) + private Key dataServiceLevel1Key; + + /* + * Level two public key for encryption + */ + @JsonProperty(value = "properties.dataServiceLevel2Key", required = true) + private Key dataServiceLevel2Key; + + /** + * Get the dataServiceLevel1Key property: Level one public key for encryption. + * + * @return the dataServiceLevel1Key value. + */ + public Key dataServiceLevel1Key() { + return this.dataServiceLevel1Key; + } + + /** + * Set the dataServiceLevel1Key property: Level one public key for encryption. + * + * @param dataServiceLevel1Key the dataServiceLevel1Key value to set. + * @return the PublicKeyInner object itself. + */ + public PublicKeyInner withDataServiceLevel1Key(Key dataServiceLevel1Key) { + this.dataServiceLevel1Key = dataServiceLevel1Key; + return this; + } + + /** + * Get the dataServiceLevel2Key property: Level two public key for encryption. + * + * @return the dataServiceLevel2Key value. + */ + public Key dataServiceLevel2Key() { + return this.dataServiceLevel2Key; + } + + /** + * Set the dataServiceLevel2Key property: Level two public key for encryption. + * + * @param dataServiceLevel2Key the dataServiceLevel2Key value to set. + * @return the PublicKeyInner object itself. + */ + public PublicKeyInner withDataServiceLevel2Key(Key dataServiceLevel2Key) { + this.dataServiceLevel2Key = dataServiceLevel2Key; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (dataServiceLevel1Key() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dataServiceLevel1Key in model PublicKeyInner")); + } else { + dataServiceLevel1Key().validate(); + } + if (dataServiceLevel2Key() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dataServiceLevel2Key in model PublicKeyInner")); + } else { + dataServiceLevel2Key().validate(); + } + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/package-info.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/package-info.java new file mode 100644 index 000000000000..d8a09c166672 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for HybridDataManagementClient. null. */ +package com.azure.resourcemanager.hybriddatamanager.fluent.models; diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/package-info.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/package-info.java new file mode 100644 index 000000000000..36d5022819ab --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for HybridDataManagementClient. null. */ +package com.azure.resourcemanager.hybriddatamanager.fluent; diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/AvailableProviderOperationImpl.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/AvailableProviderOperationImpl.java new file mode 100644 index 000000000000..c9b5ff96caca --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/AvailableProviderOperationImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.implementation; + +import com.azure.resourcemanager.hybriddatamanager.fluent.models.AvailableProviderOperationInner; +import com.azure.resourcemanager.hybriddatamanager.models.AvailableProviderOperation; +import com.azure.resourcemanager.hybriddatamanager.models.AvailableProviderOperationDisplay; + +public final class AvailableProviderOperationImpl implements AvailableProviderOperation { + private AvailableProviderOperationInner innerObject; + + private final com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager; + + AvailableProviderOperationImpl( + AvailableProviderOperationInner innerObject, + com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public AvailableProviderOperationDisplay display() { + return this.innerModel().display(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public Object properties() { + return this.innerModel().properties(); + } + + public AvailableProviderOperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybriddatamanager.HybridDataManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataManagerImpl.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataManagerImpl.java new file mode 100644 index 000000000000..02ec988ccf18 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataManagerImpl.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.DataManagerInner; +import com.azure.resourcemanager.hybriddatamanager.models.DataManager; +import com.azure.resourcemanager.hybriddatamanager.models.DataManagerUpdateParameter; +import com.azure.resourcemanager.hybriddatamanager.models.Sku; +import java.util.Collections; +import java.util.Map; + +public final class DataManagerImpl implements DataManager, DataManager.Definition, DataManager.Update { + private DataManagerInner innerObject; + + private final com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public DataManagerInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybriddatamanager.HybridDataManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String dataManagerName; + + private String updateIfMatch; + + private DataManagerUpdateParameter updateDataManagerUpdateParameter; + + public DataManagerImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public DataManager create() { + this.innerObject = + serviceManager + .serviceClient() + .getDataManagers() + .create(resourceGroupName, dataManagerName, this.innerModel(), Context.NONE); + return this; + } + + public DataManager create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDataManagers() + .create(resourceGroupName, dataManagerName, this.innerModel(), context); + return this; + } + + DataManagerImpl(String name, com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager) { + this.innerObject = new DataManagerInner(); + this.serviceManager = serviceManager; + this.dataManagerName = name; + } + + public DataManagerImpl update() { + this.updateIfMatch = null; + this.updateDataManagerUpdateParameter = new DataManagerUpdateParameter(); + return this; + } + + public DataManager apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDataManagers() + .update( + resourceGroupName, dataManagerName, updateDataManagerUpdateParameter, updateIfMatch, Context.NONE); + return this; + } + + public DataManager apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDataManagers() + .update(resourceGroupName, dataManagerName, updateDataManagerUpdateParameter, updateIfMatch, context); + return this; + } + + DataManagerImpl( + DataManagerInner innerObject, com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.dataManagerName = Utils.getValueFromIdByName(innerObject.id(), "dataManagers"); + } + + public DataManager refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDataManagers() + .getByResourceGroupWithResponse(resourceGroupName, dataManagerName, Context.NONE) + .getValue(); + return this; + } + + public DataManager refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDataManagers() + .getByResourceGroupWithResponse(resourceGroupName, dataManagerName, context) + .getValue(); + return this; + } + + public DataManagerImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DataManagerImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DataManagerImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateDataManagerUpdateParameter.withTags(tags); + return this; + } + } + + public DataManagerImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public DataManagerImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.innerModel().withSku(sku); + return this; + } else { + this.updateDataManagerUpdateParameter.withSku(sku); + return this; + } + } + + public DataManagerImpl withIfMatch(String ifMatch) { + this.updateIfMatch = ifMatch; + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataManagersClientImpl.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataManagersClientImpl.java new file mode 100644 index 000000000000..441e882d1d0e --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataManagersClientImpl.java @@ -0,0 +1,1493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybriddatamanager.fluent.DataManagersClient; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.DataManagerInner; +import com.azure.resourcemanager.hybriddatamanager.models.DataManagerList; +import com.azure.resourcemanager.hybriddatamanager.models.DataManagerUpdateParameter; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DataManagersClient. */ +public final class DataManagersClientImpl implements DataManagersClient { + private final ClientLogger logger = new ClientLogger(DataManagersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DataManagersService service; + + /** The service client containing this operation class. */ + private final HybridDataManagementClientImpl client; + + /** + * Initializes an instance of DataManagersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DataManagersClientImpl(HybridDataManagementClientImpl client) { + this.service = + RestProxy.create(DataManagersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridDataManagementClientDataManagers to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridDataManagement") + private interface DataManagersService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HybridData/dataManagers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData" + + "/dataManagers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData" + + "/dataManagers/{dataManagerName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataManagerName") String dataManagerName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData" + + "/dataManagers/{dataManagerName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataManagerName") String dataManagerName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DataManagerInner dataManager, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData" + + "/dataManagers/{dataManagerName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataManagerName") String dataManagerName, + @QueryParam("api-version") String apiVersion, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData" + + "/dataManagers/{dataManagerName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataManagerName") String dataManagerName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("If-Match") String ifMatch, + @BodyParam("application/json") DataManagerUpdateParameter dataManagerUpdateParameter, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the data manager resources available under the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dataManager resources Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the data manager resources available under the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dataManager resources Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Lists all the data manager resources available under the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dataManager resources Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync()); + } + + /** + * Lists all the data manager resources available under the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dataManager resources Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context)); + } + + /** + * Lists all the data manager resources available under the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dataManager resources Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the data manager resources available under the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dataManager resources Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists all the data manager resources available under the given resource group. + * + * @param resourceGroupName The Resource Group Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dataManager resources Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the data manager resources available under the given resource group. + * + * @param resourceGroupName The Resource Group Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dataManager resources Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Lists all the data manager resources available under the given resource group. + * + * @param resourceGroupName The Resource Group Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dataManager resources Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName)); + } + + /** + * Lists all the data manager resources available under the given resource group. + * + * @param resourceGroupName The Resource Group Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dataManager resources Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context)); + } + + /** + * Lists all the data manager resources available under the given resource group. + * + * @param resourceGroupName The Resource Group Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dataManager resources Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the data manager resources available under the given resource group. + * + * @param resourceGroupName The Resource Group Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dataManager resources Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets information about the specified data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified data manager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String dataManagerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about the specified data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified data manager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String dataManagerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets information about the specified data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified data manager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String dataManagerName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, dataManagerName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the specified data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified data manager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataManagerInner getByResourceGroup(String resourceGroupName, String dataManagerName) { + return getByResourceGroupAsync(resourceGroupName, dataManagerName).block(); + } + + /** + * Gets information about the specified data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified data manager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String dataManagerName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, dataManagerName, context).block(); + } + + /** + * Creates a new data manager resource with the specified parameters. Existing resources cannot be updated with this + * API and should instead be updated with the Update data manager resource API. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManager Data manager resource details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String dataManagerName, DataManagerInner dataManager) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + if (dataManager == null) { + return Mono.error(new IllegalArgumentException("Parameter dataManager is required and cannot be null.")); + } else { + dataManager.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + dataManager, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new data manager resource with the specified parameters. Existing resources cannot be updated with this + * API and should instead be updated with the Update data manager resource API. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManager Data manager resource details from request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String dataManagerName, DataManagerInner dataManager, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + if (dataManager == null) { + return Mono.error(new IllegalArgumentException("Parameter dataManager is required and cannot be null.")); + } else { + dataManager.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + dataManager, + accept, + context); + } + + /** + * Creates a new data manager resource with the specified parameters. Existing resources cannot be updated with this + * API and should instead be updated with the Update data manager resource API. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManager Data manager resource details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DataManagerInner> beginCreateAsync( + String resourceGroupName, String dataManagerName, DataManagerInner dataManager) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, dataManagerName, dataManager); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DataManagerInner.class, DataManagerInner.class, Context.NONE); + } + + /** + * Creates a new data manager resource with the specified parameters. Existing resources cannot be updated with this + * API and should instead be updated with the Update data manager resource API. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManager Data manager resource details from request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DataManagerInner> beginCreateAsync( + String resourceGroupName, String dataManagerName, DataManagerInner dataManager, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, dataManagerName, dataManager, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DataManagerInner.class, DataManagerInner.class, context); + } + + /** + * Creates a new data manager resource with the specified parameters. Existing resources cannot be updated with this + * API and should instead be updated with the Update data manager resource API. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManager Data manager resource details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DataManagerInner> beginCreate( + String resourceGroupName, String dataManagerName, DataManagerInner dataManager) { + return beginCreateAsync(resourceGroupName, dataManagerName, dataManager).getSyncPoller(); + } + + /** + * Creates a new data manager resource with the specified parameters. Existing resources cannot be updated with this + * API and should instead be updated with the Update data manager resource API. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManager Data manager resource details from request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DataManagerInner> beginCreate( + String resourceGroupName, String dataManagerName, DataManagerInner dataManager, Context context) { + return beginCreateAsync(resourceGroupName, dataManagerName, dataManager, context).getSyncPoller(); + } + + /** + * Creates a new data manager resource with the specified parameters. Existing resources cannot be updated with this + * API and should instead be updated with the Update data manager resource API. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManager Data manager resource details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String dataManagerName, DataManagerInner dataManager) { + return beginCreateAsync(resourceGroupName, dataManagerName, dataManager) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new data manager resource with the specified parameters. Existing resources cannot be updated with this + * API and should instead be updated with the Update data manager resource API. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManager Data manager resource details from request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String dataManagerName, DataManagerInner dataManager, Context context) { + return beginCreateAsync(resourceGroupName, dataManagerName, dataManager, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new data manager resource with the specified parameters. Existing resources cannot be updated with this + * API and should instead be updated with the Update data manager resource API. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManager Data manager resource details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataManagerInner create(String resourceGroupName, String dataManagerName, DataManagerInner dataManager) { + return createAsync(resourceGroupName, dataManagerName, dataManager).block(); + } + + /** + * Creates a new data manager resource with the specified parameters. Existing resources cannot be updated with this + * API and should instead be updated with the Update data manager resource API. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManager Data manager resource details from request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataManagerInner create( + String resourceGroupName, String dataManagerName, DataManagerInner dataManager, Context context) { + return createAsync(resourceGroupName, dataManagerName, dataManager, context).block(); + } + + /** + * Deletes a data manager resource in Microsoft Azure. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String dataManagerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a data manager resource in Microsoft Azure. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String dataManagerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + context); + } + + /** + * Deletes a data manager resource in Microsoft Azure. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String dataManagerName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, dataManagerName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a data manager resource in Microsoft Azure. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String dataManagerName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, dataManagerName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a data manager resource in Microsoft Azure. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String dataManagerName) { + return beginDeleteAsync(resourceGroupName, dataManagerName).getSyncPoller(); + } + + /** + * Deletes a data manager resource in Microsoft Azure. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String dataManagerName, Context context) { + return beginDeleteAsync(resourceGroupName, dataManagerName, context).getSyncPoller(); + } + + /** + * Deletes a data manager resource in Microsoft Azure. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String dataManagerName) { + return beginDeleteAsync(resourceGroupName, dataManagerName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a data manager resource in Microsoft Azure. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String dataManagerName, Context context) { + return beginDeleteAsync(resourceGroupName, dataManagerName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a data manager resource in Microsoft Azure. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String dataManagerName) { + deleteAsync(resourceGroupName, dataManagerName).block(); + } + + /** + * Deletes a data manager resource in Microsoft Azure. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String dataManagerName, Context context) { + deleteAsync(resourceGroupName, dataManagerName, context).block(); + } + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the data manager + * resource on the server matches this value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String dataManagerName, + DataManagerUpdateParameter dataManagerUpdateParameter, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + if (dataManagerUpdateParameter == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter dataManagerUpdateParameter is required and cannot be null.")); + } else { + dataManagerUpdateParameter.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + ifMatch, + dataManagerUpdateParameter, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the data manager + * resource on the server matches this value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String dataManagerName, + DataManagerUpdateParameter dataManagerUpdateParameter, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + if (dataManagerUpdateParameter == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter dataManagerUpdateParameter is required and cannot be null.")); + } else { + dataManagerUpdateParameter.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + ifMatch, + dataManagerUpdateParameter, + accept, + context); + } + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the data manager + * resource on the server matches this value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DataManagerInner> beginUpdateAsync( + String resourceGroupName, + String dataManagerName, + DataManagerUpdateParameter dataManagerUpdateParameter, + String ifMatch) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, dataManagerName, dataManagerUpdateParameter, ifMatch); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DataManagerInner.class, DataManagerInner.class, Context.NONE); + } + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the data manager + * resource on the server matches this value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DataManagerInner> beginUpdateAsync( + String resourceGroupName, + String dataManagerName, + DataManagerUpdateParameter dataManagerUpdateParameter, + String ifMatch, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, dataManagerName, dataManagerUpdateParameter, ifMatch, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DataManagerInner.class, DataManagerInner.class, context); + } + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the data manager + * resource on the server matches this value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DataManagerInner> beginUpdate( + String resourceGroupName, + String dataManagerName, + DataManagerUpdateParameter dataManagerUpdateParameter, + String ifMatch) { + return beginUpdateAsync(resourceGroupName, dataManagerName, dataManagerUpdateParameter, ifMatch) + .getSyncPoller(); + } + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the data manager + * resource on the server matches this value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DataManagerInner> beginUpdate( + String resourceGroupName, + String dataManagerName, + DataManagerUpdateParameter dataManagerUpdateParameter, + String ifMatch, + Context context) { + return beginUpdateAsync(resourceGroupName, dataManagerName, dataManagerUpdateParameter, ifMatch, context) + .getSyncPoller(); + } + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the data manager + * resource on the server matches this value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String dataManagerName, + DataManagerUpdateParameter dataManagerUpdateParameter, + String ifMatch) { + return beginUpdateAsync(resourceGroupName, dataManagerName, dataManagerUpdateParameter, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String dataManagerName, DataManagerUpdateParameter dataManagerUpdateParameter) { + final String ifMatch = null; + return beginUpdateAsync(resourceGroupName, dataManagerName, dataManagerUpdateParameter, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the data manager + * resource on the server matches this value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String dataManagerName, + DataManagerUpdateParameter dataManagerUpdateParameter, + String ifMatch, + Context context) { + return beginUpdateAsync(resourceGroupName, dataManagerName, dataManagerUpdateParameter, ifMatch, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the data manager + * resource on the server matches this value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataManagerInner update( + String resourceGroupName, + String dataManagerName, + DataManagerUpdateParameter dataManagerUpdateParameter, + String ifMatch) { + return updateAsync(resourceGroupName, dataManagerName, dataManagerUpdateParameter, ifMatch).block(); + } + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataManagerInner update( + String resourceGroupName, String dataManagerName, DataManagerUpdateParameter dataManagerUpdateParameter) { + final String ifMatch = null; + return updateAsync(resourceGroupName, dataManagerName, dataManagerUpdateParameter, ifMatch).block(); + } + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the data manager + * resource on the server matches this value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DataManager resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataManagerInner update( + String resourceGroupName, + String dataManagerName, + DataManagerUpdateParameter dataManagerUpdateParameter, + String ifMatch, + Context context) { + return updateAsync(resourceGroupName, dataManagerName, dataManagerUpdateParameter, ifMatch, context).block(); + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataManagersImpl.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataManagersImpl.java new file mode 100644 index 000000000000..29fd2849af16 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataManagersImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybriddatamanager.fluent.DataManagersClient; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.DataManagerInner; +import com.azure.resourcemanager.hybriddatamanager.models.DataManager; +import com.azure.resourcemanager.hybriddatamanager.models.DataManagers; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DataManagersImpl implements DataManagers { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataManagersImpl.class); + + private final DataManagersClient innerClient; + + private final com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager; + + public DataManagersImpl( + DataManagersClient innerClient, com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new DataManagerImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new DataManagerImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new DataManagerImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new DataManagerImpl(inner1, this.manager())); + } + + public DataManager getByResourceGroup(String resourceGroupName, String dataManagerName) { + DataManagerInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, dataManagerName); + if (inner != null) { + return new DataManagerImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String dataManagerName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, dataManagerName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DataManagerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String dataManagerName) { + this.serviceClient().delete(resourceGroupName, dataManagerName); + } + + public void delete(String resourceGroupName, String dataManagerName, Context context) { + this.serviceClient().delete(resourceGroupName, dataManagerName, context); + } + + public DataManager getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dataManagerName = Utils.getValueFromIdByName(id, "dataManagers"); + if (dataManagerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataManagers'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, dataManagerName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dataManagerName = Utils.getValueFromIdByName(id, "dataManagers"); + if (dataManagerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataManagers'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, dataManagerName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dataManagerName = Utils.getValueFromIdByName(id, "dataManagers"); + if (dataManagerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataManagers'.", id))); + } + this.delete(resourceGroupName, dataManagerName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dataManagerName = Utils.getValueFromIdByName(id, "dataManagers"); + if (dataManagerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataManagers'.", id))); + } + this.delete(resourceGroupName, dataManagerName, context); + } + + private DataManagersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybriddatamanager.HybridDataManager manager() { + return this.serviceManager; + } + + public DataManagerImpl define(String name) { + return new DataManagerImpl(name, this.manager()); + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataServiceImpl.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataServiceImpl.java new file mode 100644 index 000000000000..10f06b5de4f3 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataServiceImpl.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.implementation; + +import com.azure.resourcemanager.hybriddatamanager.fluent.models.DataServiceInner; +import com.azure.resourcemanager.hybriddatamanager.models.DataService; +import com.azure.resourcemanager.hybriddatamanager.models.State; +import java.util.Collections; +import java.util.List; + +public final class DataServiceImpl implements DataService { + private DataServiceInner innerObject; + + private final com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager; + + DataServiceImpl( + DataServiceInner innerObject, com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String id() { + return this.innerModel().id(); + } + + public String type() { + return this.innerModel().type(); + } + + public State state() { + return this.innerModel().state(); + } + + public List supportedDataSinkTypes() { + List inner = this.innerModel().supportedDataSinkTypes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List supportedDataSourceTypes() { + List inner = this.innerModel().supportedDataSourceTypes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DataServiceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybriddatamanager.HybridDataManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataServicesClientImpl.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataServicesClientImpl.java new file mode 100644 index 000000000000..8c637075e770 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataServicesClientImpl.java @@ -0,0 +1,534 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybriddatamanager.fluent.DataServicesClient; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.DataServiceInner; +import com.azure.resourcemanager.hybriddatamanager.models.DataServiceList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DataServicesClient. */ +public final class DataServicesClientImpl implements DataServicesClient { + private final ClientLogger logger = new ClientLogger(DataServicesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DataServicesService service; + + /** The service client containing this operation class. */ + private final HybridDataManagementClientImpl client; + + /** + * Initializes an instance of DataServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DataServicesClientImpl(HybridDataManagementClientImpl client) { + this.service = + RestProxy.create(DataServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridDataManagementClientDataServices to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridDataManagement") + private interface DataServicesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData" + + "/dataManagers/{dataManagerName}/dataServices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataManager( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataManagerName") String dataManagerName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData" + + "/dataManagers/{dataManagerName}/dataServices/{dataServiceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("dataServiceName") String dataServiceName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataManagerName") String dataManagerName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataManagerNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * This method gets all the data services. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Service Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataManagerSinglePageAsync( + String resourceGroupName, String dataManagerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByDataManager( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This method gets all the data services. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Service Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataManagerSinglePageAsync( + String resourceGroupName, String dataManagerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByDataManager( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * This method gets all the data services. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Service Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataManagerAsync(String resourceGroupName, String dataManagerName) { + return new PagedFlux<>( + () -> listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName), + nextLink -> listByDataManagerNextSinglePageAsync(nextLink)); + } + + /** + * This method gets all the data services. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Service Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataManagerAsync( + String resourceGroupName, String dataManagerName, Context context) { + return new PagedFlux<>( + () -> listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName, context), + nextLink -> listByDataManagerNextSinglePageAsync(nextLink, context)); + } + + /** + * This method gets all the data services. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Service Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataManager(String resourceGroupName, String dataManagerName) { + return new PagedIterable<>(listByDataManagerAsync(resourceGroupName, dataManagerName)); + } + + /** + * This method gets all the data services. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Service Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataManager( + String resourceGroupName, String dataManagerName, Context context) { + return new PagedIterable<>(listByDataManagerAsync(resourceGroupName, dataManagerName, context)); + } + + /** + * Gets the data service that matches the data service name given. + * + * @param dataServiceName The name of the data service that is being queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data service that matches the data service name given. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String dataServiceName, String resourceGroupName, String dataManagerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (dataServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + dataServiceName, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the data service that matches the data service name given. + * + * @param dataServiceName The name of the data service that is being queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data service that matches the data service name given. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String dataServiceName, String resourceGroupName, String dataManagerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (dataServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + dataServiceName, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the data service that matches the data service name given. + * + * @param dataServiceName The name of the data service that is being queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data service that matches the data service name given. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String dataServiceName, String resourceGroupName, String dataManagerName) { + return getWithResponseAsync(dataServiceName, resourceGroupName, dataManagerName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the data service that matches the data service name given. + * + * @param dataServiceName The name of the data service that is being queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data service that matches the data service name given. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataServiceInner get(String dataServiceName, String resourceGroupName, String dataManagerName) { + return getAsync(dataServiceName, resourceGroupName, dataManagerName).block(); + } + + /** + * Gets the data service that matches the data service name given. + * + * @param dataServiceName The name of the data service that is being queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data service that matches the data service name given. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String dataServiceName, String resourceGroupName, String dataManagerName, Context context) { + return getWithResponseAsync(dataServiceName, resourceGroupName, dataManagerName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Service Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataManagerNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByDataManagerNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Service Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataManagerNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByDataManagerNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataServicesImpl.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataServicesImpl.java new file mode 100644 index 000000000000..26b9767c59a4 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataServicesImpl.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybriddatamanager.fluent.DataServicesClient; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.DataServiceInner; +import com.azure.resourcemanager.hybriddatamanager.models.DataService; +import com.azure.resourcemanager.hybriddatamanager.models.DataServices; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DataServicesImpl implements DataServices { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataServicesImpl.class); + + private final DataServicesClient innerClient; + + private final com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager; + + public DataServicesImpl( + DataServicesClient innerClient, com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByDataManager(String resourceGroupName, String dataManagerName) { + PagedIterable inner = + this.serviceClient().listByDataManager(resourceGroupName, dataManagerName); + return Utils.mapPage(inner, inner1 -> new DataServiceImpl(inner1, this.manager())); + } + + public PagedIterable listByDataManager( + String resourceGroupName, String dataManagerName, Context context) { + PagedIterable inner = + this.serviceClient().listByDataManager(resourceGroupName, dataManagerName, context); + return Utils.mapPage(inner, inner1 -> new DataServiceImpl(inner1, this.manager())); + } + + public DataService get(String dataServiceName, String resourceGroupName, String dataManagerName) { + DataServiceInner inner = this.serviceClient().get(dataServiceName, resourceGroupName, dataManagerName); + if (inner != null) { + return new DataServiceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String dataServiceName, String resourceGroupName, String dataManagerName, Context context) { + Response inner = + this.serviceClient().getWithResponse(dataServiceName, resourceGroupName, dataManagerName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DataServiceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private DataServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybriddatamanager.HybridDataManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataStoreImpl.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataStoreImpl.java new file mode 100644 index 000000000000..84666b30eb47 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataStoreImpl.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.DataStoreInner; +import com.azure.resourcemanager.hybriddatamanager.models.CustomerSecret; +import com.azure.resourcemanager.hybriddatamanager.models.DataStore; +import com.azure.resourcemanager.hybriddatamanager.models.State; +import java.util.Collections; +import java.util.List; + +public final class DataStoreImpl implements DataStore, DataStore.Definition, DataStore.Update { + private DataStoreInner innerObject; + + private final com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String id() { + return this.innerModel().id(); + } + + public String type() { + return this.innerModel().type(); + } + + public String repositoryId() { + return this.innerModel().repositoryId(); + } + + public State state() { + return this.innerModel().state(); + } + + public Object extendedProperties() { + return this.innerModel().extendedProperties(); + } + + public String dataStoreTypeId() { + return this.innerModel().dataStoreTypeId(); + } + + public List customerSecrets() { + List inner = this.innerModel().customerSecrets(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DataStoreInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybriddatamanager.HybridDataManager manager() { + return this.serviceManager; + } + + private String dataStoreName; + + private String resourceGroupName; + + private String dataManagerName; + + public DataStoreImpl withExistingDataManager(String resourceGroupName, String dataManagerName) { + this.resourceGroupName = resourceGroupName; + this.dataManagerName = dataManagerName; + return this; + } + + public DataStore create() { + this.innerObject = + serviceManager + .serviceClient() + .getDataStores() + .createOrUpdate(dataStoreName, resourceGroupName, dataManagerName, this.innerModel(), Context.NONE); + return this; + } + + public DataStore create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDataStores() + .createOrUpdate(dataStoreName, resourceGroupName, dataManagerName, this.innerModel(), context); + return this; + } + + DataStoreImpl(String name, com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager) { + this.innerObject = new DataStoreInner(); + this.serviceManager = serviceManager; + this.dataStoreName = name; + } + + public DataStoreImpl update() { + return this; + } + + public DataStore apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDataStores() + .createOrUpdate(dataStoreName, resourceGroupName, dataManagerName, this.innerModel(), Context.NONE); + return this; + } + + public DataStore apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDataStores() + .createOrUpdate(dataStoreName, resourceGroupName, dataManagerName, this.innerModel(), context); + return this; + } + + DataStoreImpl( + DataStoreInner innerObject, com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.dataStoreName = Utils.getValueFromIdByName(innerObject.id(), "dataStores"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.dataManagerName = Utils.getValueFromIdByName(innerObject.id(), "dataManagers"); + } + + public DataStore refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDataStores() + .getWithResponse(dataStoreName, resourceGroupName, dataManagerName, Context.NONE) + .getValue(); + return this; + } + + public DataStore refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDataStores() + .getWithResponse(dataStoreName, resourceGroupName, dataManagerName, context) + .getValue(); + return this; + } + + public DataStoreImpl withState(State state) { + this.innerModel().withState(state); + return this; + } + + public DataStoreImpl withDataStoreTypeId(String dataStoreTypeId) { + this.innerModel().withDataStoreTypeId(dataStoreTypeId); + return this; + } + + public DataStoreImpl withRepositoryId(String repositoryId) { + this.innerModel().withRepositoryId(repositoryId); + return this; + } + + public DataStoreImpl withExtendedProperties(Object extendedProperties) { + this.innerModel().withExtendedProperties(extendedProperties); + return this; + } + + public DataStoreImpl withCustomerSecrets(List customerSecrets) { + this.innerModel().withCustomerSecrets(customerSecrets); + return this; + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataStoreTypeImpl.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataStoreTypeImpl.java new file mode 100644 index 000000000000..b56e8c55e4e5 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataStoreTypeImpl.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.implementation; + +import com.azure.resourcemanager.hybriddatamanager.fluent.models.DataStoreTypeInner; +import com.azure.resourcemanager.hybriddatamanager.models.DataStoreType; +import com.azure.resourcemanager.hybriddatamanager.models.State; +import java.util.Collections; +import java.util.List; + +public final class DataStoreTypeImpl implements DataStoreType { + private DataStoreTypeInner innerObject; + + private final com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager; + + DataStoreTypeImpl( + DataStoreTypeInner innerObject, com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String id() { + return this.innerModel().id(); + } + + public String type() { + return this.innerModel().type(); + } + + public String repositoryType() { + return this.innerModel().repositoryType(); + } + + public State state() { + return this.innerModel().state(); + } + + public List supportedDataServicesAsSink() { + List inner = this.innerModel().supportedDataServicesAsSink(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List supportedDataServicesAsSource() { + List inner = this.innerModel().supportedDataServicesAsSource(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DataStoreTypeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybriddatamanager.HybridDataManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataStoreTypesClientImpl.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataStoreTypesClientImpl.java new file mode 100644 index 000000000000..2ebbe255d40d --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataStoreTypesClientImpl.java @@ -0,0 +1,535 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybriddatamanager.fluent.DataStoreTypesClient; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.DataStoreTypeInner; +import com.azure.resourcemanager.hybriddatamanager.models.DataStoreTypeList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DataStoreTypesClient. */ +public final class DataStoreTypesClientImpl implements DataStoreTypesClient { + private final ClientLogger logger = new ClientLogger(DataStoreTypesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DataStoreTypesService service; + + /** The service client containing this operation class. */ + private final HybridDataManagementClientImpl client; + + /** + * Initializes an instance of DataStoreTypesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DataStoreTypesClientImpl(HybridDataManagementClientImpl client) { + this.service = + RestProxy.create(DataStoreTypesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridDataManagementClientDataStoreTypes to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridDataManagement") + private interface DataStoreTypesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData" + + "/dataManagers/{dataManagerName}/dataStoreTypes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataManager( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataManagerName") String dataManagerName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData" + + "/dataManagers/{dataManagerName}/dataStoreTypes/{dataStoreTypeName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("dataStoreTypeName") String dataStoreTypeName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataManagerName") String dataManagerName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataManagerNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the data store/repository types that the resource supports. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data store/repository types that the resource supports. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataManagerSinglePageAsync( + String resourceGroupName, String dataManagerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByDataManager( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the data store/repository types that the resource supports. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data store/repository types that the resource supports. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataManagerSinglePageAsync( + String resourceGroupName, String dataManagerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByDataManager( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the data store/repository types that the resource supports. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data store/repository types that the resource supports. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataManagerAsync(String resourceGroupName, String dataManagerName) { + return new PagedFlux<>( + () -> listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName), + nextLink -> listByDataManagerNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the data store/repository types that the resource supports. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data store/repository types that the resource supports. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataManagerAsync( + String resourceGroupName, String dataManagerName, Context context) { + return new PagedFlux<>( + () -> listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName, context), + nextLink -> listByDataManagerNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the data store/repository types that the resource supports. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data store/repository types that the resource supports. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataManager(String resourceGroupName, String dataManagerName) { + return new PagedIterable<>(listByDataManagerAsync(resourceGroupName, dataManagerName)); + } + + /** + * Gets all the data store/repository types that the resource supports. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data store/repository types that the resource supports. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataManager( + String resourceGroupName, String dataManagerName, Context context) { + return new PagedIterable<>(listByDataManagerAsync(resourceGroupName, dataManagerName, context)); + } + + /** + * Gets the data store/repository type given its name. + * + * @param dataStoreTypeName The data store/repository type name for which details are needed. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data store/repository type given its name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String dataStoreTypeName, String resourceGroupName, String dataManagerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (dataStoreTypeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataStoreTypeName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + dataStoreTypeName, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the data store/repository type given its name. + * + * @param dataStoreTypeName The data store/repository type name for which details are needed. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data store/repository type given its name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String dataStoreTypeName, String resourceGroupName, String dataManagerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (dataStoreTypeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataStoreTypeName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + dataStoreTypeName, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the data store/repository type given its name. + * + * @param dataStoreTypeName The data store/repository type name for which details are needed. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data store/repository type given its name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String dataStoreTypeName, String resourceGroupName, String dataManagerName) { + return getWithResponseAsync(dataStoreTypeName, resourceGroupName, dataManagerName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the data store/repository type given its name. + * + * @param dataStoreTypeName The data store/repository type name for which details are needed. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data store/repository type given its name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataStoreTypeInner get(String dataStoreTypeName, String resourceGroupName, String dataManagerName) { + return getAsync(dataStoreTypeName, resourceGroupName, dataManagerName).block(); + } + + /** + * Gets the data store/repository type given its name. + * + * @param dataStoreTypeName The data store/repository type name for which details are needed. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data store/repository type given its name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String dataStoreTypeName, String resourceGroupName, String dataManagerName, Context context) { + return getWithResponseAsync(dataStoreTypeName, resourceGroupName, dataManagerName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Store Type Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataManagerNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByDataManagerNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Store Type Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataManagerNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByDataManagerNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataStoreTypesImpl.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataStoreTypesImpl.java new file mode 100644 index 000000000000..8237b1b2c1e8 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataStoreTypesImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybriddatamanager.fluent.DataStoreTypesClient; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.DataStoreTypeInner; +import com.azure.resourcemanager.hybriddatamanager.models.DataStoreType; +import com.azure.resourcemanager.hybriddatamanager.models.DataStoreTypes; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DataStoreTypesImpl implements DataStoreTypes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataStoreTypesImpl.class); + + private final DataStoreTypesClient innerClient; + + private final com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager; + + public DataStoreTypesImpl( + DataStoreTypesClient innerClient, + com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByDataManager(String resourceGroupName, String dataManagerName) { + PagedIterable inner = + this.serviceClient().listByDataManager(resourceGroupName, dataManagerName); + return Utils.mapPage(inner, inner1 -> new DataStoreTypeImpl(inner1, this.manager())); + } + + public PagedIterable listByDataManager( + String resourceGroupName, String dataManagerName, Context context) { + PagedIterable inner = + this.serviceClient().listByDataManager(resourceGroupName, dataManagerName, context); + return Utils.mapPage(inner, inner1 -> new DataStoreTypeImpl(inner1, this.manager())); + } + + public DataStoreType get(String dataStoreTypeName, String resourceGroupName, String dataManagerName) { + DataStoreTypeInner inner = this.serviceClient().get(dataStoreTypeName, resourceGroupName, dataManagerName); + if (inner != null) { + return new DataStoreTypeImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String dataStoreTypeName, String resourceGroupName, String dataManagerName, Context context) { + Response inner = + this.serviceClient().getWithResponse(dataStoreTypeName, resourceGroupName, dataManagerName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DataStoreTypeImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private DataStoreTypesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybriddatamanager.HybridDataManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataStoresClientImpl.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataStoresClientImpl.java new file mode 100644 index 000000000000..5aca8797f2ff --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataStoresClientImpl.java @@ -0,0 +1,1174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybriddatamanager.fluent.DataStoresClient; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.DataStoreInner; +import com.azure.resourcemanager.hybriddatamanager.models.DataStoreList; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DataStoresClient. */ +public final class DataStoresClientImpl implements DataStoresClient { + private final ClientLogger logger = new ClientLogger(DataStoresClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DataStoresService service; + + /** The service client containing this operation class. */ + private final HybridDataManagementClientImpl client; + + /** + * Initializes an instance of DataStoresClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DataStoresClientImpl(HybridDataManagementClientImpl client) { + this.service = + RestProxy.create(DataStoresService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridDataManagementClientDataStores to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridDataManagement") + private interface DataStoresService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData" + + "/dataManagers/{dataManagerName}/dataStores") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataManager( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataManagerName") String dataManagerName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData" + + "/dataManagers/{dataManagerName}/dataStores/{dataStoreName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("dataStoreName") String dataStoreName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataManagerName") String dataManagerName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData" + + "/dataManagers/{dataManagerName}/dataStores/{dataStoreName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("dataStoreName") String dataStoreName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataManagerName") String dataManagerName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DataStoreInner dataStore, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData" + + "/dataManagers/{dataManagerName}/dataStores/{dataStoreName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("dataStoreName") String dataStoreName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataManagerName") String dataManagerName, + @QueryParam("api-version") String apiVersion, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataManagerNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the data stores/repositories in the given resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data stores/repositories in the given resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataManagerSinglePageAsync( + String resourceGroupName, String dataManagerName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByDataManager( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the data stores/repositories in the given resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data stores/repositories in the given resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataManagerSinglePageAsync( + String resourceGroupName, String dataManagerName, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByDataManager( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the data stores/repositories in the given resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data stores/repositories in the given resource. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataManagerAsync( + String resourceGroupName, String dataManagerName, String filter) { + return new PagedFlux<>( + () -> listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName, filter), + nextLink -> listByDataManagerNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the data stores/repositories in the given resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data stores/repositories in the given resource. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataManagerAsync(String resourceGroupName, String dataManagerName) { + final String filter = null; + return new PagedFlux<>( + () -> listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName, filter), + nextLink -> listByDataManagerNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the data stores/repositories in the given resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data stores/repositories in the given resource. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataManagerAsync( + String resourceGroupName, String dataManagerName, String filter, Context context) { + return new PagedFlux<>( + () -> listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName, filter, context), + nextLink -> listByDataManagerNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the data stores/repositories in the given resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data stores/repositories in the given resource. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataManager(String resourceGroupName, String dataManagerName) { + final String filter = null; + return new PagedIterable<>(listByDataManagerAsync(resourceGroupName, dataManagerName, filter)); + } + + /** + * Gets all the data stores/repositories in the given resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data stores/repositories in the given resource. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataManager( + String resourceGroupName, String dataManagerName, String filter, Context context) { + return new PagedIterable<>(listByDataManagerAsync(resourceGroupName, dataManagerName, filter, context)); + } + + /** + * This method gets the data store/repository by name. + * + * @param dataStoreName The data store/repository name queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data store. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String dataStoreName, String resourceGroupName, String dataManagerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (dataStoreName == null) { + return Mono.error(new IllegalArgumentException("Parameter dataStoreName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + dataStoreName, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This method gets the data store/repository by name. + * + * @param dataStoreName The data store/repository name queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data store. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String dataStoreName, String resourceGroupName, String dataManagerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (dataStoreName == null) { + return Mono.error(new IllegalArgumentException("Parameter dataStoreName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + dataStoreName, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * This method gets the data store/repository by name. + * + * @param dataStoreName The data store/repository name queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data store. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String dataStoreName, String resourceGroupName, String dataManagerName) { + return getWithResponseAsync(dataStoreName, resourceGroupName, dataManagerName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * This method gets the data store/repository by name. + * + * @param dataStoreName The data store/repository name queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data store. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataStoreInner get(String dataStoreName, String resourceGroupName, String dataManagerName) { + return getAsync(dataStoreName, resourceGroupName, dataManagerName).block(); + } + + /** + * This method gets the data store/repository by name. + * + * @param dataStoreName The data store/repository name queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data store. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String dataStoreName, String resourceGroupName, String dataManagerName, Context context) { + return getWithResponseAsync(dataStoreName, resourceGroupName, dataManagerName, context).block(); + } + + /** + * Creates or updates the data store/repository in the data manager. + * + * @param dataStoreName The data store/repository name to be created or updated. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataStore The data store/repository object to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data store. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String dataStoreName, String resourceGroupName, String dataManagerName, DataStoreInner dataStore) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (dataStoreName == null) { + return Mono.error(new IllegalArgumentException("Parameter dataStoreName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + if (dataStore == null) { + return Mono.error(new IllegalArgumentException("Parameter dataStore is required and cannot be null.")); + } else { + dataStore.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + dataStoreName, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + dataStore, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the data store/repository in the data manager. + * + * @param dataStoreName The data store/repository name to be created or updated. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataStore The data store/repository object to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data store. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String dataStoreName, + String resourceGroupName, + String dataManagerName, + DataStoreInner dataStore, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (dataStoreName == null) { + return Mono.error(new IllegalArgumentException("Parameter dataStoreName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + if (dataStore == null) { + return Mono.error(new IllegalArgumentException("Parameter dataStore is required and cannot be null.")); + } else { + dataStore.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + dataStoreName, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + dataStore, + accept, + context); + } + + /** + * Creates or updates the data store/repository in the data manager. + * + * @param dataStoreName The data store/repository name to be created or updated. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataStore The data store/repository object to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data store. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DataStoreInner> beginCreateOrUpdateAsync( + String dataStoreName, String resourceGroupName, String dataManagerName, DataStoreInner dataStore) { + Mono>> mono = + createOrUpdateWithResponseAsync(dataStoreName, resourceGroupName, dataManagerName, dataStore); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DataStoreInner.class, DataStoreInner.class, Context.NONE); + } + + /** + * Creates or updates the data store/repository in the data manager. + * + * @param dataStoreName The data store/repository name to be created or updated. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataStore The data store/repository object to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data store. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DataStoreInner> beginCreateOrUpdateAsync( + String dataStoreName, + String resourceGroupName, + String dataManagerName, + DataStoreInner dataStore, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(dataStoreName, resourceGroupName, dataManagerName, dataStore, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DataStoreInner.class, DataStoreInner.class, context); + } + + /** + * Creates or updates the data store/repository in the data manager. + * + * @param dataStoreName The data store/repository name to be created or updated. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataStore The data store/repository object to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data store. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DataStoreInner> beginCreateOrUpdate( + String dataStoreName, String resourceGroupName, String dataManagerName, DataStoreInner dataStore) { + return beginCreateOrUpdateAsync(dataStoreName, resourceGroupName, dataManagerName, dataStore).getSyncPoller(); + } + + /** + * Creates or updates the data store/repository in the data manager. + * + * @param dataStoreName The data store/repository name to be created or updated. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataStore The data store/repository object to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data store. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DataStoreInner> beginCreateOrUpdate( + String dataStoreName, + String resourceGroupName, + String dataManagerName, + DataStoreInner dataStore, + Context context) { + return beginCreateOrUpdateAsync(dataStoreName, resourceGroupName, dataManagerName, dataStore, context) + .getSyncPoller(); + } + + /** + * Creates or updates the data store/repository in the data manager. + * + * @param dataStoreName The data store/repository name to be created or updated. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataStore The data store/repository object to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data store. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String dataStoreName, String resourceGroupName, String dataManagerName, DataStoreInner dataStore) { + return beginCreateOrUpdateAsync(dataStoreName, resourceGroupName, dataManagerName, dataStore) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the data store/repository in the data manager. + * + * @param dataStoreName The data store/repository name to be created or updated. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataStore The data store/repository object to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data store. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String dataStoreName, + String resourceGroupName, + String dataManagerName, + DataStoreInner dataStore, + Context context) { + return beginCreateOrUpdateAsync(dataStoreName, resourceGroupName, dataManagerName, dataStore, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the data store/repository in the data manager. + * + * @param dataStoreName The data store/repository name to be created or updated. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataStore The data store/repository object to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data store. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataStoreInner createOrUpdate( + String dataStoreName, String resourceGroupName, String dataManagerName, DataStoreInner dataStore) { + return createOrUpdateAsync(dataStoreName, resourceGroupName, dataManagerName, dataStore).block(); + } + + /** + * Creates or updates the data store/repository in the data manager. + * + * @param dataStoreName The data store/repository name to be created or updated. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param dataStore The data store/repository object to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data store. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataStoreInner createOrUpdate( + String dataStoreName, + String resourceGroupName, + String dataManagerName, + DataStoreInner dataStore, + Context context) { + return createOrUpdateAsync(dataStoreName, resourceGroupName, dataManagerName, dataStore, context).block(); + } + + /** + * This method deletes the given data store/repository. + * + * @param dataStoreName The data store/repository name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String dataStoreName, String resourceGroupName, String dataManagerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (dataStoreName == null) { + return Mono.error(new IllegalArgumentException("Parameter dataStoreName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + dataStoreName, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This method deletes the given data store/repository. + * + * @param dataStoreName The data store/repository name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String dataStoreName, String resourceGroupName, String dataManagerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (dataStoreName == null) { + return Mono.error(new IllegalArgumentException("Parameter dataStoreName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + dataStoreName, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + context); + } + + /** + * This method deletes the given data store/repository. + * + * @param dataStoreName The data store/repository name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String dataStoreName, String resourceGroupName, String dataManagerName) { + Mono>> mono = + deleteWithResponseAsync(dataStoreName, resourceGroupName, dataManagerName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * This method deletes the given data store/repository. + * + * @param dataStoreName The data store/repository name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String dataStoreName, String resourceGroupName, String dataManagerName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(dataStoreName, resourceGroupName, dataManagerName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * This method deletes the given data store/repository. + * + * @param dataStoreName The data store/repository name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String dataStoreName, String resourceGroupName, String dataManagerName) { + return beginDeleteAsync(dataStoreName, resourceGroupName, dataManagerName).getSyncPoller(); + } + + /** + * This method deletes the given data store/repository. + * + * @param dataStoreName The data store/repository name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String dataStoreName, String resourceGroupName, String dataManagerName, Context context) { + return beginDeleteAsync(dataStoreName, resourceGroupName, dataManagerName, context).getSyncPoller(); + } + + /** + * This method deletes the given data store/repository. + * + * @param dataStoreName The data store/repository name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String dataStoreName, String resourceGroupName, String dataManagerName) { + return beginDeleteAsync(dataStoreName, resourceGroupName, dataManagerName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This method deletes the given data store/repository. + * + * @param dataStoreName The data store/repository name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String dataStoreName, String resourceGroupName, String dataManagerName, Context context) { + return beginDeleteAsync(dataStoreName, resourceGroupName, dataManagerName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This method deletes the given data store/repository. + * + * @param dataStoreName The data store/repository name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String dataStoreName, String resourceGroupName, String dataManagerName) { + deleteAsync(dataStoreName, resourceGroupName, dataManagerName).block(); + } + + /** + * This method deletes the given data store/repository. + * + * @param dataStoreName The data store/repository name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String dataStoreName, String resourceGroupName, String dataManagerName, Context context) { + deleteAsync(dataStoreName, resourceGroupName, dataManagerName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Store Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataManagerNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByDataManagerNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Store Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataManagerNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByDataManagerNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataStoresImpl.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataStoresImpl.java new file mode 100644 index 000000000000..18189b9a1d5f --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/DataStoresImpl.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybriddatamanager.fluent.DataStoresClient; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.DataStoreInner; +import com.azure.resourcemanager.hybriddatamanager.models.DataStore; +import com.azure.resourcemanager.hybriddatamanager.models.DataStores; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DataStoresImpl implements DataStores { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataStoresImpl.class); + + private final DataStoresClient innerClient; + + private final com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager; + + public DataStoresImpl( + DataStoresClient innerClient, com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByDataManager(String resourceGroupName, String dataManagerName) { + PagedIterable inner = + this.serviceClient().listByDataManager(resourceGroupName, dataManagerName); + return Utils.mapPage(inner, inner1 -> new DataStoreImpl(inner1, this.manager())); + } + + public PagedIterable listByDataManager( + String resourceGroupName, String dataManagerName, String filter, Context context) { + PagedIterable inner = + this.serviceClient().listByDataManager(resourceGroupName, dataManagerName, filter, context); + return Utils.mapPage(inner, inner1 -> new DataStoreImpl(inner1, this.manager())); + } + + public DataStore get(String dataStoreName, String resourceGroupName, String dataManagerName) { + DataStoreInner inner = this.serviceClient().get(dataStoreName, resourceGroupName, dataManagerName); + if (inner != null) { + return new DataStoreImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String dataStoreName, String resourceGroupName, String dataManagerName, Context context) { + Response inner = + this.serviceClient().getWithResponse(dataStoreName, resourceGroupName, dataManagerName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DataStoreImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String dataStoreName, String resourceGroupName, String dataManagerName) { + this.serviceClient().delete(dataStoreName, resourceGroupName, dataManagerName); + } + + public void delete(String dataStoreName, String resourceGroupName, String dataManagerName, Context context) { + this.serviceClient().delete(dataStoreName, resourceGroupName, dataManagerName, context); + } + + public DataStore getById(String id) { + String dataStoreName = Utils.getValueFromIdByName(id, "dataStores"); + if (dataStoreName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataStores'.", id))); + } + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dataManagerName = Utils.getValueFromIdByName(id, "dataManagers"); + if (dataManagerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataManagers'.", id))); + } + return this.getWithResponse(dataStoreName, resourceGroupName, dataManagerName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String dataStoreName = Utils.getValueFromIdByName(id, "dataStores"); + if (dataStoreName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataStores'.", id))); + } + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dataManagerName = Utils.getValueFromIdByName(id, "dataManagers"); + if (dataManagerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataManagers'.", id))); + } + return this.getWithResponse(dataStoreName, resourceGroupName, dataManagerName, context); + } + + public void deleteById(String id) { + String dataStoreName = Utils.getValueFromIdByName(id, "dataStores"); + if (dataStoreName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataStores'.", id))); + } + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dataManagerName = Utils.getValueFromIdByName(id, "dataManagers"); + if (dataManagerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataManagers'.", id))); + } + this.delete(dataStoreName, resourceGroupName, dataManagerName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String dataStoreName = Utils.getValueFromIdByName(id, "dataStores"); + if (dataStoreName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataStores'.", id))); + } + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dataManagerName = Utils.getValueFromIdByName(id, "dataManagers"); + if (dataManagerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataManagers'.", id))); + } + this.delete(dataStoreName, resourceGroupName, dataManagerName, context); + } + + private DataStoresClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybriddatamanager.HybridDataManager manager() { + return this.serviceManager; + } + + public DataStoreImpl define(String name) { + return new DataStoreImpl(name, this.manager()); + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/HybridDataManagementClientBuilder.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/HybridDataManagementClientBuilder.java new file mode 100644 index 000000000000..afc45e2bf1ac --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/HybridDataManagementClientBuilder.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the HybridDataManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {HybridDataManagementClientImpl.class}) +public final class HybridDataManagementClientBuilder { + /* + * The Subscription Id + */ + private String subscriptionId; + + /** + * Sets The Subscription Id. + * + * @param subscriptionId the subscriptionId value. + * @return the HybridDataManagementClientBuilder. + */ + public HybridDataManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the HybridDataManagementClientBuilder. + */ + public HybridDataManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the HybridDataManagementClientBuilder. + */ + public HybridDataManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the HybridDataManagementClientBuilder. + */ + public HybridDataManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the HybridDataManagementClientBuilder. + */ + public HybridDataManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the HybridDataManagementClientBuilder. + */ + public HybridDataManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of HybridDataManagementClientImpl with the provided parameters. + * + * @return an instance of HybridDataManagementClientImpl. + */ + public HybridDataManagementClientImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + HybridDataManagementClientImpl client = + new HybridDataManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/HybridDataManagementClientImpl.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/HybridDataManagementClientImpl.java new file mode 100644 index 000000000000..c8a3d6e15116 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/HybridDataManagementClientImpl.java @@ -0,0 +1,391 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.hybriddatamanager.fluent.DataManagersClient; +import com.azure.resourcemanager.hybriddatamanager.fluent.DataServicesClient; +import com.azure.resourcemanager.hybriddatamanager.fluent.DataStoreTypesClient; +import com.azure.resourcemanager.hybriddatamanager.fluent.DataStoresClient; +import com.azure.resourcemanager.hybriddatamanager.fluent.HybridDataManagementClient; +import com.azure.resourcemanager.hybriddatamanager.fluent.JobDefinitionsClient; +import com.azure.resourcemanager.hybriddatamanager.fluent.JobsClient; +import com.azure.resourcemanager.hybriddatamanager.fluent.OperationsClient; +import com.azure.resourcemanager.hybriddatamanager.fluent.PublicKeysClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the HybridDataManagementClientImpl type. */ +@ServiceClient(builder = HybridDataManagementClientBuilder.class) +public final class HybridDataManagementClientImpl implements HybridDataManagementClient { + private final ClientLogger logger = new ClientLogger(HybridDataManagementClientImpl.class); + + /** The Subscription Id. */ + private final String subscriptionId; + + /** + * Gets The Subscription Id. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The DataManagersClient object to access its operations. */ + private final DataManagersClient dataManagers; + + /** + * Gets the DataManagersClient object to access its operations. + * + * @return the DataManagersClient object. + */ + public DataManagersClient getDataManagers() { + return this.dataManagers; + } + + /** The DataServicesClient object to access its operations. */ + private final DataServicesClient dataServices; + + /** + * Gets the DataServicesClient object to access its operations. + * + * @return the DataServicesClient object. + */ + public DataServicesClient getDataServices() { + return this.dataServices; + } + + /** The JobDefinitionsClient object to access its operations. */ + private final JobDefinitionsClient jobDefinitions; + + /** + * Gets the JobDefinitionsClient object to access its operations. + * + * @return the JobDefinitionsClient object. + */ + public JobDefinitionsClient getJobDefinitions() { + return this.jobDefinitions; + } + + /** The JobsClient object to access its operations. */ + private final JobsClient jobs; + + /** + * Gets the JobsClient object to access its operations. + * + * @return the JobsClient object. + */ + public JobsClient getJobs() { + return this.jobs; + } + + /** The DataStoresClient object to access its operations. */ + private final DataStoresClient dataStores; + + /** + * Gets the DataStoresClient object to access its operations. + * + * @return the DataStoresClient object. + */ + public DataStoresClient getDataStores() { + return this.dataStores; + } + + /** The DataStoreTypesClient object to access its operations. */ + private final DataStoreTypesClient dataStoreTypes; + + /** + * Gets the DataStoreTypesClient object to access its operations. + * + * @return the DataStoreTypesClient object. + */ + public DataStoreTypesClient getDataStoreTypes() { + return this.dataStoreTypes; + } + + /** The PublicKeysClient object to access its operations. */ + private final PublicKeysClient publicKeys; + + /** + * Gets the PublicKeysClient object to access its operations. + * + * @return the PublicKeysClient object. + */ + public PublicKeysClient getPublicKeys() { + return this.publicKeys; + } + + /** + * Initializes an instance of HybridDataManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The Subscription Id. + * @param endpoint server parameter. + */ + HybridDataManagementClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2019-06-01"; + this.operations = new OperationsClientImpl(this); + this.dataManagers = new DataManagersClientImpl(this); + this.dataServices = new DataServicesClientImpl(this); + this.jobDefinitions = new JobDefinitionsClientImpl(this); + this.jobs = new JobsClientImpl(this); + this.dataStores = new DataStoresClientImpl(this); + this.dataStoreTypes = new DataStoreTypesClientImpl(this); + this.publicKeys = new PublicKeysClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + logger.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/JobDefinitionImpl.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/JobDefinitionImpl.java new file mode 100644 index 000000000000..2a6510d12902 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/JobDefinitionImpl.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.JobDefinitionInner; +import com.azure.resourcemanager.hybriddatamanager.models.CustomerSecret; +import com.azure.resourcemanager.hybriddatamanager.models.JobDefinition; +import com.azure.resourcemanager.hybriddatamanager.models.RunLocation; +import com.azure.resourcemanager.hybriddatamanager.models.RunParameters; +import com.azure.resourcemanager.hybriddatamanager.models.Schedule; +import com.azure.resourcemanager.hybriddatamanager.models.State; +import com.azure.resourcemanager.hybriddatamanager.models.UserConfirmation; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class JobDefinitionImpl implements JobDefinition, JobDefinition.Definition, JobDefinition.Update { + private JobDefinitionInner innerObject; + + private final com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String id() { + return this.innerModel().id(); + } + + public String type() { + return this.innerModel().type(); + } + + public String dataSourceId() { + return this.innerModel().dataSourceId(); + } + + public String dataSinkId() { + return this.innerModel().dataSinkId(); + } + + public List schedules() { + List inner = this.innerModel().schedules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public State state() { + return this.innerModel().state(); + } + + public OffsetDateTime lastModifiedTime() { + return this.innerModel().lastModifiedTime(); + } + + public RunLocation runLocation() { + return this.innerModel().runLocation(); + } + + public UserConfirmation userConfirmation() { + return this.innerModel().userConfirmation(); + } + + public Object dataServiceInput() { + return this.innerModel().dataServiceInput(); + } + + public List customerSecrets() { + List inner = this.innerModel().customerSecrets(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public JobDefinitionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybriddatamanager.HybridDataManager manager() { + return this.serviceManager; + } + + private String dataServiceName; + + private String jobDefinitionName; + + private String resourceGroupName; + + private String dataManagerName; + + public JobDefinitionImpl withExistingDataService( + String dataServiceName, String resourceGroupName, String dataManagerName) { + this.dataServiceName = dataServiceName; + this.resourceGroupName = resourceGroupName; + this.dataManagerName = dataManagerName; + return this; + } + + public JobDefinition create() { + this.innerObject = + serviceManager + .serviceClient() + .getJobDefinitions() + .createOrUpdate( + dataServiceName, + jobDefinitionName, + resourceGroupName, + dataManagerName, + this.innerModel(), + Context.NONE); + return this; + } + + public JobDefinition create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getJobDefinitions() + .createOrUpdate( + dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, this.innerModel(), context); + return this; + } + + JobDefinitionImpl(String name, com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager) { + this.innerObject = new JobDefinitionInner(); + this.serviceManager = serviceManager; + this.jobDefinitionName = name; + } + + public JobDefinitionImpl update() { + return this; + } + + public JobDefinition apply() { + this.innerObject = + serviceManager + .serviceClient() + .getJobDefinitions() + .createOrUpdate( + dataServiceName, + jobDefinitionName, + resourceGroupName, + dataManagerName, + this.innerModel(), + Context.NONE); + return this; + } + + public JobDefinition apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getJobDefinitions() + .createOrUpdate( + dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, this.innerModel(), context); + return this; + } + + JobDefinitionImpl( + JobDefinitionInner innerObject, com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.dataServiceName = Utils.getValueFromIdByName(innerObject.id(), "dataServices"); + this.jobDefinitionName = Utils.getValueFromIdByName(innerObject.id(), "jobDefinitions"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.dataManagerName = Utils.getValueFromIdByName(innerObject.id(), "dataManagers"); + } + + public JobDefinition refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getJobDefinitions() + .getWithResponse(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, Context.NONE) + .getValue(); + return this; + } + + public JobDefinition refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getJobDefinitions() + .getWithResponse(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, context) + .getValue(); + return this; + } + + public void run(RunParameters runParameters) { + serviceManager + .jobDefinitions() + .run(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, runParameters); + } + + public void run(RunParameters runParameters, Context context) { + serviceManager + .jobDefinitions() + .run(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, runParameters, context); + } + + public JobDefinitionImpl withDataSourceId(String dataSourceId) { + this.innerModel().withDataSourceId(dataSourceId); + return this; + } + + public JobDefinitionImpl withDataSinkId(String dataSinkId) { + this.innerModel().withDataSinkId(dataSinkId); + return this; + } + + public JobDefinitionImpl withState(State state) { + this.innerModel().withState(state); + return this; + } + + public JobDefinitionImpl withSchedules(List schedules) { + this.innerModel().withSchedules(schedules); + return this; + } + + public JobDefinitionImpl withLastModifiedTime(OffsetDateTime lastModifiedTime) { + this.innerModel().withLastModifiedTime(lastModifiedTime); + return this; + } + + public JobDefinitionImpl withRunLocation(RunLocation runLocation) { + this.innerModel().withRunLocation(runLocation); + return this; + } + + public JobDefinitionImpl withUserConfirmation(UserConfirmation userConfirmation) { + this.innerModel().withUserConfirmation(userConfirmation); + return this; + } + + public JobDefinitionImpl withDataServiceInput(Object dataServiceInput) { + this.innerModel().withDataServiceInput(dataServiceInput); + return this; + } + + public JobDefinitionImpl withCustomerSecrets(List customerSecrets) { + this.innerModel().withCustomerSecrets(customerSecrets); + return this; + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/JobDefinitionsClientImpl.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/JobDefinitionsClientImpl.java new file mode 100644 index 000000000000..29dff9a5d4df --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/JobDefinitionsClientImpl.java @@ -0,0 +1,2024 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybriddatamanager.fluent.JobDefinitionsClient; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.JobDefinitionInner; +import com.azure.resourcemanager.hybriddatamanager.models.JobDefinitionList; +import com.azure.resourcemanager.hybriddatamanager.models.RunParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in JobDefinitionsClient. */ +public final class JobDefinitionsClientImpl implements JobDefinitionsClient { + private final ClientLogger logger = new ClientLogger(JobDefinitionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final JobDefinitionsService service; + + /** The service client containing this operation class. */ + private final HybridDataManagementClientImpl client; + + /** + * Initializes an instance of JobDefinitionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + JobDefinitionsClientImpl(HybridDataManagementClientImpl client) { + this.service = + RestProxy.create(JobDefinitionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridDataManagementClientJobDefinitions to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridDataManagement") + private interface JobDefinitionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData" + + "/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataService( + @HostParam("$host") String endpoint, + @PathParam("dataServiceName") String dataServiceName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataManagerName") String dataManagerName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData" + + "/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("dataServiceName") String dataServiceName, + @PathParam("jobDefinitionName") String jobDefinitionName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataManagerName") String dataManagerName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData" + + "/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("dataServiceName") String dataServiceName, + @PathParam("jobDefinitionName") String jobDefinitionName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataManagerName") String dataManagerName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") JobDefinitionInner jobDefinition, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData" + + "/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("dataServiceName") String dataServiceName, + @PathParam("jobDefinitionName") String jobDefinitionName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataManagerName") String dataManagerName, + @QueryParam("api-version") String apiVersion, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData" + + "/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}" + + "/run") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> run( + @HostParam("$host") String endpoint, + @PathParam("dataServiceName") String dataServiceName, + @PathParam("jobDefinitionName") String jobDefinitionName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataManagerName") String dataManagerName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RunParameters runParameters, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData" + + "/dataManagers/{dataManagerName}/jobDefinitions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataManager( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataManagerName") String dataManagerName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataManagerNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * This method gets all the job definitions of the given data service name. + * + * @param dataServiceName The data service type of interest. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataServiceSinglePageAsync( + String dataServiceName, String resourceGroupName, String dataManagerName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (dataServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByDataService( + this.client.getEndpoint(), + dataServiceName, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This method gets all the job definitions of the given data service name. + * + * @param dataServiceName The data service type of interest. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataServiceSinglePageAsync( + String dataServiceName, String resourceGroupName, String dataManagerName, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (dataServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByDataService( + this.client.getEndpoint(), + dataServiceName, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * This method gets all the job definitions of the given data service name. + * + * @param dataServiceName The data service type of interest. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataServiceAsync( + String dataServiceName, String resourceGroupName, String dataManagerName, String filter) { + return new PagedFlux<>( + () -> listByDataServiceSinglePageAsync(dataServiceName, resourceGroupName, dataManagerName, filter), + nextLink -> listByDataServiceNextSinglePageAsync(nextLink)); + } + + /** + * This method gets all the job definitions of the given data service name. + * + * @param dataServiceName The data service type of interest. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataServiceAsync( + String dataServiceName, String resourceGroupName, String dataManagerName) { + final String filter = null; + return new PagedFlux<>( + () -> listByDataServiceSinglePageAsync(dataServiceName, resourceGroupName, dataManagerName, filter), + nextLink -> listByDataServiceNextSinglePageAsync(nextLink)); + } + + /** + * This method gets all the job definitions of the given data service name. + * + * @param dataServiceName The data service type of interest. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataServiceAsync( + String dataServiceName, String resourceGroupName, String dataManagerName, String filter, Context context) { + return new PagedFlux<>( + () -> + listByDataServiceSinglePageAsync(dataServiceName, resourceGroupName, dataManagerName, filter, context), + nextLink -> listByDataServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * This method gets all the job definitions of the given data service name. + * + * @param dataServiceName The data service type of interest. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataService( + String dataServiceName, String resourceGroupName, String dataManagerName) { + final String filter = null; + return new PagedIterable<>(listByDataServiceAsync(dataServiceName, resourceGroupName, dataManagerName, filter)); + } + + /** + * This method gets all the job definitions of the given data service name. + * + * @param dataServiceName The data service type of interest. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataService( + String dataServiceName, String resourceGroupName, String dataManagerName, String filter, Context context) { + return new PagedIterable<>( + listByDataServiceAsync(dataServiceName, resourceGroupName, dataManagerName, filter, context)); + } + + /** + * This method gets job definition object by name. + * + * @param dataServiceName The data service name of the job definition. + * @param jobDefinitionName The job definition name that is being queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (dataServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataServiceName is required and cannot be null.")); + } + if (jobDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter jobDefinitionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + dataServiceName, + jobDefinitionName, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This method gets job definition object by name. + * + * @param dataServiceName The data service name of the job definition. + * @param jobDefinitionName The job definition name that is being queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (dataServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataServiceName is required and cannot be null.")); + } + if (jobDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter jobDefinitionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + dataServiceName, + jobDefinitionName, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * This method gets job definition object by name. + * + * @param dataServiceName The data service name of the job definition. + * @param jobDefinitionName The job definition name that is being queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName) { + return getWithResponseAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * This method gets job definition object by name. + * + * @param dataServiceName The data service name of the job definition. + * @param jobDefinitionName The job definition name that is being queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobDefinitionInner get( + String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName) { + return getAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName).block(); + } + + /** + * This method gets job definition object by name. + * + * @param dataServiceName The data service name of the job definition. + * @param jobDefinitionName The job definition name that is being queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + Context context) { + return getWithResponseAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, context) + .block(); + } + + /** + * Creates or updates a job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be created or updated. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param jobDefinition Job Definition object to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + JobDefinitionInner jobDefinition) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (dataServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataServiceName is required and cannot be null.")); + } + if (jobDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter jobDefinitionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + if (jobDefinition == null) { + return Mono.error(new IllegalArgumentException("Parameter jobDefinition is required and cannot be null.")); + } else { + jobDefinition.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + dataServiceName, + jobDefinitionName, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + jobDefinition, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be created or updated. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param jobDefinition Job Definition object to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + JobDefinitionInner jobDefinition, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (dataServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataServiceName is required and cannot be null.")); + } + if (jobDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter jobDefinitionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + if (jobDefinition == null) { + return Mono.error(new IllegalArgumentException("Parameter jobDefinition is required and cannot be null.")); + } else { + jobDefinition.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + dataServiceName, + jobDefinitionName, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + jobDefinition, + accept, + context); + } + + /** + * Creates or updates a job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be created or updated. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param jobDefinition Job Definition object to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, JobDefinitionInner> beginCreateOrUpdateAsync( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + JobDefinitionInner jobDefinition) { + Mono>> mono = + createOrUpdateWithResponseAsync( + dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, jobDefinition); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), JobDefinitionInner.class, JobDefinitionInner.class, Context.NONE); + } + + /** + * Creates or updates a job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be created or updated. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param jobDefinition Job Definition object to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, JobDefinitionInner> beginCreateOrUpdateAsync( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + JobDefinitionInner jobDefinition, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, jobDefinition, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), JobDefinitionInner.class, JobDefinitionInner.class, context); + } + + /** + * Creates or updates a job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be created or updated. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param jobDefinition Job Definition object to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, JobDefinitionInner> beginCreateOrUpdate( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + JobDefinitionInner jobDefinition) { + return beginCreateOrUpdateAsync( + dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, jobDefinition) + .getSyncPoller(); + } + + /** + * Creates or updates a job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be created or updated. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param jobDefinition Job Definition object to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, JobDefinitionInner> beginCreateOrUpdate( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + JobDefinitionInner jobDefinition, + Context context) { + return beginCreateOrUpdateAsync( + dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, jobDefinition, context) + .getSyncPoller(); + } + + /** + * Creates or updates a job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be created or updated. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param jobDefinition Job Definition object to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + JobDefinitionInner jobDefinition) { + return beginCreateOrUpdateAsync( + dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, jobDefinition) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be created or updated. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param jobDefinition Job Definition object to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + JobDefinitionInner jobDefinition, + Context context) { + return beginCreateOrUpdateAsync( + dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, jobDefinition, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be created or updated. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param jobDefinition Job Definition object to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobDefinitionInner createOrUpdate( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + JobDefinitionInner jobDefinition) { + return createOrUpdateAsync( + dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, jobDefinition) + .block(); + } + + /** + * Creates or updates a job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be created or updated. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param jobDefinition Job Definition object to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobDefinitionInner createOrUpdate( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + JobDefinitionInner jobDefinition, + Context context) { + return createOrUpdateAsync( + dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, jobDefinition, context) + .block(); + } + + /** + * This method deletes the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (dataServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataServiceName is required and cannot be null.")); + } + if (jobDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter jobDefinitionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + dataServiceName, + jobDefinitionName, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This method deletes the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (dataServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataServiceName is required and cannot be null.")); + } + if (jobDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter jobDefinitionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + dataServiceName, + jobDefinitionName, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + context); + } + + /** + * This method deletes the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName) { + Mono>> mono = + deleteWithResponseAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * This method deletes the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * This method deletes the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName) { + return beginDeleteAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName).getSyncPoller(); + } + + /** + * This method deletes the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + Context context) { + return beginDeleteAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, context) + .getSyncPoller(); + } + + /** + * This method deletes the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName) { + return beginDeleteAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This method deletes the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + Context context) { + return beginDeleteAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This method deletes the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName) { + deleteAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName).block(); + } + + /** + * This method deletes the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + Context context) { + deleteAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, context).block(); + } + + /** + * This method runs a job instance of the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName Name of the job definition. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param runParameters Run time parameters for the job definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> runWithResponseAsync( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + RunParameters runParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (dataServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataServiceName is required and cannot be null.")); + } + if (jobDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter jobDefinitionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + if (runParameters == null) { + return Mono.error(new IllegalArgumentException("Parameter runParameters is required and cannot be null.")); + } else { + runParameters.validate(); + } + return FluxUtil + .withContext( + context -> + service + .run( + this.client.getEndpoint(), + dataServiceName, + jobDefinitionName, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + runParameters, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This method runs a job instance of the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName Name of the job definition. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param runParameters Run time parameters for the job definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> runWithResponseAsync( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + RunParameters runParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (dataServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataServiceName is required and cannot be null.")); + } + if (jobDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter jobDefinitionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + if (runParameters == null) { + return Mono.error(new IllegalArgumentException("Parameter runParameters is required and cannot be null.")); + } else { + runParameters.validate(); + } + context = this.client.mergeContext(context); + return service + .run( + this.client.getEndpoint(), + dataServiceName, + jobDefinitionName, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + runParameters, + context); + } + + /** + * This method runs a job instance of the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName Name of the job definition. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param runParameters Run time parameters for the job definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRunAsync( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + RunParameters runParameters) { + Mono>> mono = + runWithResponseAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, runParameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * This method runs a job instance of the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName Name of the job definition. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param runParameters Run time parameters for the job definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRunAsync( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + RunParameters runParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + runWithResponseAsync( + dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, runParameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * This method runs a job instance of the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName Name of the job definition. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param runParameters Run time parameters for the job definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRun( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + RunParameters runParameters) { + return beginRunAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, runParameters) + .getSyncPoller(); + } + + /** + * This method runs a job instance of the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName Name of the job definition. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param runParameters Run time parameters for the job definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRun( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + RunParameters runParameters, + Context context) { + return beginRunAsync( + dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, runParameters, context) + .getSyncPoller(); + } + + /** + * This method runs a job instance of the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName Name of the job definition. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param runParameters Run time parameters for the job definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono runAsync( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + RunParameters runParameters) { + return beginRunAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, runParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This method runs a job instance of the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName Name of the job definition. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param runParameters Run time parameters for the job definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono runAsync( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + RunParameters runParameters, + Context context) { + return beginRunAsync( + dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, runParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This method runs a job instance of the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName Name of the job definition. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param runParameters Run time parameters for the job definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void run( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + RunParameters runParameters) { + runAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, runParameters).block(); + } + + /** + * This method runs a job instance of the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName Name of the job definition. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param runParameters Run time parameters for the job definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void run( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + RunParameters runParameters, + Context context) { + runAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, runParameters, context) + .block(); + } + + /** + * This method gets all the job definitions of the given data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataManagerSinglePageAsync( + String resourceGroupName, String dataManagerName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByDataManager( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This method gets all the job definitions of the given data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataManagerSinglePageAsync( + String resourceGroupName, String dataManagerName, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByDataManager( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * This method gets all the job definitions of the given data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataManagerAsync( + String resourceGroupName, String dataManagerName, String filter) { + return new PagedFlux<>( + () -> listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName, filter), + nextLink -> listByDataManagerNextSinglePageAsync(nextLink)); + } + + /** + * This method gets all the job definitions of the given data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataManagerAsync(String resourceGroupName, String dataManagerName) { + final String filter = null; + return new PagedFlux<>( + () -> listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName, filter), + nextLink -> listByDataManagerNextSinglePageAsync(nextLink)); + } + + /** + * This method gets all the job definitions of the given data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataManagerAsync( + String resourceGroupName, String dataManagerName, String filter, Context context) { + return new PagedFlux<>( + () -> listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName, filter, context), + nextLink -> listByDataManagerNextSinglePageAsync(nextLink, context)); + } + + /** + * This method gets all the job definitions of the given data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataManager(String resourceGroupName, String dataManagerName) { + final String filter = null; + return new PagedIterable<>(listByDataManagerAsync(resourceGroupName, dataManagerName, filter)); + } + + /** + * This method gets all the job definitions of the given data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataManager( + String resourceGroupName, String dataManagerName, String filter, Context context) { + return new PagedIterable<>(listByDataManagerAsync(resourceGroupName, dataManagerName, filter, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataServiceNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByDataServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataServiceNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByDataServiceNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataManagerNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByDataManagerNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataManagerNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByDataManagerNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/JobDefinitionsImpl.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/JobDefinitionsImpl.java new file mode 100644 index 000000000000..aaab15655050 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/JobDefinitionsImpl.java @@ -0,0 +1,278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybriddatamanager.fluent.JobDefinitionsClient; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.JobDefinitionInner; +import com.azure.resourcemanager.hybriddatamanager.models.JobDefinition; +import com.azure.resourcemanager.hybriddatamanager.models.JobDefinitions; +import com.azure.resourcemanager.hybriddatamanager.models.RunParameters; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class JobDefinitionsImpl implements JobDefinitions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobDefinitionsImpl.class); + + private final JobDefinitionsClient innerClient; + + private final com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager; + + public JobDefinitionsImpl( + JobDefinitionsClient innerClient, + com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByDataService( + String dataServiceName, String resourceGroupName, String dataManagerName) { + PagedIterable inner = + this.serviceClient().listByDataService(dataServiceName, resourceGroupName, dataManagerName); + return Utils.mapPage(inner, inner1 -> new JobDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable listByDataService( + String dataServiceName, String resourceGroupName, String dataManagerName, String filter, Context context) { + PagedIterable inner = + this + .serviceClient() + .listByDataService(dataServiceName, resourceGroupName, dataManagerName, filter, context); + return Utils.mapPage(inner, inner1 -> new JobDefinitionImpl(inner1, this.manager())); + } + + public JobDefinition get( + String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName) { + JobDefinitionInner inner = + this.serviceClient().get(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName); + if (inner != null) { + return new JobDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new JobDefinitionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete( + String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName) { + this.serviceClient().delete(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName); + } + + public void delete( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + Context context) { + this.serviceClient().delete(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, context); + } + + public void run( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + RunParameters runParameters) { + this.serviceClient().run(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, runParameters); + } + + public void run( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + RunParameters runParameters, + Context context) { + this + .serviceClient() + .run(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, runParameters, context); + } + + public PagedIterable listByDataManager(String resourceGroupName, String dataManagerName) { + PagedIterable inner = + this.serviceClient().listByDataManager(resourceGroupName, dataManagerName); + return Utils.mapPage(inner, inner1 -> new JobDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable listByDataManager( + String resourceGroupName, String dataManagerName, String filter, Context context) { + PagedIterable inner = + this.serviceClient().listByDataManager(resourceGroupName, dataManagerName, filter, context); + return Utils.mapPage(inner, inner1 -> new JobDefinitionImpl(inner1, this.manager())); + } + + public JobDefinition getById(String id) { + String dataServiceName = Utils.getValueFromIdByName(id, "dataServices"); + if (dataServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataServices'.", id))); + } + String jobDefinitionName = Utils.getValueFromIdByName(id, "jobDefinitions"); + if (jobDefinitionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'jobDefinitions'.", id))); + } + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dataManagerName = Utils.getValueFromIdByName(id, "dataManagers"); + if (dataManagerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataManagers'.", id))); + } + return this + .getWithResponse(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String dataServiceName = Utils.getValueFromIdByName(id, "dataServices"); + if (dataServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataServices'.", id))); + } + String jobDefinitionName = Utils.getValueFromIdByName(id, "jobDefinitions"); + if (jobDefinitionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'jobDefinitions'.", id))); + } + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dataManagerName = Utils.getValueFromIdByName(id, "dataManagers"); + if (dataManagerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataManagers'.", id))); + } + return this.getWithResponse(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, context); + } + + public void deleteById(String id) { + String dataServiceName = Utils.getValueFromIdByName(id, "dataServices"); + if (dataServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataServices'.", id))); + } + String jobDefinitionName = Utils.getValueFromIdByName(id, "jobDefinitions"); + if (jobDefinitionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'jobDefinitions'.", id))); + } + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dataManagerName = Utils.getValueFromIdByName(id, "dataManagers"); + if (dataManagerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataManagers'.", id))); + } + this.delete(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String dataServiceName = Utils.getValueFromIdByName(id, "dataServices"); + if (dataServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataServices'.", id))); + } + String jobDefinitionName = Utils.getValueFromIdByName(id, "jobDefinitions"); + if (jobDefinitionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'jobDefinitions'.", id))); + } + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dataManagerName = Utils.getValueFromIdByName(id, "dataManagers"); + if (dataManagerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataManagers'.", id))); + } + this.delete(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, context); + } + + private JobDefinitionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybriddatamanager.HybridDataManager manager() { + return this.serviceManager; + } + + public JobDefinitionImpl define(String name) { + return new JobDefinitionImpl(name, this.manager()); + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/JobDetailsImpl.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/JobDetailsImpl.java new file mode 100644 index 000000000000..e60c10b8b7fd --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/JobDetailsImpl.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.implementation; + +import com.azure.resourcemanager.hybriddatamanager.fluent.models.JobDefinitionInner; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.JobDetailsInner; +import com.azure.resourcemanager.hybriddatamanager.models.ErrorDetails; +import com.azure.resourcemanager.hybriddatamanager.models.JobDefinition; +import com.azure.resourcemanager.hybriddatamanager.models.JobDetails; +import com.azure.resourcemanager.hybriddatamanager.models.JobStages; +import java.util.Collections; +import java.util.List; + +public final class JobDetailsImpl implements JobDetails { + private JobDetailsInner innerObject; + + private final com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager; + + JobDetailsImpl( + JobDetailsInner innerObject, com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List jobStages() { + List inner = this.innerModel().jobStages(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public JobDefinition jobDefinition() { + JobDefinitionInner inner = this.innerModel().jobDefinition(); + if (inner != null) { + return new JobDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public List errorDetails() { + List inner = this.innerModel().errorDetails(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String itemDetailsLink() { + return this.innerModel().itemDetailsLink(); + } + + public JobDetailsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybriddatamanager.HybridDataManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/JobImpl.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/JobImpl.java new file mode 100644 index 000000000000..b081307f7e7e --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/JobImpl.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.implementation; + +import com.azure.resourcemanager.hybriddatamanager.fluent.models.JobDetailsInner; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.JobInner; +import com.azure.resourcemanager.hybriddatamanager.models.Error; +import com.azure.resourcemanager.hybriddatamanager.models.IsJobCancellable; +import com.azure.resourcemanager.hybriddatamanager.models.Job; +import com.azure.resourcemanager.hybriddatamanager.models.JobDetails; +import com.azure.resourcemanager.hybriddatamanager.models.JobStatus; +import java.time.OffsetDateTime; + +public final class JobImpl implements Job { + private JobInner innerObject; + + private final com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager; + + JobImpl(JobInner innerObject, com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String id() { + return this.innerModel().id(); + } + + public String type() { + return this.innerModel().type(); + } + + public JobStatus status() { + return this.innerModel().status(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public Error error() { + return this.innerModel().error(); + } + + public IsJobCancellable isCancellable() { + return this.innerModel().isCancellable(); + } + + public Long bytesProcessed() { + return this.innerModel().bytesProcessed(); + } + + public Long itemsProcessed() { + return this.innerModel().itemsProcessed(); + } + + public Long totalBytesToProcess() { + return this.innerModel().totalBytesToProcess(); + } + + public Long totalItemsToProcess() { + return this.innerModel().totalItemsToProcess(); + } + + public JobDetails details() { + JobDetailsInner inner = this.innerModel().details(); + if (inner != null) { + return new JobDetailsImpl(inner, this.manager()); + } else { + return null; + } + } + + public String dataSourceName() { + return this.innerModel().dataSourceName(); + } + + public String dataSinkName() { + return this.innerModel().dataSinkName(); + } + + public JobInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybriddatamanager.HybridDataManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/JobsClientImpl.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/JobsClientImpl.java new file mode 100644 index 000000000000..275dd38fede3 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/JobsClientImpl.java @@ -0,0 +1,2129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybriddatamanager.fluent.JobsClient; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.JobInner; +import com.azure.resourcemanager.hybriddatamanager.models.JobList; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in JobsClient. */ +public final class JobsClientImpl implements JobsClient { + private final ClientLogger logger = new ClientLogger(JobsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final JobsService service; + + /** The service client containing this operation class. */ + private final HybridDataManagementClientImpl client; + + /** + * Initializes an instance of JobsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + JobsClientImpl(HybridDataManagementClientImpl client) { + this.service = RestProxy.create(JobsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridDataManagementClientJobs to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridDataManagement") + private interface JobsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData" + + "/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}" + + "/jobs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByJobDefinition( + @HostParam("$host") String endpoint, + @PathParam("dataServiceName") String dataServiceName, + @PathParam("jobDefinitionName") String jobDefinitionName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataManagerName") String dataManagerName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData" + + "/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}" + + "/jobs/{jobId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("dataServiceName") String dataServiceName, + @PathParam("jobDefinitionName") String jobDefinitionName, + @PathParam("jobId") String jobId, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataManagerName") String dataManagerName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData" + + "/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}" + + "/jobs/{jobId}/cancel") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> cancel( + @HostParam("$host") String endpoint, + @PathParam("dataServiceName") String dataServiceName, + @PathParam("jobDefinitionName") String jobDefinitionName, + @PathParam("jobId") String jobId, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataManagerName") String dataManagerName, + @QueryParam("api-version") String apiVersion, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData" + + "/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}" + + "/jobs/{jobId}/resume") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resume( + @HostParam("$host") String endpoint, + @PathParam("dataServiceName") String dataServiceName, + @PathParam("jobDefinitionName") String jobDefinitionName, + @PathParam("jobId") String jobId, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataManagerName") String dataManagerName, + @QueryParam("api-version") String apiVersion, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData" + + "/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataService( + @HostParam("$host") String endpoint, + @PathParam("dataServiceName") String dataServiceName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataManagerName") String dataManagerName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData" + + "/dataManagers/{dataManagerName}/jobs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataManager( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataManagerName") String dataManagerName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByJobDefinitionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataManagerNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * This method gets all the jobs of a given job definition. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition for which jobs are needed. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByJobDefinitionSinglePageAsync( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (dataServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataServiceName is required and cannot be null.")); + } + if (jobDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter jobDefinitionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByJobDefinition( + this.client.getEndpoint(), + dataServiceName, + jobDefinitionName, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This method gets all the jobs of a given job definition. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition for which jobs are needed. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByJobDefinitionSinglePageAsync( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + String filter, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (dataServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataServiceName is required and cannot be null.")); + } + if (jobDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter jobDefinitionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByJobDefinition( + this.client.getEndpoint(), + dataServiceName, + jobDefinitionName, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * This method gets all the jobs of a given job definition. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition for which jobs are needed. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByJobDefinitionAsync( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + String filter) { + return new PagedFlux<>( + () -> + listByJobDefinitionSinglePageAsync( + dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, filter), + nextLink -> listByJobDefinitionNextSinglePageAsync(nextLink)); + } + + /** + * This method gets all the jobs of a given job definition. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition for which jobs are needed. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByJobDefinitionAsync( + String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName) { + final String filter = null; + return new PagedFlux<>( + () -> + listByJobDefinitionSinglePageAsync( + dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, filter), + nextLink -> listByJobDefinitionNextSinglePageAsync(nextLink)); + } + + /** + * This method gets all the jobs of a given job definition. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition for which jobs are needed. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByJobDefinitionAsync( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + String filter, + Context context) { + return new PagedFlux<>( + () -> + listByJobDefinitionSinglePageAsync( + dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, filter, context), + nextLink -> listByJobDefinitionNextSinglePageAsync(nextLink, context)); + } + + /** + * This method gets all the jobs of a given job definition. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition for which jobs are needed. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByJobDefinition( + String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName) { + final String filter = null; + return new PagedIterable<>( + listByJobDefinitionAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, filter)); + } + + /** + * This method gets all the jobs of a given job definition. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition for which jobs are needed. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByJobDefinition( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + String filter, + Context context) { + return new PagedIterable<>( + listByJobDefinitionAsync( + dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, filter, context)); + } + + /** + * This method gets a data manager job given the jobId. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param expand $expand is supported on details parameter for job, which provides details on the job stages. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data service job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName, + String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (dataServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataServiceName is required and cannot be null.")); + } + if (jobDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter jobDefinitionName is required and cannot be null.")); + } + if (jobId == null) { + return Mono.error(new IllegalArgumentException("Parameter jobId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + dataServiceName, + jobDefinitionName, + jobId, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This method gets a data manager job given the jobId. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param expand $expand is supported on details parameter for job, which provides details on the job stages. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data service job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName, + String expand, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (dataServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataServiceName is required and cannot be null.")); + } + if (jobDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter jobDefinitionName is required and cannot be null.")); + } + if (jobId == null) { + return Mono.error(new IllegalArgumentException("Parameter jobId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + dataServiceName, + jobDefinitionName, + jobId, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + expand, + accept, + context); + } + + /** + * This method gets a data manager job given the jobId. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param expand $expand is supported on details parameter for job, which provides details on the job stages. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data service job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName, + String expand) { + return getWithResponseAsync( + dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * This method gets a data manager job given the jobId. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data service job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName) { + final String expand = null; + return getWithResponseAsync( + dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * This method gets a data manager job given the jobId. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data service job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobInner get( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName) { + final String expand = null; + return getAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName, expand).block(); + } + + /** + * This method gets a data manager job given the jobId. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param expand $expand is supported on details parameter for job, which provides details on the job stages. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data service job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName, + String expand, + Context context) { + return getWithResponseAsync( + dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName, expand, context) + .block(); + } + + /** + * Cancels the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cancelWithResponseAsync( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (dataServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataServiceName is required and cannot be null.")); + } + if (jobDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter jobDefinitionName is required and cannot be null.")); + } + if (jobId == null) { + return Mono.error(new IllegalArgumentException("Parameter jobId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .cancel( + this.client.getEndpoint(), + dataServiceName, + jobDefinitionName, + jobId, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Cancels the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cancelWithResponseAsync( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (dataServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataServiceName is required and cannot be null.")); + } + if (jobDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter jobDefinitionName is required and cannot be null.")); + } + if (jobId == null) { + return Mono.error(new IllegalArgumentException("Parameter jobId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .cancel( + this.client.getEndpoint(), + dataServiceName, + jobDefinitionName, + jobId, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + context); + } + + /** + * Cancels the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginCancelAsync( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName) { + Mono>> mono = + cancelWithResponseAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Cancels the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginCancelAsync( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + cancelWithResponseAsync( + dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Cancels the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginCancel( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName) { + return beginCancelAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName) + .getSyncPoller(); + } + + /** + * Cancels the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginCancel( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName, + Context context) { + return beginCancelAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName, context) + .getSyncPoller(); + } + + /** + * Cancels the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cancelAsync( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName) { + return beginCancelAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Cancels the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cancelAsync( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName, + Context context) { + return beginCancelAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Cancels the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void cancel( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName) { + cancelAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName).block(); + } + + /** + * Cancels the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void cancel( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName, + Context context) { + cancelAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName, context).block(); + } + + /** + * Resumes the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resumeWithResponseAsync( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (dataServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataServiceName is required and cannot be null.")); + } + if (jobDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter jobDefinitionName is required and cannot be null.")); + } + if (jobId == null) { + return Mono.error(new IllegalArgumentException("Parameter jobId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .resume( + this.client.getEndpoint(), + dataServiceName, + jobDefinitionName, + jobId, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Resumes the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resumeWithResponseAsync( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (dataServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataServiceName is required and cannot be null.")); + } + if (jobDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter jobDefinitionName is required and cannot be null.")); + } + if (jobId == null) { + return Mono.error(new IllegalArgumentException("Parameter jobId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .resume( + this.client.getEndpoint(), + dataServiceName, + jobDefinitionName, + jobId, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + context); + } + + /** + * Resumes the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginResumeAsync( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName) { + Mono>> mono = + resumeWithResponseAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Resumes the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginResumeAsync( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + resumeWithResponseAsync( + dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Resumes the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginResume( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName) { + return beginResumeAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName) + .getSyncPoller(); + } + + /** + * Resumes the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginResume( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName, + Context context) { + return beginResumeAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName, context) + .getSyncPoller(); + } + + /** + * Resumes the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resumeAsync( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName) { + return beginResumeAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resumes the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resumeAsync( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName, + Context context) { + return beginResumeAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resumes the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void resume( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName) { + resumeAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName).block(); + } + + /** + * Resumes the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void resume( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName, + Context context) { + resumeAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName, context).block(); + } + + /** + * This method gets all the jobs of a data service type in a given resource. + * + * @param dataServiceName The name of the data service of interest. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataServiceSinglePageAsync( + String dataServiceName, String resourceGroupName, String dataManagerName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (dataServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByDataService( + this.client.getEndpoint(), + dataServiceName, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This method gets all the jobs of a data service type in a given resource. + * + * @param dataServiceName The name of the data service of interest. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataServiceSinglePageAsync( + String dataServiceName, String resourceGroupName, String dataManagerName, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (dataServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByDataService( + this.client.getEndpoint(), + dataServiceName, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * This method gets all the jobs of a data service type in a given resource. + * + * @param dataServiceName The name of the data service of interest. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataServiceAsync( + String dataServiceName, String resourceGroupName, String dataManagerName, String filter) { + return new PagedFlux<>( + () -> listByDataServiceSinglePageAsync(dataServiceName, resourceGroupName, dataManagerName, filter), + nextLink -> listByDataServiceNextSinglePageAsync(nextLink)); + } + + /** + * This method gets all the jobs of a data service type in a given resource. + * + * @param dataServiceName The name of the data service of interest. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataServiceAsync( + String dataServiceName, String resourceGroupName, String dataManagerName) { + final String filter = null; + return new PagedFlux<>( + () -> listByDataServiceSinglePageAsync(dataServiceName, resourceGroupName, dataManagerName, filter), + nextLink -> listByDataServiceNextSinglePageAsync(nextLink)); + } + + /** + * This method gets all the jobs of a data service type in a given resource. + * + * @param dataServiceName The name of the data service of interest. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataServiceAsync( + String dataServiceName, String resourceGroupName, String dataManagerName, String filter, Context context) { + return new PagedFlux<>( + () -> + listByDataServiceSinglePageAsync(dataServiceName, resourceGroupName, dataManagerName, filter, context), + nextLink -> listByDataServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * This method gets all the jobs of a data service type in a given resource. + * + * @param dataServiceName The name of the data service of interest. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataService( + String dataServiceName, String resourceGroupName, String dataManagerName) { + final String filter = null; + return new PagedIterable<>(listByDataServiceAsync(dataServiceName, resourceGroupName, dataManagerName, filter)); + } + + /** + * This method gets all the jobs of a data service type in a given resource. + * + * @param dataServiceName The name of the data service of interest. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataService( + String dataServiceName, String resourceGroupName, String dataManagerName, String filter, Context context) { + return new PagedIterable<>( + listByDataServiceAsync(dataServiceName, resourceGroupName, dataManagerName, filter, context)); + } + + /** + * This method gets all the jobs at the data manager resource level. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataManagerSinglePageAsync( + String resourceGroupName, String dataManagerName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByDataManager( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This method gets all the jobs at the data manager resource level. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataManagerSinglePageAsync( + String resourceGroupName, String dataManagerName, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByDataManager( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * This method gets all the jobs at the data manager resource level. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataManagerAsync( + String resourceGroupName, String dataManagerName, String filter) { + return new PagedFlux<>( + () -> listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName, filter), + nextLink -> listByDataManagerNextSinglePageAsync(nextLink)); + } + + /** + * This method gets all the jobs at the data manager resource level. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataManagerAsync(String resourceGroupName, String dataManagerName) { + final String filter = null; + return new PagedFlux<>( + () -> listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName, filter), + nextLink -> listByDataManagerNextSinglePageAsync(nextLink)); + } + + /** + * This method gets all the jobs at the data manager resource level. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataManagerAsync( + String resourceGroupName, String dataManagerName, String filter, Context context) { + return new PagedFlux<>( + () -> listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName, filter, context), + nextLink -> listByDataManagerNextSinglePageAsync(nextLink, context)); + } + + /** + * This method gets all the jobs at the data manager resource level. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataManager(String resourceGroupName, String dataManagerName) { + final String filter = null; + return new PagedIterable<>(listByDataManagerAsync(resourceGroupName, dataManagerName, filter)); + } + + /** + * This method gets all the jobs at the data manager resource level. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataManager( + String resourceGroupName, String dataManagerName, String filter, Context context) { + return new PagedIterable<>(listByDataManagerAsync(resourceGroupName, dataManagerName, filter, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByJobDefinitionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByJobDefinitionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByJobDefinitionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByJobDefinitionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataServiceNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByDataServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataServiceNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByDataServiceNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataManagerNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByDataManagerNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataManagerNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByDataManagerNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/JobsImpl.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/JobsImpl.java new file mode 100644 index 000000000000..3c91a309e501 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/JobsImpl.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybriddatamanager.fluent.JobsClient; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.JobInner; +import com.azure.resourcemanager.hybriddatamanager.models.Job; +import com.azure.resourcemanager.hybriddatamanager.models.Jobs; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class JobsImpl implements Jobs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobsImpl.class); + + private final JobsClient innerClient; + + private final com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager; + + public JobsImpl( + JobsClient innerClient, com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByJobDefinition( + String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName) { + PagedIterable inner = + this + .serviceClient() + .listByJobDefinition(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName); + return Utils.mapPage(inner, inner1 -> new JobImpl(inner1, this.manager())); + } + + public PagedIterable listByJobDefinition( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + String filter, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByJobDefinition( + dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, filter, context); + return Utils.mapPage(inner, inner1 -> new JobImpl(inner1, this.manager())); + } + + public Job get( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName) { + JobInner inner = + this.serviceClient().get(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName); + if (inner != null) { + return new JobImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName, + String expand, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new JobImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void cancel( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName) { + this.serviceClient().cancel(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName); + } + + public void cancel( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName, + Context context) { + this + .serviceClient() + .cancel(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName, context); + } + + public void resume( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName) { + this.serviceClient().resume(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName); + } + + public void resume( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName, + Context context) { + this + .serviceClient() + .resume(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName, context); + } + + public PagedIterable listByDataService( + String dataServiceName, String resourceGroupName, String dataManagerName) { + PagedIterable inner = + this.serviceClient().listByDataService(dataServiceName, resourceGroupName, dataManagerName); + return Utils.mapPage(inner, inner1 -> new JobImpl(inner1, this.manager())); + } + + public PagedIterable listByDataService( + String dataServiceName, String resourceGroupName, String dataManagerName, String filter, Context context) { + PagedIterable inner = + this + .serviceClient() + .listByDataService(dataServiceName, resourceGroupName, dataManagerName, filter, context); + return Utils.mapPage(inner, inner1 -> new JobImpl(inner1, this.manager())); + } + + public PagedIterable listByDataManager(String resourceGroupName, String dataManagerName) { + PagedIterable inner = this.serviceClient().listByDataManager(resourceGroupName, dataManagerName); + return Utils.mapPage(inner, inner1 -> new JobImpl(inner1, this.manager())); + } + + public PagedIterable listByDataManager( + String resourceGroupName, String dataManagerName, String filter, Context context) { + PagedIterable inner = + this.serviceClient().listByDataManager(resourceGroupName, dataManagerName, filter, context); + return Utils.mapPage(inner, inner1 -> new JobImpl(inner1, this.manager())); + } + + private JobsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybriddatamanager.HybridDataManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/OperationsClientImpl.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..10e949496273 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/OperationsClientImpl.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybriddatamanager.fluent.OperationsClient; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.AvailableProviderOperationInner; +import com.azure.resourcemanager.hybriddatamanager.models.AvailableProviderOperations; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final HybridDataManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(HybridDataManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridDataManagementClientOperations to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridDataManagement") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.HybridData/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * The list of operations for Microsoft.HybridData provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class for set of operations used for discovery of available provider operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The list of operations for Microsoft.HybridData provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class for set of operations used for discovery of available provider operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * The list of operations for Microsoft.HybridData provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class for set of operations used for discovery of available provider operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * The list of operations for Microsoft.HybridData provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class for set of operations used for discovery of available provider operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * The list of operations for Microsoft.HybridData provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class for set of operations used for discovery of available provider operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * The list of operations for Microsoft.HybridData provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class for set of operations used for discovery of available provider operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class for set of operations used for discovery of available provider operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class for set of operations used for discovery of available provider operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/OperationsImpl.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/OperationsImpl.java new file mode 100644 index 000000000000..a5b2e6ed6166 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/OperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybriddatamanager.fluent.OperationsClient; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.AvailableProviderOperationInner; +import com.azure.resourcemanager.hybriddatamanager.models.AvailableProviderOperation; +import com.azure.resourcemanager.hybriddatamanager.models.Operations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new AvailableProviderOperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new AvailableProviderOperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybriddatamanager.HybridDataManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/PublicKeyImpl.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/PublicKeyImpl.java new file mode 100644 index 000000000000..5e1b8bd093f6 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/PublicKeyImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.implementation; + +import com.azure.resourcemanager.hybriddatamanager.fluent.models.PublicKeyInner; +import com.azure.resourcemanager.hybriddatamanager.models.Key; +import com.azure.resourcemanager.hybriddatamanager.models.PublicKey; + +public final class PublicKeyImpl implements PublicKey { + private PublicKeyInner innerObject; + + private final com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager; + + PublicKeyImpl( + PublicKeyInner innerObject, com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String id() { + return this.innerModel().id(); + } + + public String type() { + return this.innerModel().type(); + } + + public Key dataServiceLevel1Key() { + return this.innerModel().dataServiceLevel1Key(); + } + + public Key dataServiceLevel2Key() { + return this.innerModel().dataServiceLevel2Key(); + } + + public PublicKeyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybriddatamanager.HybridDataManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/PublicKeysClientImpl.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/PublicKeysClientImpl.java new file mode 100644 index 000000000000..1a4ec1d345e2 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/PublicKeysClientImpl.java @@ -0,0 +1,531 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybriddatamanager.fluent.PublicKeysClient; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.PublicKeyInner; +import com.azure.resourcemanager.hybriddatamanager.models.PublicKeyList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PublicKeysClient. */ +public final class PublicKeysClientImpl implements PublicKeysClient { + private final ClientLogger logger = new ClientLogger(PublicKeysClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PublicKeysService service; + + /** The service client containing this operation class. */ + private final HybridDataManagementClientImpl client; + + /** + * Initializes an instance of PublicKeysClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PublicKeysClientImpl(HybridDataManagementClientImpl client) { + this.service = + RestProxy.create(PublicKeysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridDataManagementClientPublicKeys to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridDataManagement") + private interface PublicKeysService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData" + + "/dataManagers/{dataManagerName}/publicKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataManager( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataManagerName") String dataManagerName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData" + + "/dataManagers/{dataManagerName}/publicKeys/{publicKeyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("publicKeyName") String publicKeyName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataManagerName") String dataManagerName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataManagerNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * This method gets the list view of public keys, however it will only have one element. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publicKey Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataManagerSinglePageAsync( + String resourceGroupName, String dataManagerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByDataManager( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This method gets the list view of public keys, however it will only have one element. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publicKey Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataManagerSinglePageAsync( + String resourceGroupName, String dataManagerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByDataManager( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * This method gets the list view of public keys, however it will only have one element. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publicKey Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataManagerAsync(String resourceGroupName, String dataManagerName) { + return new PagedFlux<>( + () -> listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName), + nextLink -> listByDataManagerNextSinglePageAsync(nextLink)); + } + + /** + * This method gets the list view of public keys, however it will only have one element. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publicKey Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataManagerAsync( + String resourceGroupName, String dataManagerName, Context context) { + return new PagedFlux<>( + () -> listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName, context), + nextLink -> listByDataManagerNextSinglePageAsync(nextLink, context)); + } + + /** + * This method gets the list view of public keys, however it will only have one element. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publicKey Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataManager(String resourceGroupName, String dataManagerName) { + return new PagedIterable<>(listByDataManagerAsync(resourceGroupName, dataManagerName)); + } + + /** + * This method gets the list view of public keys, however it will only have one element. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publicKey Collection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataManager( + String resourceGroupName, String dataManagerName, Context context) { + return new PagedIterable<>(listByDataManagerAsync(resourceGroupName, dataManagerName, context)); + } + + /** + * This method gets the public keys. + * + * @param publicKeyName Name of the public key. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String publicKeyName, String resourceGroupName, String dataManagerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (publicKeyName == null) { + return Mono.error(new IllegalArgumentException("Parameter publicKeyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + publicKeyName, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This method gets the public keys. + * + * @param publicKeyName Name of the public key. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String publicKeyName, String resourceGroupName, String dataManagerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (publicKeyName == null) { + return Mono.error(new IllegalArgumentException("Parameter publicKeyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + publicKeyName, + this.client.getSubscriptionId(), + resourceGroupName, + dataManagerName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * This method gets the public keys. + * + * @param publicKeyName Name of the public key. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String publicKeyName, String resourceGroupName, String dataManagerName) { + return getWithResponseAsync(publicKeyName, resourceGroupName, dataManagerName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * This method gets the public keys. + * + * @param publicKeyName Name of the public key. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PublicKeyInner get(String publicKeyName, String resourceGroupName, String dataManagerName) { + return getAsync(publicKeyName, resourceGroupName, dataManagerName).block(); + } + + /** + * This method gets the public keys. + * + * @param publicKeyName Name of the public key. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String publicKeyName, String resourceGroupName, String dataManagerName, Context context) { + return getWithResponseAsync(publicKeyName, resourceGroupName, dataManagerName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publicKey Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataManagerNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByDataManagerNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publicKey Collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataManagerNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByDataManagerNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/PublicKeysImpl.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/PublicKeysImpl.java new file mode 100644 index 000000000000..11002b0960b4 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/PublicKeysImpl.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybriddatamanager.fluent.PublicKeysClient; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.PublicKeyInner; +import com.azure.resourcemanager.hybriddatamanager.models.PublicKey; +import com.azure.resourcemanager.hybriddatamanager.models.PublicKeys; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PublicKeysImpl implements PublicKeys { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicKeysImpl.class); + + private final PublicKeysClient innerClient; + + private final com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager; + + public PublicKeysImpl( + PublicKeysClient innerClient, com.azure.resourcemanager.hybriddatamanager.HybridDataManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByDataManager(String resourceGroupName, String dataManagerName) { + PagedIterable inner = + this.serviceClient().listByDataManager(resourceGroupName, dataManagerName); + return Utils.mapPage(inner, inner1 -> new PublicKeyImpl(inner1, this.manager())); + } + + public PagedIterable listByDataManager( + String resourceGroupName, String dataManagerName, Context context) { + PagedIterable inner = + this.serviceClient().listByDataManager(resourceGroupName, dataManagerName, context); + return Utils.mapPage(inner, inner1 -> new PublicKeyImpl(inner1, this.manager())); + } + + public PublicKey get(String publicKeyName, String resourceGroupName, String dataManagerName) { + PublicKeyInner inner = this.serviceClient().get(publicKeyName, resourceGroupName, dataManagerName); + if (inner != null) { + return new PublicKeyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String publicKeyName, String resourceGroupName, String dataManagerName, Context context) { + Response inner = + this.serviceClient().getWithResponse(publicKeyName, resourceGroupName, dataManagerName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PublicKeyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private PublicKeysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybriddatamanager.HybridDataManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/Utils.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/Utils.java new file mode 100644 index 000000000000..1f11e6fd4a18 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/package-info.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/package-info.java new file mode 100644 index 000000000000..be5048828437 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for HybridDataManagementClient. null. */ +package com.azure.resourcemanager.hybriddatamanager.implementation; diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/AvailableProviderOperation.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/AvailableProviderOperation.java new file mode 100644 index 000000000000..31440ece4c5a --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/AvailableProviderOperation.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.resourcemanager.hybriddatamanager.fluent.models.AvailableProviderOperationInner; + +/** An immutable client-side representation of AvailableProviderOperation. */ +public interface AvailableProviderOperation { + /** + * Gets the name property: Gets or Sets Name of the operations. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: Gets or sets Display information Contains the localized display information for this + * particular operation/action. + * + * @return the display value. + */ + AvailableProviderOperationDisplay display(); + + /** + * Gets the origin property: Gets or sets Origin The intended executor of the operation; governs the display of the + * operation in the RBAC UX and the audit logs UX. Default value is “user,system”. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the properties property: Gets or sets Properties Reserved for future use. + * + * @return the properties value. + */ + Object properties(); + + /** + * Gets the inner com.azure.resourcemanager.hybriddatamanager.fluent.models.AvailableProviderOperationInner object. + * + * @return the inner object. + */ + AvailableProviderOperationInner innerModel(); +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/AvailableProviderOperationDisplay.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/AvailableProviderOperationDisplay.java new file mode 100644 index 000000000000..53ae5ca3a567 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/AvailableProviderOperationDisplay.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains the localized display information for this particular operation / action. These value will be used by + * several clients for (1) custom role definitions for RBAC; (2) complex query filters for the event service; and (3) + * audit history / records for management operations. + */ +@Fluent +public final class AvailableProviderOperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableProviderOperationDisplay.class); + + /* + * Gets or sets Provider + * The localized friendly form of the resource provider name – it is + * expected to also include the publisher/company responsible. + * It should use Title Casing and begin with “Microsoft” for 1st party + * services. + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * Gets or sets Resource + * The localized friendly form of the resource type related to this + * action/operation – it should match the public documentation for the + * resource provider. + * It should use Title Casing – for examples, please refer to the “name” + * section. + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * Gets or sets Operation + * The localized friendly name for the operation, as it should be shown to + * the user. + * It should be concise (to fit in drop downs) but clear (i.e. + * self-documenting). It should use Title Casing and include the + * entity/resource to which it applies. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Gets or sets Description + * The localized friendly description for the operation, as it should be + * shown to the user. + * It should be thorough, yet concise – it will be used in tool tips and + * detailed views. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the provider property: Gets or sets Provider The localized friendly form of the resource provider name – it + * is expected to also include the publisher/company responsible. It should use Title Casing and begin with + * “Microsoft” for 1st party services. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Gets or sets Provider The localized friendly form of the resource provider name – it + * is expected to also include the publisher/company responsible. It should use Title Casing and begin with + * “Microsoft” for 1st party services. + * + * @param provider the provider value to set. + * @return the AvailableProviderOperationDisplay object itself. + */ + public AvailableProviderOperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: Gets or sets Resource The localized friendly form of the resource type related to this + * action/operation – it should match the public documentation for the resource provider. It should use Title Casing + * – for examples, please refer to the “name” section. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: Gets or sets Resource The localized friendly form of the resource type related to this + * action/operation – it should match the public documentation for the resource provider. It should use Title Casing + * – for examples, please refer to the “name” section. + * + * @param resource the resource value to set. + * @return the AvailableProviderOperationDisplay object itself. + */ + public AvailableProviderOperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: Gets or sets Operation The localized friendly name for the operation, as it should be + * shown to the user. It should be concise (to fit in drop downs) but clear (i.e. self-documenting). It should use + * Title Casing and include the entity/resource to which it applies. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Gets or sets Operation The localized friendly name for the operation, as it should be + * shown to the user. It should be concise (to fit in drop downs) but clear (i.e. self-documenting). It should use + * Title Casing and include the entity/resource to which it applies. + * + * @param operation the operation value to set. + * @return the AvailableProviderOperationDisplay object itself. + */ + public AvailableProviderOperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: Gets or sets Description The localized friendly description for the operation, as + * it should be shown to the user. It should be thorough, yet concise – it will be used in tool tips and detailed + * views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Gets or sets Description The localized friendly description for the operation, as + * it should be shown to the user. It should be thorough, yet concise – it will be used in tool tips and detailed + * views. + * + * @param description the description value to set. + * @return the AvailableProviderOperationDisplay object itself. + */ + public AvailableProviderOperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/AvailableProviderOperations.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/AvailableProviderOperations.java new file mode 100644 index 000000000000..16ae62b98def --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/AvailableProviderOperations.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.AvailableProviderOperationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Class for set of operations used for discovery of available provider operations. */ +@Fluent +public final class AvailableProviderOperations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableProviderOperations.class); + + /* + * List of operations. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link for the next set of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of operations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of operations. + * + * @param value the value value to set. + * @return the AvailableProviderOperations object itself. + */ + public AvailableProviderOperations withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link for the next set of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link for the next set of operations. + * + * @param nextLink the nextLink value to set. + * @return the AvailableProviderOperations object itself. + */ + public AvailableProviderOperations withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/CustomerSecret.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/CustomerSecret.java new file mode 100644 index 000000000000..937ff180f909 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/CustomerSecret.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The pair of customer secret. */ +@Fluent +public final class CustomerSecret { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomerSecret.class); + + /* + * The identifier to the data service input object which this secret + * corresponds to. + */ + @JsonProperty(value = "keyIdentifier", required = true) + private String keyIdentifier; + + /* + * It contains the encrypted customer secret. + */ + @JsonProperty(value = "keyValue", required = true) + private String keyValue; + + /* + * The encryption algorithm used to encrypt data. + */ + @JsonProperty(value = "algorithm", required = true) + private SupportedAlgorithm algorithm; + + /** + * Get the keyIdentifier property: The identifier to the data service input object which this secret corresponds to. + * + * @return the keyIdentifier value. + */ + public String keyIdentifier() { + return this.keyIdentifier; + } + + /** + * Set the keyIdentifier property: The identifier to the data service input object which this secret corresponds to. + * + * @param keyIdentifier the keyIdentifier value to set. + * @return the CustomerSecret object itself. + */ + public CustomerSecret withKeyIdentifier(String keyIdentifier) { + this.keyIdentifier = keyIdentifier; + return this; + } + + /** + * Get the keyValue property: It contains the encrypted customer secret. + * + * @return the keyValue value. + */ + public String keyValue() { + return this.keyValue; + } + + /** + * Set the keyValue property: It contains the encrypted customer secret. + * + * @param keyValue the keyValue value to set. + * @return the CustomerSecret object itself. + */ + public CustomerSecret withKeyValue(String keyValue) { + this.keyValue = keyValue; + return this; + } + + /** + * Get the algorithm property: The encryption algorithm used to encrypt data. + * + * @return the algorithm value. + */ + public SupportedAlgorithm algorithm() { + return this.algorithm; + } + + /** + * Set the algorithm property: The encryption algorithm used to encrypt data. + * + * @param algorithm the algorithm value to set. + * @return the CustomerSecret object itself. + */ + public CustomerSecret withAlgorithm(SupportedAlgorithm algorithm) { + this.algorithm = algorithm; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyIdentifier() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property keyIdentifier in model CustomerSecret")); + } + if (keyValue() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property keyValue in model CustomerSecret")); + } + if (algorithm() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property algorithm in model CustomerSecret")); + } + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataManager.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataManager.java new file mode 100644 index 000000000000..d5e779819064 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataManager.java @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.DataManagerInner; +import java.util.Map; + +/** An immutable client-side representation of DataManager. */ +public interface DataManager { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: Etag of the Resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the sku property: The sku type. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.hybriddatamanager.fluent.models.DataManagerInner object. + * + * @return the inner object. + */ + DataManagerInner innerModel(); + + /** The entirety of the DataManager definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The DataManager definition stages. */ + interface DefinitionStages { + /** The first stage of the DataManager definition. */ + interface Blank extends WithLocation { + } + /** The stage of the DataManager definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the DataManager definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The Resource Group Name. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the DataManager definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithEtag, DefinitionStages.WithSku { + /** + * Executes the create request. + * + * @return the created resource. + */ + DataManager create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DataManager create(Context context); + } + /** The stage of the DataManager definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the DataManager definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Etag of the Resource.. + * + * @param etag Etag of the Resource. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** The stage of the DataManager definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The sku type.. + * + * @param sku The sku type. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + } + /** + * Begins update for the DataManager resource. + * + * @return the stage of resource update. + */ + DataManager.Update update(); + + /** The template for DataManager update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithSku, UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DataManager apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DataManager apply(Context context); + } + /** The DataManager update stages. */ + interface UpdateStages { + /** The stage of the DataManager update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The list of key value pairs that describe the resource. These tags can be + * used in viewing and grouping this resource (across resource groups).. + * + * @param tags The list of key value pairs that describe the resource. These tags can be used in viewing and + * grouping this resource (across resource groups). + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the DataManager update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The sku type.. + * + * @param sku The sku type. + * @return the next definition stage. + */ + Update withSku(Sku sku); + } + /** The stage of the DataManager update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: Defines the If-Match condition. The patch will be performed only if the + * ETag of the data manager resource on the server matches this value.. + * + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the data + * manager resource on the server matches this value. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DataManager refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DataManager refresh(Context context); +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataManagerList.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataManagerList.java new file mode 100644 index 000000000000..3d105b2c92b5 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataManagerList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.DataManagerInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** DataManager resources Collection. */ +@Fluent +public final class DataManagerList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataManagerList.class); + + /* + * List of data manager resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link for the next set of data stores. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of data manager resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of data manager resources. + * + * @param value the value value to set. + * @return the DataManagerList object itself. + */ + public DataManagerList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link for the next set of data stores. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link for the next set of data stores. + * + * @param nextLink the nextLink value to set. + * @return the DataManagerList object itself. + */ + public DataManagerList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataManagerUpdateParameter.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataManagerUpdateParameter.java new file mode 100644 index 000000000000..b58e4d34b0c2 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataManagerUpdateParameter.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The DataManagerUpdateParameter. */ +@Fluent +public final class DataManagerUpdateParameter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataManagerUpdateParameter.class); + + /* + * The sku type. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * The list of key value pairs that describe the resource. These tags can + * be used in viewing and grouping this resource + * (across resource groups). + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the sku property: The sku type. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The sku type. + * + * @param sku the sku value to set. + * @return the DataManagerUpdateParameter object itself. + */ + public DataManagerUpdateParameter withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the tags property: The list of key value pairs that describe the resource. These tags can be used in viewing + * and grouping this resource (across resource groups). + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The list of key value pairs that describe the resource. These tags can be used in viewing + * and grouping this resource (across resource groups). + * + * @param tags the tags value to set. + * @return the DataManagerUpdateParameter object itself. + */ + public DataManagerUpdateParameter withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataManagers.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataManagers.java new file mode 100644 index 000000000000..ff65f0e36da6 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataManagers.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DataManagers. */ +public interface DataManagers { + /** + * Lists all the data manager resources available under the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dataManager resources Collection. + */ + PagedIterable list(); + + /** + * Lists all the data manager resources available under the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dataManager resources Collection. + */ + PagedIterable list(Context context); + + /** + * Lists all the data manager resources available under the given resource group. + * + * @param resourceGroupName The Resource Group Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dataManager resources Collection. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the data manager resources available under the given resource group. + * + * @param resourceGroupName The Resource Group Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dataManager resources Collection. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets information about the specified data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified data manager resource. + */ + DataManager getByResourceGroup(String resourceGroupName, String dataManagerName); + + /** + * Gets information about the specified data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified data manager resource. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String dataManagerName, Context context); + + /** + * Deletes a data manager resource in Microsoft Azure. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String dataManagerName); + + /** + * Deletes a data manager resource in Microsoft Azure. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String dataManagerName, Context context); + + /** + * Gets information about the specified data manager resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified data manager resource. + */ + DataManager getById(String id); + + /** + * Gets information about the specified data manager resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified data manager resource. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a data manager resource in Microsoft Azure. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a data manager resource in Microsoft Azure. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new DataManager resource. + * + * @param name resource name. + * @return the first stage of the new DataManager definition. + */ + DataManager.DefinitionStages.Blank define(String name); +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataService.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataService.java new file mode 100644 index 000000000000..8936d7ebe979 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataService.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.resourcemanager.hybriddatamanager.fluent.models.DataServiceInner; +import java.util.List; + +/** An immutable client-side representation of DataService. */ +public interface DataService { + /** + * Gets the name property: Name of the object. + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: Id of the object. + * + * @return the id value. + */ + String id(); + + /** + * Gets the type property: Type of the object. + * + * @return the type value. + */ + String type(); + + /** + * Gets the state property: State of the data service. + * + * @return the state value. + */ + State state(); + + /** + * Gets the supportedDataSinkTypes property: Supported data store types which can be used as a sink. + * + * @return the supportedDataSinkTypes value. + */ + List supportedDataSinkTypes(); + + /** + * Gets the supportedDataSourceTypes property: Supported data store types which can be used as a source. + * + * @return the supportedDataSourceTypes value. + */ + List supportedDataSourceTypes(); + + /** + * Gets the inner com.azure.resourcemanager.hybriddatamanager.fluent.models.DataServiceInner object. + * + * @return the inner object. + */ + DataServiceInner innerModel(); +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataServiceList.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataServiceList.java new file mode 100644 index 000000000000..dd117f8c591e --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataServiceList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.DataServiceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Data Service Collection. */ +@Fluent +public final class DataServiceList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataServiceList.class); + + /* + * List of data services. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link for the next set of data services. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of data services. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of data services. + * + * @param value the value value to set. + * @return the DataServiceList object itself. + */ + public DataServiceList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link for the next set of data services. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link for the next set of data services. + * + * @param nextLink the nextLink value to set. + * @return the DataServiceList object itself. + */ + public DataServiceList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataServices.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataServices.java new file mode 100644 index 000000000000..943a110ee8f9 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataServices.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DataServices. */ +public interface DataServices { + /** + * This method gets all the data services. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Service Collection. + */ + PagedIterable listByDataManager(String resourceGroupName, String dataManagerName); + + /** + * This method gets all the data services. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Service Collection. + */ + PagedIterable listByDataManager(String resourceGroupName, String dataManagerName, Context context); + + /** + * Gets the data service that matches the data service name given. + * + * @param dataServiceName The name of the data service that is being queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data service that matches the data service name given. + */ + DataService get(String dataServiceName, String resourceGroupName, String dataManagerName); + + /** + * Gets the data service that matches the data service name given. + * + * @param dataServiceName The name of the data service that is being queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data service that matches the data service name given. + */ + Response getWithResponse( + String dataServiceName, String resourceGroupName, String dataManagerName, Context context); +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataStore.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataStore.java new file mode 100644 index 000000000000..e77ccdaecbe4 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataStore.java @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.DataStoreInner; +import java.util.List; + +/** An immutable client-side representation of DataStore. */ +public interface DataStore { + /** + * Gets the name property: Name of the object. + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: Id of the object. + * + * @return the id value. + */ + String id(); + + /** + * Gets the type property: Type of the object. + * + * @return the type value. + */ + String type(); + + /** + * Gets the repositoryId property: Arm Id for the manager resource to which the data source is associated. This is + * optional. + * + * @return the repositoryId value. + */ + String repositoryId(); + + /** + * Gets the state property: State of the data source. + * + * @return the state value. + */ + State state(); + + /** + * Gets the extendedProperties property: A generic json used differently by each data source type. + * + * @return the extendedProperties value. + */ + Object extendedProperties(); + + /** + * Gets the dataStoreTypeId property: The arm id of the data store type. + * + * @return the dataStoreTypeId value. + */ + String dataStoreTypeId(); + + /** + * Gets the customerSecrets property: List of customer secrets containing a key identifier and key value. The key + * identifier is a way for the specific data source to understand the key. Value contains customer secret encrypted + * by the encryptionKeys. + * + * @return the customerSecrets value. + */ + List customerSecrets(); + + /** + * Gets the inner com.azure.resourcemanager.hybriddatamanager.fluent.models.DataStoreInner object. + * + * @return the inner object. + */ + DataStoreInner innerModel(); + + /** The entirety of the DataStore definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithState, + DefinitionStages.WithDataStoreTypeId, + DefinitionStages.WithCreate { + } + /** The DataStore definition stages. */ + interface DefinitionStages { + /** The first stage of the DataStore definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the DataStore definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, dataManagerName. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. + * DataManager names must be between 3 and 24 characters in length and use any alphanumeric and + * underscore only. + * @return the next definition stage. + */ + WithState withExistingDataManager(String resourceGroupName, String dataManagerName); + } + /** The stage of the DataStore definition allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: State of the data source.. + * + * @param state State of the data source. + * @return the next definition stage. + */ + WithDataStoreTypeId withState(State state); + } + /** The stage of the DataStore definition allowing to specify dataStoreTypeId. */ + interface WithDataStoreTypeId { + /** + * Specifies the dataStoreTypeId property: The arm id of the data store type.. + * + * @param dataStoreTypeId The arm id of the data store type. + * @return the next definition stage. + */ + WithCreate withDataStoreTypeId(String dataStoreTypeId); + } + /** + * The stage of the DataStore definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithRepositoryId, + DefinitionStages.WithExtendedProperties, + DefinitionStages.WithCustomerSecrets { + /** + * Executes the create request. + * + * @return the created resource. + */ + DataStore create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DataStore create(Context context); + } + /** The stage of the DataStore definition allowing to specify repositoryId. */ + interface WithRepositoryId { + /** + * Specifies the repositoryId property: Arm Id for the manager resource to which the data source is + * associated. This is optional.. + * + * @param repositoryId Arm Id for the manager resource to which the data source is associated. This is + * optional. + * @return the next definition stage. + */ + WithCreate withRepositoryId(String repositoryId); + } + /** The stage of the DataStore definition allowing to specify extendedProperties. */ + interface WithExtendedProperties { + /** + * Specifies the extendedProperties property: A generic json used differently by each data source type.. + * + * @param extendedProperties A generic json used differently by each data source type. + * @return the next definition stage. + */ + WithCreate withExtendedProperties(Object extendedProperties); + } + /** The stage of the DataStore definition allowing to specify customerSecrets. */ + interface WithCustomerSecrets { + /** + * Specifies the customerSecrets property: List of customer secrets containing a key identifier and key + * value. The key identifier is a way for the specific data source to understand the key. Value contains + * customer secret encrypted by the encryptionKeys.. + * + * @param customerSecrets List of customer secrets containing a key identifier and key value. The key + * identifier is a way for the specific data source to understand the key. Value contains customer + * secret encrypted by the encryptionKeys. + * @return the next definition stage. + */ + WithCreate withCustomerSecrets(List customerSecrets); + } + } + /** + * Begins update for the DataStore resource. + * + * @return the stage of resource update. + */ + DataStore.Update update(); + + /** The template for DataStore update. */ + interface Update + extends UpdateStages.WithRepositoryId, + UpdateStages.WithState, + UpdateStages.WithExtendedProperties, + UpdateStages.WithDataStoreTypeId, + UpdateStages.WithCustomerSecrets { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DataStore apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DataStore apply(Context context); + } + /** The DataStore update stages. */ + interface UpdateStages { + /** The stage of the DataStore update allowing to specify repositoryId. */ + interface WithRepositoryId { + /** + * Specifies the repositoryId property: Arm Id for the manager resource to which the data source is + * associated. This is optional.. + * + * @param repositoryId Arm Id for the manager resource to which the data source is associated. This is + * optional. + * @return the next definition stage. + */ + Update withRepositoryId(String repositoryId); + } + /** The stage of the DataStore update allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: State of the data source.. + * + * @param state State of the data source. + * @return the next definition stage. + */ + Update withState(State state); + } + /** The stage of the DataStore update allowing to specify extendedProperties. */ + interface WithExtendedProperties { + /** + * Specifies the extendedProperties property: A generic json used differently by each data source type.. + * + * @param extendedProperties A generic json used differently by each data source type. + * @return the next definition stage. + */ + Update withExtendedProperties(Object extendedProperties); + } + /** The stage of the DataStore update allowing to specify dataStoreTypeId. */ + interface WithDataStoreTypeId { + /** + * Specifies the dataStoreTypeId property: The arm id of the data store type.. + * + * @param dataStoreTypeId The arm id of the data store type. + * @return the next definition stage. + */ + Update withDataStoreTypeId(String dataStoreTypeId); + } + /** The stage of the DataStore update allowing to specify customerSecrets. */ + interface WithCustomerSecrets { + /** + * Specifies the customerSecrets property: List of customer secrets containing a key identifier and key + * value. The key identifier is a way for the specific data source to understand the key. Value contains + * customer secret encrypted by the encryptionKeys.. + * + * @param customerSecrets List of customer secrets containing a key identifier and key value. The key + * identifier is a way for the specific data source to understand the key. Value contains customer + * secret encrypted by the encryptionKeys. + * @return the next definition stage. + */ + Update withCustomerSecrets(List customerSecrets); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DataStore refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DataStore refresh(Context context); +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataStoreList.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataStoreList.java new file mode 100644 index 000000000000..65d536b52c47 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataStoreList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.DataStoreInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Data Store Collection. */ +@Fluent +public final class DataStoreList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataStoreList.class); + + /* + * List of data stores. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link for the next set of data stores. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of data stores. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of data stores. + * + * @param value the value value to set. + * @return the DataStoreList object itself. + */ + public DataStoreList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link for the next set of data stores. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link for the next set of data stores. + * + * @param nextLink the nextLink value to set. + * @return the DataStoreList object itself. + */ + public DataStoreList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataStoreType.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataStoreType.java new file mode 100644 index 000000000000..c84cf4a0765a --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataStoreType.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.resourcemanager.hybriddatamanager.fluent.models.DataStoreTypeInner; +import java.util.List; + +/** An immutable client-side representation of DataStoreType. */ +public interface DataStoreType { + /** + * Gets the name property: Name of the object. + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: Id of the object. + * + * @return the id value. + */ + String id(); + + /** + * Gets the type property: Type of the object. + * + * @return the type value. + */ + String type(); + + /** + * Gets the repositoryType property: Arm type for the manager resource to which the data source type is associated. + * This is optional. + * + * @return the repositoryType value. + */ + String repositoryType(); + + /** + * Gets the state property: State of the data store type. + * + * @return the state value. + */ + State state(); + + /** + * Gets the supportedDataServicesAsSink property: Supported data services where it can be used as a sink. + * + * @return the supportedDataServicesAsSink value. + */ + List supportedDataServicesAsSink(); + + /** + * Gets the supportedDataServicesAsSource property: Supported data services where it can be used as a source. + * + * @return the supportedDataServicesAsSource value. + */ + List supportedDataServicesAsSource(); + + /** + * Gets the inner com.azure.resourcemanager.hybriddatamanager.fluent.models.DataStoreTypeInner object. + * + * @return the inner object. + */ + DataStoreTypeInner innerModel(); +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataStoreTypeList.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataStoreTypeList.java new file mode 100644 index 000000000000..c341dd9ed53b --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataStoreTypeList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.DataStoreTypeInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Data Store Type Collection. */ +@Fluent +public final class DataStoreTypeList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataStoreTypeList.class); + + /* + * List of DataStoreType. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link for the next set of data store types. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of DataStoreType. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of DataStoreType. + * + * @param value the value value to set. + * @return the DataStoreTypeList object itself. + */ + public DataStoreTypeList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link for the next set of data store types. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link for the next set of data store types. + * + * @param nextLink the nextLink value to set. + * @return the DataStoreTypeList object itself. + */ + public DataStoreTypeList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataStoreTypes.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataStoreTypes.java new file mode 100644 index 000000000000..ee5bbd4db68b --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataStoreTypes.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DataStoreTypes. */ +public interface DataStoreTypes { + /** + * Gets all the data store/repository types that the resource supports. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data store/repository types that the resource supports. + */ + PagedIterable listByDataManager(String resourceGroupName, String dataManagerName); + + /** + * Gets all the data store/repository types that the resource supports. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data store/repository types that the resource supports. + */ + PagedIterable listByDataManager(String resourceGroupName, String dataManagerName, Context context); + + /** + * Gets the data store/repository type given its name. + * + * @param dataStoreTypeName The data store/repository type name for which details are needed. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data store/repository type given its name. + */ + DataStoreType get(String dataStoreTypeName, String resourceGroupName, String dataManagerName); + + /** + * Gets the data store/repository type given its name. + * + * @param dataStoreTypeName The data store/repository type name for which details are needed. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data store/repository type given its name. + */ + Response getWithResponse( + String dataStoreTypeName, String resourceGroupName, String dataManagerName, Context context); +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataStores.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataStores.java new file mode 100644 index 000000000000..6f673e2f8d26 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DataStores.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DataStores. */ +public interface DataStores { + /** + * Gets all the data stores/repositories in the given resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data stores/repositories in the given resource. + */ + PagedIterable listByDataManager(String resourceGroupName, String dataManagerName); + + /** + * Gets all the data stores/repositories in the given resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data stores/repositories in the given resource. + */ + PagedIterable listByDataManager( + String resourceGroupName, String dataManagerName, String filter, Context context); + + /** + * This method gets the data store/repository by name. + * + * @param dataStoreName The data store/repository name queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data store. + */ + DataStore get(String dataStoreName, String resourceGroupName, String dataManagerName); + + /** + * This method gets the data store/repository by name. + * + * @param dataStoreName The data store/repository name queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data store. + */ + Response getWithResponse( + String dataStoreName, String resourceGroupName, String dataManagerName, Context context); + + /** + * This method deletes the given data store/repository. + * + * @param dataStoreName The data store/repository name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String dataStoreName, String resourceGroupName, String dataManagerName); + + /** + * This method deletes the given data store/repository. + * + * @param dataStoreName The data store/repository name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String dataStoreName, String resourceGroupName, String dataManagerName, Context context); + + /** + * This method gets the data store/repository by name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data store. + */ + DataStore getById(String id); + + /** + * This method gets the data store/repository by name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data store. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * This method deletes the given data store/repository. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * This method deletes the given data store/repository. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new DataStore resource. + * + * @param name resource name. + * @return the first stage of the new DataStore definition. + */ + DataStore.DefinitionStages.Blank define(String name); +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DmsBaseObject.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DmsBaseObject.java new file mode 100644 index 000000000000..d51c6573242c --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/DmsBaseObject.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Base class for all objects under DataManager Service. */ +@Immutable +public class DmsBaseObject { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DmsBaseObject.class); + + /* + * Name of the object. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Id of the object. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Type of the object. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get the name property: Name of the object. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the id property: Id of the object. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the type property: Type of the object. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/Error.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/Error.java new file mode 100644 index 000000000000..946e4818e9f9 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/Error.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Top level error for the job. */ +@Fluent +public final class Error { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Error.class); + + /* + * Error code that can be used to programmatically identify the error. + */ + @JsonProperty(value = "code", required = true) + private String code; + + /* + * Describes the error in detail and provides debugging information. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the code property: Error code that can be used to programmatically identify the error. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: Error code that can be used to programmatically identify the error. + * + * @param code the code value to set. + * @return the Error object itself. + */ + public Error withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message property: Describes the error in detail and provides debugging information. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Describes the error in detail and provides debugging information. + * + * @param message the message value to set. + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (code() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property code in model Error")); + } + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/ErrorDetails.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/ErrorDetails.java new file mode 100644 index 000000000000..3e71565739b4 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/ErrorDetails.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Error Details. */ +@Fluent +public final class ErrorDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ErrorDetails.class); + + /* + * Error message. + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /* + * Error code. + */ + @JsonProperty(value = "errorCode") + private Integer errorCode; + + /* + * Recommended action for the error. + */ + @JsonProperty(value = "recommendedAction") + private String recommendedAction; + + /* + * Contains the non localized exception message + */ + @JsonProperty(value = "exceptionMessage") + private String exceptionMessage; + + /** + * Get the errorMessage property: Error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: Error message. + * + * @param errorMessage the errorMessage value to set. + * @return the ErrorDetails object itself. + */ + public ErrorDetails withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get the errorCode property: Error code. + * + * @return the errorCode value. + */ + public Integer errorCode() { + return this.errorCode; + } + + /** + * Set the errorCode property: Error code. + * + * @param errorCode the errorCode value to set. + * @return the ErrorDetails object itself. + */ + public ErrorDetails withErrorCode(Integer errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Get the recommendedAction property: Recommended action for the error. + * + * @return the recommendedAction value. + */ + public String recommendedAction() { + return this.recommendedAction; + } + + /** + * Set the recommendedAction property: Recommended action for the error. + * + * @param recommendedAction the recommendedAction value to set. + * @return the ErrorDetails object itself. + */ + public ErrorDetails withRecommendedAction(String recommendedAction) { + this.recommendedAction = recommendedAction; + return this; + } + + /** + * Get the exceptionMessage property: Contains the non localized exception message. + * + * @return the exceptionMessage value. + */ + public String exceptionMessage() { + return this.exceptionMessage; + } + + /** + * Set the exceptionMessage property: Contains the non localized exception message. + * + * @param exceptionMessage the exceptionMessage value to set. + * @return the ErrorDetails object itself. + */ + public ErrorDetails withExceptionMessage(String exceptionMessage) { + this.exceptionMessage = exceptionMessage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/IsJobCancellable.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/IsJobCancellable.java new file mode 100644 index 000000000000..0ecf2a60f922 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/IsJobCancellable.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for IsJobCancellable. */ +public enum IsJobCancellable { + /** Enum value NotCancellable. */ + NOT_CANCELLABLE("NotCancellable"), + + /** Enum value Cancellable. */ + CANCELLABLE("Cancellable"); + + /** The actual serialized value for a IsJobCancellable instance. */ + private final String value; + + IsJobCancellable(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a IsJobCancellable instance. + * + * @param value the serialized value to parse. + * @return the parsed IsJobCancellable object, or null if unable to parse. + */ + @JsonCreator + public static IsJobCancellable fromString(String value) { + IsJobCancellable[] items = IsJobCancellable.values(); + for (IsJobCancellable item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/Job.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/Job.java new file mode 100644 index 000000000000..a03a6e38ca08 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/Job.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.resourcemanager.hybriddatamanager.fluent.models.JobInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of Job. */ +public interface Job { + /** + * Gets the name property: Name of the object. + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: Id of the object. + * + * @return the id value. + */ + String id(); + + /** + * Gets the type property: Type of the object. + * + * @return the type value. + */ + String type(); + + /** + * Gets the status property: Status of the job. + * + * @return the status value. + */ + JobStatus status(); + + /** + * Gets the startTime property: Time at which the job was started in UTC ISO 8601 format. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: Time at which the job ended in UTC ISO 8601 format. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the error property: Top level error for the job. + * + * @return the error value. + */ + Error error(); + + /** + * Gets the isCancellable property: Describes whether the job is cancellable. + * + * @return the isCancellable value. + */ + IsJobCancellable isCancellable(); + + /** + * Gets the bytesProcessed property: Number of bytes processed by the job as of now. + * + * @return the bytesProcessed value. + */ + Long bytesProcessed(); + + /** + * Gets the itemsProcessed property: Number of items processed by the job as of now. + * + * @return the itemsProcessed value. + */ + Long itemsProcessed(); + + /** + * Gets the totalBytesToProcess property: Number of bytes to be processed by the job in total. + * + * @return the totalBytesToProcess value. + */ + Long totalBytesToProcess(); + + /** + * Gets the totalItemsToProcess property: Number of items to be processed by the job in total. + * + * @return the totalItemsToProcess value. + */ + Long totalItemsToProcess(); + + /** + * Gets the details property: Details of a job run. This field will only be sent for expand details filter. + * + * @return the details value. + */ + JobDetails details(); + + /** + * Gets the dataSourceName property: Name of the data source on which the job was triggered. + * + * @return the dataSourceName value. + */ + String dataSourceName(); + + /** + * Gets the dataSinkName property: Name of the data sink on which the job was triggered. + * + * @return the dataSinkName value. + */ + String dataSinkName(); + + /** + * Gets the inner com.azure.resourcemanager.hybriddatamanager.fluent.models.JobInner object. + * + * @return the inner object. + */ + JobInner innerModel(); +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/JobDefinition.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/JobDefinition.java new file mode 100644 index 000000000000..b16f9c9de046 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/JobDefinition.java @@ -0,0 +1,427 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.JobDefinitionInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of JobDefinition. */ +public interface JobDefinition { + /** + * Gets the name property: Name of the object. + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: Id of the object. + * + * @return the id value. + */ + String id(); + + /** + * Gets the type property: Type of the object. + * + * @return the type value. + */ + String type(); + + /** + * Gets the dataSourceId property: Data Source Id associated to the job definition. + * + * @return the dataSourceId value. + */ + String dataSourceId(); + + /** + * Gets the dataSinkId property: Data Sink Id associated to the job definition. + * + * @return the dataSinkId value. + */ + String dataSinkId(); + + /** + * Gets the schedules property: Schedule for running the job definition. + * + * @return the schedules value. + */ + List schedules(); + + /** + * Gets the state property: State of the job definition. + * + * @return the state value. + */ + State state(); + + /** + * Gets the lastModifiedTime property: Last modified time of the job definition. + * + * @return the lastModifiedTime value. + */ + OffsetDateTime lastModifiedTime(); + + /** + * Gets the runLocation property: This is the preferred geo location for the job to run. + * + * @return the runLocation value. + */ + RunLocation runLocation(); + + /** + * Gets the userConfirmation property: Enum to detect if user confirmation is required. If not passed will default + * to NotRequired. + * + * @return the userConfirmation value. + */ + UserConfirmation userConfirmation(); + + /** + * Gets the dataServiceInput property: A generic json used differently by each data service type. + * + * @return the dataServiceInput value. + */ + Object dataServiceInput(); + + /** + * Gets the customerSecrets property: List of customer secrets containing a key identifier and key value. The key + * identifier is a way for the specific data source to understand the key. Value contains customer secret encrypted + * by the encryptionKeys. + * + * @return the customerSecrets value. + */ + List customerSecrets(); + + /** + * Gets the inner com.azure.resourcemanager.hybriddatamanager.fluent.models.JobDefinitionInner object. + * + * @return the inner object. + */ + JobDefinitionInner innerModel(); + + /** The entirety of the JobDefinition definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithDataSourceId, + DefinitionStages.WithDataSinkId, + DefinitionStages.WithState, + DefinitionStages.WithCreate { + } + /** The JobDefinition definition stages. */ + interface DefinitionStages { + /** The first stage of the JobDefinition definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the JobDefinition definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies dataServiceName, resourceGroupName, dataManagerName. + * + * @param dataServiceName The data service type of the job definition. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. + * DataManager names must be between 3 and 24 characters in length and use any alphanumeric and + * underscore only. + * @return the next definition stage. + */ + WithDataSourceId withExistingDataService( + String dataServiceName, String resourceGroupName, String dataManagerName); + } + /** The stage of the JobDefinition definition allowing to specify dataSourceId. */ + interface WithDataSourceId { + /** + * Specifies the dataSourceId property: Data Source Id associated to the job definition.. + * + * @param dataSourceId Data Source Id associated to the job definition. + * @return the next definition stage. + */ + WithDataSinkId withDataSourceId(String dataSourceId); + } + /** The stage of the JobDefinition definition allowing to specify dataSinkId. */ + interface WithDataSinkId { + /** + * Specifies the dataSinkId property: Data Sink Id associated to the job definition.. + * + * @param dataSinkId Data Sink Id associated to the job definition. + * @return the next definition stage. + */ + WithState withDataSinkId(String dataSinkId); + } + /** The stage of the JobDefinition definition allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: State of the job definition.. + * + * @param state State of the job definition. + * @return the next definition stage. + */ + WithCreate withState(State state); + } + /** + * The stage of the JobDefinition definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithSchedules, + DefinitionStages.WithLastModifiedTime, + DefinitionStages.WithRunLocation, + DefinitionStages.WithUserConfirmation, + DefinitionStages.WithDataServiceInput, + DefinitionStages.WithCustomerSecrets { + /** + * Executes the create request. + * + * @return the created resource. + */ + JobDefinition create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + JobDefinition create(Context context); + } + /** The stage of the JobDefinition definition allowing to specify schedules. */ + interface WithSchedules { + /** + * Specifies the schedules property: Schedule for running the job definition. + * + * @param schedules Schedule for running the job definition. + * @return the next definition stage. + */ + WithCreate withSchedules(List schedules); + } + /** The stage of the JobDefinition definition allowing to specify lastModifiedTime. */ + interface WithLastModifiedTime { + /** + * Specifies the lastModifiedTime property: Last modified time of the job definition.. + * + * @param lastModifiedTime Last modified time of the job definition. + * @return the next definition stage. + */ + WithCreate withLastModifiedTime(OffsetDateTime lastModifiedTime); + } + /** The stage of the JobDefinition definition allowing to specify runLocation. */ + interface WithRunLocation { + /** + * Specifies the runLocation property: This is the preferred geo location for the job to run.. + * + * @param runLocation This is the preferred geo location for the job to run. + * @return the next definition stage. + */ + WithCreate withRunLocation(RunLocation runLocation); + } + /** The stage of the JobDefinition definition allowing to specify userConfirmation. */ + interface WithUserConfirmation { + /** + * Specifies the userConfirmation property: Enum to detect if user confirmation is required. If not passed + * will default to NotRequired.. + * + * @param userConfirmation Enum to detect if user confirmation is required. If not passed will default to + * NotRequired. + * @return the next definition stage. + */ + WithCreate withUserConfirmation(UserConfirmation userConfirmation); + } + /** The stage of the JobDefinition definition allowing to specify dataServiceInput. */ + interface WithDataServiceInput { + /** + * Specifies the dataServiceInput property: A generic json used differently by each data service type.. + * + * @param dataServiceInput A generic json used differently by each data service type. + * @return the next definition stage. + */ + WithCreate withDataServiceInput(Object dataServiceInput); + } + /** The stage of the JobDefinition definition allowing to specify customerSecrets. */ + interface WithCustomerSecrets { + /** + * Specifies the customerSecrets property: List of customer secrets containing a key identifier and key + * value. The key identifier is a way for the specific data source to understand the key. Value contains + * customer secret encrypted by the encryptionKeys.. + * + * @param customerSecrets List of customer secrets containing a key identifier and key value. The key + * identifier is a way for the specific data source to understand the key. Value contains customer + * secret encrypted by the encryptionKeys. + * @return the next definition stage. + */ + WithCreate withCustomerSecrets(List customerSecrets); + } + } + /** + * Begins update for the JobDefinition resource. + * + * @return the stage of resource update. + */ + JobDefinition.Update update(); + + /** The template for JobDefinition update. */ + interface Update + extends UpdateStages.WithDataSourceId, + UpdateStages.WithDataSinkId, + UpdateStages.WithSchedules, + UpdateStages.WithState, + UpdateStages.WithLastModifiedTime, + UpdateStages.WithRunLocation, + UpdateStages.WithUserConfirmation, + UpdateStages.WithDataServiceInput, + UpdateStages.WithCustomerSecrets { + /** + * Executes the update request. + * + * @return the updated resource. + */ + JobDefinition apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + JobDefinition apply(Context context); + } + /** The JobDefinition update stages. */ + interface UpdateStages { + /** The stage of the JobDefinition update allowing to specify dataSourceId. */ + interface WithDataSourceId { + /** + * Specifies the dataSourceId property: Data Source Id associated to the job definition.. + * + * @param dataSourceId Data Source Id associated to the job definition. + * @return the next definition stage. + */ + Update withDataSourceId(String dataSourceId); + } + /** The stage of the JobDefinition update allowing to specify dataSinkId. */ + interface WithDataSinkId { + /** + * Specifies the dataSinkId property: Data Sink Id associated to the job definition.. + * + * @param dataSinkId Data Sink Id associated to the job definition. + * @return the next definition stage. + */ + Update withDataSinkId(String dataSinkId); + } + /** The stage of the JobDefinition update allowing to specify schedules. */ + interface WithSchedules { + /** + * Specifies the schedules property: Schedule for running the job definition. + * + * @param schedules Schedule for running the job definition. + * @return the next definition stage. + */ + Update withSchedules(List schedules); + } + /** The stage of the JobDefinition update allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: State of the job definition.. + * + * @param state State of the job definition. + * @return the next definition stage. + */ + Update withState(State state); + } + /** The stage of the JobDefinition update allowing to specify lastModifiedTime. */ + interface WithLastModifiedTime { + /** + * Specifies the lastModifiedTime property: Last modified time of the job definition.. + * + * @param lastModifiedTime Last modified time of the job definition. + * @return the next definition stage. + */ + Update withLastModifiedTime(OffsetDateTime lastModifiedTime); + } + /** The stage of the JobDefinition update allowing to specify runLocation. */ + interface WithRunLocation { + /** + * Specifies the runLocation property: This is the preferred geo location for the job to run.. + * + * @param runLocation This is the preferred geo location for the job to run. + * @return the next definition stage. + */ + Update withRunLocation(RunLocation runLocation); + } + /** The stage of the JobDefinition update allowing to specify userConfirmation. */ + interface WithUserConfirmation { + /** + * Specifies the userConfirmation property: Enum to detect if user confirmation is required. If not passed + * will default to NotRequired.. + * + * @param userConfirmation Enum to detect if user confirmation is required. If not passed will default to + * NotRequired. + * @return the next definition stage. + */ + Update withUserConfirmation(UserConfirmation userConfirmation); + } + /** The stage of the JobDefinition update allowing to specify dataServiceInput. */ + interface WithDataServiceInput { + /** + * Specifies the dataServiceInput property: A generic json used differently by each data service type.. + * + * @param dataServiceInput A generic json used differently by each data service type. + * @return the next definition stage. + */ + Update withDataServiceInput(Object dataServiceInput); + } + /** The stage of the JobDefinition update allowing to specify customerSecrets. */ + interface WithCustomerSecrets { + /** + * Specifies the customerSecrets property: List of customer secrets containing a key identifier and key + * value. The key identifier is a way for the specific data source to understand the key. Value contains + * customer secret encrypted by the encryptionKeys.. + * + * @param customerSecrets List of customer secrets containing a key identifier and key value. The key + * identifier is a way for the specific data source to understand the key. Value contains customer + * secret encrypted by the encryptionKeys. + * @return the next definition stage. + */ + Update withCustomerSecrets(List customerSecrets); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + JobDefinition refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + JobDefinition refresh(Context context); + + /** + * This method runs a job instance of the given job definition. + * + * @param runParameters Run time parameters for the job definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void run(RunParameters runParameters); + + /** + * This method runs a job instance of the given job definition. + * + * @param runParameters Run time parameters for the job definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void run(RunParameters runParameters, Context context); +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/JobDefinitionList.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/JobDefinitionList.java new file mode 100644 index 000000000000..6e29803334f2 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/JobDefinitionList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.JobDefinitionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Job Definition Collection. */ +@Fluent +public final class JobDefinitionList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobDefinitionList.class); + + /* + * List of job definitions. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link for the next set of job definitions. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of job definitions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of job definitions. + * + * @param value the value value to set. + * @return the JobDefinitionList object itself. + */ + public JobDefinitionList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link for the next set of job definitions. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link for the next set of job definitions. + * + * @param nextLink the nextLink value to set. + * @return the JobDefinitionList object itself. + */ + public JobDefinitionList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/JobDefinitions.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/JobDefinitions.java new file mode 100644 index 000000000000..727bbe2deb06 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/JobDefinitions.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of JobDefinitions. */ +public interface JobDefinitions { + /** + * This method gets all the job definitions of the given data service name. + * + * @param dataServiceName The data service type of interest. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition Collection. + */ + PagedIterable listByDataService( + String dataServiceName, String resourceGroupName, String dataManagerName); + + /** + * This method gets all the job definitions of the given data service name. + * + * @param dataServiceName The data service type of interest. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition Collection. + */ + PagedIterable listByDataService( + String dataServiceName, String resourceGroupName, String dataManagerName, String filter, Context context); + + /** + * This method gets job definition object by name. + * + * @param dataServiceName The data service name of the job definition. + * @param jobDefinitionName The job definition name that is being queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition. + */ + JobDefinition get( + String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName); + + /** + * This method gets job definition object by name. + * + * @param dataServiceName The data service name of the job definition. + * @param jobDefinitionName The job definition name that is being queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition. + */ + Response getWithResponse( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + Context context); + + /** + * This method deletes the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName); + + /** + * This method deletes the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be deleted. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + Context context); + + /** + * This method runs a job instance of the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName Name of the job definition. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param runParameters Run time parameters for the job definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void run( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + RunParameters runParameters); + + /** + * This method runs a job instance of the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName Name of the job definition. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param runParameters Run time parameters for the job definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void run( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + RunParameters runParameters, + Context context); + + /** + * This method gets all the job definitions of the given data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition Collection. + */ + PagedIterable listByDataManager(String resourceGroupName, String dataManagerName); + + /** + * This method gets all the job definitions of the given data manager resource. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition Collection. + */ + PagedIterable listByDataManager( + String resourceGroupName, String dataManagerName, String filter, Context context); + + /** + * This method gets job definition object by name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition. + */ + JobDefinition getById(String id); + + /** + * This method gets job definition object by name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Definition. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * This method deletes the given job definition. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * This method deletes the given job definition. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new JobDefinition resource. + * + * @param name resource name. + * @return the first stage of the new JobDefinition definition. + */ + JobDefinition.DefinitionStages.Blank define(String name); +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/JobDetails.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/JobDetails.java new file mode 100644 index 000000000000..8e83582bb473 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/JobDetails.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.resourcemanager.hybriddatamanager.fluent.models.JobDetailsInner; +import java.util.List; + +/** An immutable client-side representation of JobDetails. */ +public interface JobDetails { + /** + * Gets the jobStages property: List of stages that ran in the job. + * + * @return the jobStages value. + */ + List jobStages(); + + /** + * Gets the jobDefinition property: JobDefinition at the time of the run. + * + * @return the jobDefinition value. + */ + JobDefinition jobDefinition(); + + /** + * Gets the errorDetails property: Error details for failure. This is optional. + * + * @return the errorDetails value. + */ + List errorDetails(); + + /** + * Gets the itemDetailsLink property: Item Details Link to download files or see details. + * + * @return the itemDetailsLink value. + */ + String itemDetailsLink(); + + /** + * Gets the inner com.azure.resourcemanager.hybriddatamanager.fluent.models.JobDetailsInner object. + * + * @return the inner object. + */ + JobDetailsInner innerModel(); +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/JobList.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/JobList.java new file mode 100644 index 000000000000..7cc8795f46ad --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/JobList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.JobInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Job Collection. */ +@Fluent +public final class JobList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobList.class); + + /* + * List of jobs. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link for the next set of jobs. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of jobs. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of jobs. + * + * @param value the value value to set. + * @return the JobList object itself. + */ + public JobList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link for the next set of jobs. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link for the next set of jobs. + * + * @param nextLink the nextLink value to set. + * @return the JobList object itself. + */ + public JobList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/JobStages.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/JobStages.java new file mode 100644 index 000000000000..94d44d241f4d --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/JobStages.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Job stages. */ +@Fluent +public final class JobStages { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobStages.class); + + /* + * Name of the job stage. + */ + @JsonProperty(value = "stageName") + private String stageName; + + /* + * Status of the job stage. + */ + @JsonProperty(value = "stageStatus", required = true) + private JobStatus stageStatus; + + /* + * Job Stage Details + */ + @JsonProperty(value = "jobStageDetails") + private Object jobStageDetails; + + /* + * Error details for the stage. This is optional + */ + @JsonProperty(value = "errorDetails") + private List errorDetails; + + /** + * Get the stageName property: Name of the job stage. + * + * @return the stageName value. + */ + public String stageName() { + return this.stageName; + } + + /** + * Set the stageName property: Name of the job stage. + * + * @param stageName the stageName value to set. + * @return the JobStages object itself. + */ + public JobStages withStageName(String stageName) { + this.stageName = stageName; + return this; + } + + /** + * Get the stageStatus property: Status of the job stage. + * + * @return the stageStatus value. + */ + public JobStatus stageStatus() { + return this.stageStatus; + } + + /** + * Set the stageStatus property: Status of the job stage. + * + * @param stageStatus the stageStatus value to set. + * @return the JobStages object itself. + */ + public JobStages withStageStatus(JobStatus stageStatus) { + this.stageStatus = stageStatus; + return this; + } + + /** + * Get the jobStageDetails property: Job Stage Details. + * + * @return the jobStageDetails value. + */ + public Object jobStageDetails() { + return this.jobStageDetails; + } + + /** + * Set the jobStageDetails property: Job Stage Details. + * + * @param jobStageDetails the jobStageDetails value to set. + * @return the JobStages object itself. + */ + public JobStages withJobStageDetails(Object jobStageDetails) { + this.jobStageDetails = jobStageDetails; + return this; + } + + /** + * Get the errorDetails property: Error details for the stage. This is optional. + * + * @return the errorDetails value. + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Set the errorDetails property: Error details for the stage. This is optional. + * + * @param errorDetails the errorDetails value to set. + * @return the JobStages object itself. + */ + public JobStages withErrorDetails(List errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (stageStatus() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property stageStatus in model JobStages")); + } + if (errorDetails() != null) { + errorDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/JobStatus.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/JobStatus.java new file mode 100644 index 000000000000..6d7730ab0547 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/JobStatus.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for JobStatus. */ +public enum JobStatus { + /** Enum value None. */ + NONE("None"), + + /** Enum value InProgress. */ + IN_PROGRESS("InProgress"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value WaitingForAction. */ + WAITING_FOR_ACTION("WaitingForAction"), + + /** Enum value Failed. */ + FAILED("Failed"), + + /** Enum value Cancelled. */ + CANCELLED("Cancelled"), + + /** Enum value Cancelling. */ + CANCELLING("Cancelling"), + + /** Enum value PartiallySucceeded. */ + PARTIALLY_SUCCEEDED("PartiallySucceeded"); + + /** The actual serialized value for a JobStatus instance. */ + private final String value; + + JobStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a JobStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed JobStatus object, or null if unable to parse. + */ + @JsonCreator + public static JobStatus fromString(String value) { + JobStatus[] items = JobStatus.values(); + for (JobStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/Jobs.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/Jobs.java new file mode 100644 index 000000000000..e1aaebaaf144 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/Jobs.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Jobs. */ +public interface Jobs { + /** + * This method gets all the jobs of a given job definition. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition for which jobs are needed. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + PagedIterable listByJobDefinition( + String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName); + + /** + * This method gets all the jobs of a given job definition. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition for which jobs are needed. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + PagedIterable listByJobDefinition( + String dataServiceName, + String jobDefinitionName, + String resourceGroupName, + String dataManagerName, + String filter, + Context context); + + /** + * This method gets a data manager job given the jobId. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data service job. + */ + Job get( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName); + + /** + * This method gets a data manager job given the jobId. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param expand $expand is supported on details parameter for job, which provides details on the job stages. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data service job. + */ + Response getWithResponse( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName, + String expand, + Context context); + + /** + * Cancels the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName); + + /** + * Cancels the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName, + Context context); + + /** + * Resumes the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resume( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName); + + /** + * Resumes the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resume( + String dataServiceName, + String jobDefinitionName, + String jobId, + String resourceGroupName, + String dataManagerName, + Context context); + + /** + * This method gets all the jobs of a data service type in a given resource. + * + * @param dataServiceName The name of the data service of interest. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + PagedIterable listByDataService(String dataServiceName, String resourceGroupName, String dataManagerName); + + /** + * This method gets all the jobs of a data service type in a given resource. + * + * @param dataServiceName The name of the data service of interest. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + PagedIterable listByDataService( + String dataServiceName, String resourceGroupName, String dataManagerName, String filter, Context context); + + /** + * This method gets all the jobs at the data manager resource level. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + PagedIterable listByDataManager(String resourceGroupName, String dataManagerName); + + /** + * This method gets all the jobs at the data manager resource level. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param filter OData Filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return job Collection. + */ + PagedIterable listByDataManager( + String resourceGroupName, String dataManagerName, String filter, Context context); +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/Key.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/Key.java new file mode 100644 index 000000000000..83d55835d31c --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/Key.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Encryption Key. */ +@Fluent +public final class Key { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Key.class); + + /* + * Modulus of the encryption key. + */ + @JsonProperty(value = "keyModulus", required = true) + private String keyModulus; + + /* + * Exponent of the encryption key. + */ + @JsonProperty(value = "keyExponent", required = true) + private String keyExponent; + + /* + * The maximum byte size that can be encrypted by the key. For a key size + * larger than the size, break into chunks and encrypt each chunk, append + * each encrypted chunk with : to mark the end of the chunk. + */ + @JsonProperty(value = "encryptionChunkSizeInBytes", required = true) + private int encryptionChunkSizeInBytes; + + /** + * Get the keyModulus property: Modulus of the encryption key. + * + * @return the keyModulus value. + */ + public String keyModulus() { + return this.keyModulus; + } + + /** + * Set the keyModulus property: Modulus of the encryption key. + * + * @param keyModulus the keyModulus value to set. + * @return the Key object itself. + */ + public Key withKeyModulus(String keyModulus) { + this.keyModulus = keyModulus; + return this; + } + + /** + * Get the keyExponent property: Exponent of the encryption key. + * + * @return the keyExponent value. + */ + public String keyExponent() { + return this.keyExponent; + } + + /** + * Set the keyExponent property: Exponent of the encryption key. + * + * @param keyExponent the keyExponent value to set. + * @return the Key object itself. + */ + public Key withKeyExponent(String keyExponent) { + this.keyExponent = keyExponent; + return this; + } + + /** + * Get the encryptionChunkSizeInBytes property: The maximum byte size that can be encrypted by the key. For a key + * size larger than the size, break into chunks and encrypt each chunk, append each encrypted chunk with : to mark + * the end of the chunk. + * + * @return the encryptionChunkSizeInBytes value. + */ + public int encryptionChunkSizeInBytes() { + return this.encryptionChunkSizeInBytes; + } + + /** + * Set the encryptionChunkSizeInBytes property: The maximum byte size that can be encrypted by the key. For a key + * size larger than the size, break into chunks and encrypt each chunk, append each encrypted chunk with : to mark + * the end of the chunk. + * + * @param encryptionChunkSizeInBytes the encryptionChunkSizeInBytes value to set. + * @return the Key object itself. + */ + public Key withEncryptionChunkSizeInBytes(int encryptionChunkSizeInBytes) { + this.encryptionChunkSizeInBytes = encryptionChunkSizeInBytes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyModulus() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property keyModulus in model Key")); + } + if (keyExponent() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property keyExponent in model Key")); + } + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/Operations.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/Operations.java new file mode 100644 index 000000000000..f0b6aa6b4454 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * The list of operations for Microsoft.HybridData provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class for set of operations used for discovery of available provider operations. + */ + PagedIterable list(); + + /** + * The list of operations for Microsoft.HybridData provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class for set of operations used for discovery of available provider operations. + */ + PagedIterable list(Context context); +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/PublicKey.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/PublicKey.java new file mode 100644 index 000000000000..c29c9aed7052 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/PublicKey.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.resourcemanager.hybriddatamanager.fluent.models.PublicKeyInner; + +/** An immutable client-side representation of PublicKey. */ +public interface PublicKey { + /** + * Gets the name property: Name of the object. + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: Id of the object. + * + * @return the id value. + */ + String id(); + + /** + * Gets the type property: Type of the object. + * + * @return the type value. + */ + String type(); + + /** + * Gets the dataServiceLevel1Key property: Level one public key for encryption. + * + * @return the dataServiceLevel1Key value. + */ + Key dataServiceLevel1Key(); + + /** + * Gets the dataServiceLevel2Key property: Level two public key for encryption. + * + * @return the dataServiceLevel2Key value. + */ + Key dataServiceLevel2Key(); + + /** + * Gets the inner com.azure.resourcemanager.hybriddatamanager.fluent.models.PublicKeyInner object. + * + * @return the inner object. + */ + PublicKeyInner innerModel(); +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/PublicKeyList.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/PublicKeyList.java new file mode 100644 index 000000000000..20e7d6f27bcd --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/PublicKeyList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybriddatamanager.fluent.models.PublicKeyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** PublicKey Collection. */ +@Fluent +public final class PublicKeyList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicKeyList.class); + + /* + * List of public keys. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link for the next set of public keys. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of public keys. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of public keys. + * + * @param value the value value to set. + * @return the PublicKeyList object itself. + */ + public PublicKeyList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link for the next set of public keys. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link for the next set of public keys. + * + * @param nextLink the nextLink value to set. + * @return the PublicKeyList object itself. + */ + public PublicKeyList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/PublicKeys.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/PublicKeys.java new file mode 100644 index 000000000000..23a2657fb52a --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/PublicKeys.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PublicKeys. */ +public interface PublicKeys { + /** + * This method gets the list view of public keys, however it will only have one element. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publicKey Collection. + */ + PagedIterable listByDataManager(String resourceGroupName, String dataManagerName); + + /** + * This method gets the list view of public keys, however it will only have one element. + * + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publicKey Collection. + */ + PagedIterable listByDataManager(String resourceGroupName, String dataManagerName, Context context); + + /** + * This method gets the public keys. + * + * @param publicKeyName Name of the public key. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public key. + */ + PublicKey get(String publicKeyName, String resourceGroupName, String dataManagerName); + + /** + * This method gets the public keys. + * + * @param publicKeyName Name of the public key. + * @param resourceGroupName The Resource Group Name. + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager + * names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public key. + */ + Response getWithResponse( + String publicKeyName, String resourceGroupName, String dataManagerName, Context context); +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/RunLocation.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/RunLocation.java new file mode 100644 index 000000000000..3582ede0ef61 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/RunLocation.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for RunLocation. */ +public enum RunLocation { + /** Enum value none. */ + NONE("none"), + + /** Enum value australiaeast. */ + AUSTRALIAEAST("australiaeast"), + + /** Enum value australiasoutheast. */ + AUSTRALIASOUTHEAST("australiasoutheast"), + + /** Enum value brazilsouth. */ + BRAZILSOUTH("brazilsouth"), + + /** Enum value canadacentral. */ + CANADACENTRAL("canadacentral"), + + /** Enum value canadaeast. */ + CANADAEAST("canadaeast"), + + /** Enum value centralindia. */ + CENTRALINDIA("centralindia"), + + /** Enum value centralus. */ + CENTRALUS("centralus"), + + /** Enum value eastasia. */ + EASTASIA("eastasia"), + + /** Enum value eastus. */ + EASTUS("eastus"), + + /** Enum value eastus2. */ + EASTUS2("eastus2"), + + /** Enum value japaneast. */ + JAPANEAST("japaneast"), + + /** Enum value japanwest. */ + JAPANWEST("japanwest"), + + /** Enum value koreacentral. */ + KOREACENTRAL("koreacentral"), + + /** Enum value koreasouth. */ + KOREASOUTH("koreasouth"), + + /** Enum value southeastasia. */ + SOUTHEASTASIA("southeastasia"), + + /** Enum value southcentralus. */ + SOUTHCENTRALUS("southcentralus"), + + /** Enum value southindia. */ + SOUTHINDIA("southindia"), + + /** Enum value northcentralus. */ + NORTHCENTRALUS("northcentralus"), + + /** Enum value northeurope. */ + NORTHEUROPE("northeurope"), + + /** Enum value uksouth. */ + UKSOUTH("uksouth"), + + /** Enum value ukwest. */ + UKWEST("ukwest"), + + /** Enum value westcentralus. */ + WESTCENTRALUS("westcentralus"), + + /** Enum value westeurope. */ + WESTEUROPE("westeurope"), + + /** Enum value westindia. */ + WESTINDIA("westindia"), + + /** Enum value westus. */ + WESTUS("westus"), + + /** Enum value westus2. */ + WESTUS2("westus2"); + + /** The actual serialized value for a RunLocation instance. */ + private final String value; + + RunLocation(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a RunLocation instance. + * + * @param value the serialized value to parse. + * @return the parsed RunLocation object, or null if unable to parse. + */ + @JsonCreator + public static RunLocation fromString(String value) { + RunLocation[] items = RunLocation.values(); + for (RunLocation item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/RunParameters.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/RunParameters.java new file mode 100644 index 000000000000..ab79bda859e3 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/RunParameters.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Run parameters for a job. */ +@Fluent +public final class RunParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RunParameters.class); + + /* + * Enum to detect if user confirmation is required. If not passed will + * default to NotRequired. + */ + @JsonProperty(value = "userConfirmation") + private UserConfirmation userConfirmation; + + /* + * A generic json used differently by each data service type. + */ + @JsonProperty(value = "dataServiceInput") + private Object dataServiceInput; + + /* + * List of customer secrets containing a key identifier and key value. The + * key identifier is a way for the specific data source to understand the + * key. Value contains customer secret encrypted by the encryptionKeys. + */ + @JsonProperty(value = "customerSecrets") + private List customerSecrets; + + /** + * Get the userConfirmation property: Enum to detect if user confirmation is required. If not passed will default to + * NotRequired. + * + * @return the userConfirmation value. + */ + public UserConfirmation userConfirmation() { + return this.userConfirmation; + } + + /** + * Set the userConfirmation property: Enum to detect if user confirmation is required. If not passed will default to + * NotRequired. + * + * @param userConfirmation the userConfirmation value to set. + * @return the RunParameters object itself. + */ + public RunParameters withUserConfirmation(UserConfirmation userConfirmation) { + this.userConfirmation = userConfirmation; + return this; + } + + /** + * Get the dataServiceInput property: A generic json used differently by each data service type. + * + * @return the dataServiceInput value. + */ + public Object dataServiceInput() { + return this.dataServiceInput; + } + + /** + * Set the dataServiceInput property: A generic json used differently by each data service type. + * + * @param dataServiceInput the dataServiceInput value to set. + * @return the RunParameters object itself. + */ + public RunParameters withDataServiceInput(Object dataServiceInput) { + this.dataServiceInput = dataServiceInput; + return this; + } + + /** + * Get the customerSecrets property: List of customer secrets containing a key identifier and key value. The key + * identifier is a way for the specific data source to understand the key. Value contains customer secret encrypted + * by the encryptionKeys. + * + * @return the customerSecrets value. + */ + public List customerSecrets() { + return this.customerSecrets; + } + + /** + * Set the customerSecrets property: List of customer secrets containing a key identifier and key value. The key + * identifier is a way for the specific data source to understand the key. Value contains customer secret encrypted + * by the encryptionKeys. + * + * @param customerSecrets the customerSecrets value to set. + * @return the RunParameters object itself. + */ + public RunParameters withCustomerSecrets(List customerSecrets) { + this.customerSecrets = customerSecrets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (customerSecrets() != null) { + customerSecrets().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/Schedule.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/Schedule.java new file mode 100644 index 000000000000..34a68d1e7f25 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/Schedule.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Schedule for the job run. */ +@Fluent +public final class Schedule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Schedule.class); + + /* + * Name of the schedule. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A list of repetition intervals in ISO 8601 format. + */ + @JsonProperty(value = "policyList") + private List policyList; + + /** + * Get the name property: Name of the schedule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the schedule. + * + * @param name the name value to set. + * @return the Schedule object itself. + */ + public Schedule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the policyList property: A list of repetition intervals in ISO 8601 format. + * + * @return the policyList value. + */ + public List policyList() { + return this.policyList; + } + + /** + * Set the policyList property: A list of repetition intervals in ISO 8601 format. + * + * @param policyList the policyList value to set. + * @return the Schedule object itself. + */ + public Schedule withPolicyList(List policyList) { + this.policyList = policyList; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/Sku.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/Sku.java new file mode 100644 index 000000000000..4aaac9cab1bd --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/Sku.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The sku type. */ +@Fluent +public final class Sku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); + + /* + * The sku name. Required for data manager creation, optional for update. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The sku tier. This is based on the SKU name. + */ + @JsonProperty(value = "tier") + private String tier; + + /** + * Get the name property: The sku name. Required for data manager creation, optional for update. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The sku name. Required for data manager creation, optional for update. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier property: The sku tier. This is based on the SKU name. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier property: The sku tier. This is based on the SKU name. + * + * @param tier the tier value to set. + * @return the Sku object itself. + */ + public Sku withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/State.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/State.java new file mode 100644 index 000000000000..0ee8393187c6 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/State.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for State. */ +public enum State { + /** Enum value Disabled. */ + DISABLED("Disabled"), + + /** Enum value Enabled. */ + ENABLED("Enabled"), + + /** Enum value Supported. */ + SUPPORTED("Supported"); + + /** The actual serialized value for a State instance. */ + private final String value; + + State(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a State instance. + * + * @param value the serialized value to parse. + * @return the parsed State object, or null if unable to parse. + */ + @JsonCreator + public static State fromString(String value) { + State[] items = State.values(); + for (State item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/SupportedAlgorithm.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/SupportedAlgorithm.java new file mode 100644 index 000000000000..1fd0241bbb10 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/SupportedAlgorithm.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for SupportedAlgorithm. */ +public enum SupportedAlgorithm { + /** Enum value None. */ + NONE("None"), + + /** Enum value RSA1_5. */ + RSA1_5("RSA1_5"), + + /** Enum value RSA_OAEP. */ + RSA_OAEP("RSA_OAEP"), + + /** Enum value PlainText. */ + PLAIN_TEXT("PlainText"); + + /** The actual serialized value for a SupportedAlgorithm instance. */ + private final String value; + + SupportedAlgorithm(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SupportedAlgorithm instance. + * + * @param value the serialized value to parse. + * @return the parsed SupportedAlgorithm object, or null if unable to parse. + */ + @JsonCreator + public static SupportedAlgorithm fromString(String value) { + SupportedAlgorithm[] items = SupportedAlgorithm.values(); + for (SupportedAlgorithm item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/UserConfirmation.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/UserConfirmation.java new file mode 100644 index 000000000000..f6a01231c611 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/UserConfirmation.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybriddatamanager.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for UserConfirmation. */ +public enum UserConfirmation { + /** Enum value NotRequired. */ + NOT_REQUIRED("NotRequired"), + + /** Enum value Required. */ + REQUIRED("Required"); + + /** The actual serialized value for a UserConfirmation instance. */ + private final String value; + + UserConfirmation(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a UserConfirmation instance. + * + * @param value the serialized value to parse. + * @return the parsed UserConfirmation object, or null if unable to parse. + */ + @JsonCreator + public static UserConfirmation fromString(String value) { + UserConfirmation[] items = UserConfirmation.values(); + for (UserConfirmation item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/package-info.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/package-info.java new file mode 100644 index 000000000000..6baea9d79fc4 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for HybridDataManagementClient. null. */ +package com.azure.resourcemanager.hybriddatamanager.models; diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/package-info.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/package-info.java new file mode 100644 index 000000000000..d9d02758d335 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/com/azure/resourcemanager/hybriddatamanager/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for HybridDataManagementClient. null. */ +package com.azure.resourcemanager.hybriddatamanager; diff --git a/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/module-info.java b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/module-info.java new file mode 100644 index 000000000000..4ab25e05da67 --- /dev/null +++ b/sdk/hybriddatamanager/azure-resourcemanager-hybriddatamanager/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.hybriddatamanager { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.hybriddatamanager; + exports com.azure.resourcemanager.hybriddatamanager.fluent; + exports com.azure.resourcemanager.hybriddatamanager.fluent.models; + exports com.azure.resourcemanager.hybriddatamanager.models; + + opens com.azure.resourcemanager.hybriddatamanager.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.hybriddatamanager.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/hybriddatamanager/ci.yml b/sdk/hybriddatamanager/ci.yml new file mode 100644 index 000000000000..9df357a6d3d0 --- /dev/null +++ b/sdk/hybriddatamanager/ci.yml @@ -0,0 +1,33 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - master + - main + - hotfix/* + - release/* + paths: + include: + - sdk/hybriddatamanager/ + +pr: + branches: + include: + - master + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybriddatamanager/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: hybriddatamanager + Artifacts: + - name: azure-resourcemanager-hybriddatamanager + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerhybriddatamanager diff --git a/sdk/hybriddatamanager/pom.xml b/sdk/hybriddatamanager/pom.xml new file mode 100644 index 000000000000..7c1fabefd52a --- /dev/null +++ b/sdk/hybriddatamanager/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-hybriddatamanager-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-hybriddatamanager + + + +