From b6fcd9527b03bd347a4777661d1036d519e2e584 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 24 Oct 2023 02:11:46 +0000 Subject: [PATCH] CodeGen from PR 26337 in Azure/azure-rest-api-specs Merge 9f3e5f7cfd71b4d36cf0f5f7b02312265ac5b09d into a7a4f92447ca5a425b1df6cafa839a3b32af8800 --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../README.md | 107 + .../SAMPLE.md | 1318 ++++++++++++ .../pom.xml | 62 + ...ecoveryServicesDataReplicationManager.java | 562 ++++++ .../fluent/DataReplicationMgmtClient.java | 172 ++ .../fluent/DraOperationStatusClient.java | 50 + .../fluent/DrasClient.java | 218 ++ .../fluent/EmailConfigurationsClient.java | 121 ++ .../fluent/EventsClient.java | 83 + .../fluent/FabricOperationsStatusClient.java | 48 + .../fluent/FabricsClient.java | 300 +++ .../fluent/OperationsClient.java | 40 + .../fluent/PoliciesClient.java | 218 ++ .../fluent/PolicyOperationStatusClient.java | 50 + .../ProtectedItemOperationStatusClient.java | 50 + .../fluent/ProtectedItemsClient.java | 310 +++ .../fluent/RecoveryPointsClient.java | 90 + .../fluent/ReplicationExtensionsClient.java | 227 +++ .../fluent/ResourceProvidersClient.java | 76 + .../fluent/VaultOperationStatusClient.java | 48 + .../fluent/VaultsClient.java | 300 +++ .../fluent/WorkflowOperationStatusClient.java | 50 + .../fluent/WorkflowsClient.java | 83 + ...eckNameAvailabilityResponseModelInner.java | 102 + .../models/DeploymentPreflightModelInner.java | 55 + .../fluent/models/DraModelInner.java | 81 + .../models/EmailConfigurationModelInner.java | 82 + .../fluent/models/EventModelInner.java | 125 ++ .../fluent/models/FabricModelInner.java | 96 + .../fluent/models/OperationInner.java | 127 ++ .../fluent/models/OperationStatusInner.java | 157 ++ .../models/PlannedFailoverModelInner.java | 62 + .../fluent/models/PolicyModelInner.java | 81 + .../models/ProtectedItemModelInner.java | 82 + .../models/RecoveryPointModelInner.java | 126 ++ .../ReplicationExtensionModelInner.java | 82 + .../fluent/models/VaultModelInner.java | 89 + .../fluent/models/WorkflowModelInner.java | 81 + .../fluent/models/package-info.java | 9 + .../fluent/package-info.java | 9 + ...heckNameAvailabilityResponseModelImpl.java | 43 + .../DataReplicationMgmtClientBuilder.java | 144 ++ .../DataReplicationMgmtClientImpl.java | 528 +++++ .../DeploymentPreflightModelImpl.java | 43 + .../implementation/DraModelImpl.java | 118 ++ .../DraOperationStatusClientImpl.java | 252 +++ .../DraOperationStatusImpl.java | 65 + .../implementation/DrasClientImpl.java | 1192 +++++++++++ .../implementation/DrasImpl.java | 198 ++ .../EmailConfigurationModelImpl.java | 121 ++ .../EmailConfigurationsClientImpl.java | 753 +++++++ .../EmailConfigurationsImpl.java | 136 ++ .../implementation/EventModelImpl.java | 53 + .../implementation/EventsClientImpl.java | 569 ++++++ .../implementation/EventsImpl.java | 76 + .../implementation/FabricModelImpl.java | 194 ++ .../FabricOperationsStatusClientImpl.java | 235 +++ .../FabricOperationsStatusImpl.java | 63 + .../implementation/FabricsClientImpl.java | 1765 +++++++++++++++++ .../implementation/FabricsImpl.java | 182 ++ .../implementation/OperationImpl.java | 54 + .../implementation/OperationStatusImpl.java | 51 + .../implementation/OperationsClientImpl.java | 282 +++ .../implementation/OperationsImpl.java | 48 + .../PlannedFailoverModelImpl.java | 36 + .../implementation/PoliciesClientImpl.java | 1183 +++++++++++ .../implementation/PoliciesImpl.java | 206 ++ .../implementation/PolicyModelImpl.java | 118 ++ .../PolicyOperationStatusClientImpl.java | 250 +++ .../PolicyOperationStatusImpl.java | 63 + .../ProtectedItemModelImpl.java | 130 ++ ...rotectedItemOperationStatusClientImpl.java | 254 +++ .../ProtectedItemOperationStatusImpl.java | 65 + .../ProtectedItemsClientImpl.java | 1684 ++++++++++++++++ .../implementation/ProtectedItemsImpl.java | 231 +++ .../RecoveryPointModelImpl.java | 53 + .../RecoveryPointsClientImpl.java | 583 ++++++ .../implementation/RecoveryPointsImpl.java | 86 + .../ReplicationExtensionModelImpl.java | 119 ++ .../ReplicationExtensionsClientImpl.java | 1248 ++++++++++++ .../ReplicationExtensionsImpl.java | 212 ++ .../ResourceProvidersClientImpl.java | 393 ++++ .../implementation/ResourceProvidersImpl.java | 90 + .../implementation/Utils.java | 204 ++ .../implementation/VaultModelImpl.java | 191 ++ .../VaultOperationStatusClientImpl.java | 235 +++ .../VaultOperationStatusImpl.java | 63 + .../implementation/VaultsClientImpl.java | 1762 ++++++++++++++++ .../implementation/VaultsImpl.java | 182 ++ .../implementation/WorkflowModelImpl.java | 53 + .../WorkflowOperationStatusClientImpl.java | 250 +++ .../WorkflowOperationStatusImpl.java | 63 + .../implementation/WorkflowsClientImpl.java | 570 ++++++ .../implementation/WorkflowsImpl.java | 76 + .../implementation/package-info.java | 9 + .../models/ActionType.java | 44 + .../models/AzStackHciClusterProperties.java | 158 ++ ...AzStackHciFabricModelCustomProperties.java | 193 ++ .../models/CheckNameAvailabilityModel.java | 76 + .../CheckNameAvailabilityResponseModel.java | 40 + .../models/DeploymentPreflightModel.java | 26 + .../models/DeploymentPreflightResource.java | 128 ++ .../models/DraModel.java | 127 ++ .../models/DraModelCollection.java | 81 + .../models/DraModelCustomProperties.java | 33 + .../models/DraModelProperties.java | 286 +++ .../models/DraModelSystemData.java | 68 + .../models/DraOperationStatus.java | 45 + .../models/Dras.java | 162 ++ .../models/EmailConfigurationModel.java | 128 ++ .../EmailConfigurationModelCollection.java | 81 + .../EmailConfigurationModelProperties.java | 105 + .../EmailConfigurationModelSystemData.java | 68 + .../models/EmailConfigurations.java | 110 + .../models/ErrorModel.java | 130 ++ .../models/EventModel.java | 52 + .../models/EventModelCollection.java | 81 + .../models/EventModelCustomProperties.java | 35 + .../models/EventModelProperties.java | 201 ++ .../models/EventModelSystemData.java | 68 + .../models/Events.java | 75 + .../models/FabricModel.java | 244 +++ .../models/FabricModelCollection.java | 81 + .../models/FabricModelCustomProperties.java | 37 + .../models/FabricModelProperties.java | 140 ++ .../models/FabricModelSystemData.java | 68 + .../models/FabricModelUpdate.java | 101 + .../models/FabricModelUpdateSystemData.java | 68 + .../models/FabricOperationsStatus.java | 43 + .../models/Fabrics.java | 183 ++ .../FailoverProtectedItemProperties.java | 130 ++ ...FailoverWorkflowModelCustomProperties.java | 49 + .../models/HealthErrorModel.java | 278 +++ .../models/HealthStatus.java | 50 + ...erVMigrateFabricModelCustomProperties.java | 143 ++ .../models/HyperVToAzStackHciDiskInput.java | 198 ++ ...oAzStackHciEventModelCustomProperties.java | 110 + .../models/HyperVToAzStackHciNicInput.java | 170 ++ ...oAzStackHciPlannedFailoverCustomProps.java | 56 + ...AzStackHciPolicyModelCustomProperties.java | 118 ++ ...rVToAzStackHciProtectedDiskProperties.java | 191 ++ ...VToAzStackHciProtectedItemCustomProps.java | 931 +++++++++ ...erVToAzStackHciProtectedNicProperties.java | 114 ++ ...VToAzStackHciRecoveryPointCustomProps.java | 46 + .../HyperVToAzStackHciRepExtnCustomProps.java | 330 +++ .../models/IdentityModel.java | 185 ++ .../models/InnerHealthErrorModel.java | 190 ++ .../models/LastFailedEnableProtectionJob.java | 25 + .../models/LastFailedPlannedFailoverJob.java | 25 + .../models/Operation.java | 56 + .../models/OperationDisplay.java | 91 + .../models/OperationListResult.java | 62 + .../models/OperationStatus.java | 54 + .../models/Operations.java | 35 + .../models/Origin.java | 53 + .../models/PlannedFailoverModel.java | 25 + .../PlannedFailoverModelCustomProperties.java | 36 + .../PlannedFailoverModelProperties.java | 61 + .../models/Policies.java | 162 ++ .../models/PolicyModel.java | 127 ++ .../models/PolicyModelCollection.java | 81 + .../models/PolicyModelCustomProperties.java | 36 + .../models/PolicyModelProperties.java | 76 + .../models/PolicyModelSystemData.java | 68 + .../models/PolicyOperationStatus.java | 45 + .../models/ProtectedItemActiveLocation.java | 47 + .../ProtectedItemDynamicMemoryConfig.java | 102 + .../models/ProtectedItemJobProperties.java | 130 ++ .../models/ProtectedItemModel.java | 154 ++ .../models/ProtectedItemModelCollection.java | 81 + .../ProtectedItemModelCustomProperties.java | 36 + .../models/ProtectedItemModelProperties.java | 532 +++++ ...rotectedItemModelPropertiesCurrentJob.java | 25 + ...temModelPropertiesLastTestFailoverJob.java | 25 + .../models/ProtectedItemModelSystemData.java | 68 + .../models/ProtectedItemOperationStatus.java | 45 + .../models/ProtectedItems.java | 203 ++ .../models/ProtectionState.java | 212 ++ .../models/ProvisioningState.java | 62 + .../models/RecoveryPointModel.java | 53 + .../models/RecoveryPointModelCollection.java | 81 + .../RecoveryPointModelCustomProperties.java | 35 + .../models/RecoveryPointModelProperties.java | 126 ++ .../models/RecoveryPointModelSystemData.java | 68 + .../models/RecoveryPointType.java | 47 + .../models/RecoveryPoints.java | 83 + .../models/ReplicationExtensionModel.java | 128 ++ .../ReplicationExtensionModelCollection.java | 81 + ...icationExtensionModelCustomProperties.java | 36 + .../ReplicationExtensionModelProperties.java | 77 + .../ReplicationExtensionModelSystemData.java | 68 + .../models/ReplicationExtensions.java | 162 ++ .../models/ReplicationVaultType.java | 47 + .../models/ResourceProviders.java | 68 + .../models/ResynchronizationState.java | 53 + .../models/StorageContainerProperties.java | 90 + .../models/SystemDataModel.java | 187 ++ .../models/TaskModel.java | 145 ++ .../models/TaskModelCustomProperties.java | 59 + .../models/TaskState.java | 59 + ...rCleanupWorkflowModelCustomProperties.java | 45 + .../models/TestFailoverState.java | 69 + ...FailoverWorkflowModelCustomProperties.java | 49 + .../models/VMNicSelection.java | 53 + .../VMwareDraModelCustomProperties.java | 100 + ...areMigrateFabricModelCustomProperties.java | 98 + .../models/VMwareToAzStackHciDiskInput.java | 198 ++ .../models/VMwareToAzStackHciNicInput.java | 202 ++ ...oAzStackHciPlannedFailoverCustomProps.java | 56 + ...AzStackHciPolicyModelCustomProperties.java | 118 ++ ...reToAzStackHciProtectedDiskProperties.java | 191 ++ ...eToAzStackHciProtectedItemCustomProps.java | 1049 ++++++++++ ...areToAzStackHciProtectedNicProperties.java | 155 ++ .../VMwareToAzStackHciRepExtnCustomProps.java | 330 +++ .../VMwareToAzureMigrateResyncState.java | 52 + .../models/VaultModel.java | 243 +++ .../models/VaultModelCollection.java | 81 + .../models/VaultModelProperties.java | 80 + .../models/VaultModelSystemData.java | 68 + .../models/VaultModelUpdate.java | 101 + .../models/VaultModelUpdateSystemData.java | 68 + .../models/VaultOperationStatus.java | 43 + .../models/Vaults.java | 183 ++ .../models/WorkflowModel.java | 52 + .../models/WorkflowModelCollection.java | 81 + .../models/WorkflowModelCustomProperties.java | 58 + .../models/WorkflowModelProperties.java | 309 +++ .../models/WorkflowModelSystemData.java | 68 + .../models/WorkflowObjectType.java | 65 + .../models/WorkflowOperationStatus.java | 45 + .../models/WorkflowState.java | 68 + .../models/Workflows.java | 76 + .../models/package-info.java | 9 + .../package-info.java | 9 + .../src/main/java/module-info.java | 19 + .../generated/DraCreateSamples.java | 48 + .../generated/DraDeleteSamples.java | 21 + .../generated/DraGetSamples.java | 23 + .../generated/DraListSamples.java | 21 + .../DraOperationStatusGetSamples.java | 24 + .../EmailConfigurationCreateSamples.java | 33 + .../EmailConfigurationGetSamples.java | 23 + .../EmailConfigurationListSamples.java | 21 + .../generated/EventGetSamples.java | 23 + .../generated/EventListSamples.java | 28 + .../generated/FabricCreateSamples.java | 45 + .../generated/FabricDeleteSamples.java | 21 + .../FabricGetByResourceGroupSamples.java | 24 + .../FabricListByResourceGroupSamples.java | 23 + .../generated/FabricListSamples.java | 21 + .../FabricOperationsStatusGetSamples.java | 23 + .../generated/FabricUpdateSamples.java | 49 + .../generated/OperationsListSamples.java | 21 + .../generated/PolicyCreateSamples.java | 29 + .../generated/PolicyDeleteSamples.java | 23 + .../generated/PolicyGetSamples.java | 23 + .../generated/PolicyListSamples.java | 21 + .../PolicyOperationStatusGetSamples.java | 24 + .../generated/ProtectedItemCreateSamples.java | 33 + .../generated/ProtectedItemDeleteSamples.java | 23 + .../generated/ProtectedItemGetSamples.java | 23 + .../generated/ProtectedItemListSamples.java | 21 + ...rotectedItemOperationStatusGetSamples.java | 24 + .../ProtectedItemPlannedFailoverSamples.java | 35 + .../generated/RecoveryPointsGetSamples.java | 23 + .../generated/RecoveryPointsListSamples.java | 21 + .../ReplicationExtensionCreateSamples.java | 31 + .../ReplicationExtensionDeleteSamples.java | 23 + .../ReplicationExtensionGetSamples.java | 23 + .../ReplicationExtensionListSamples.java | 23 + ...esourceProviderCheckNameAvailabilityS.java | 28 + ...esourceProviderDeploymentPreflightSam.java | 39 + .../generated/VaultCreateSamples.java | 45 + .../generated/VaultDeleteSamples.java | 21 + .../VaultGetByResourceGroupSamples.java | 23 + .../VaultListByResourceGroupSamples.java | 23 + .../generated/VaultListSamples.java | 21 + .../VaultOperationStatusGetSamples.java | 23 + .../generated/VaultUpdateSamples.java | 49 + .../generated/WorkflowGetSamples.java | 23 + .../generated/WorkflowListSamples.java | 28 + .../WorkflowOperationStatusGetSamples.java | 24 + sdk/recoveryservicesdatareplication/ci.yml | 47 + sdk/recoveryservicesdatareplication/pom.xml | 15 + 287 files changed, 41126 insertions(+) create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/CHANGELOG.md create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/README.md create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/SAMPLE.md create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/pom.xml create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/RecoveryServicesDataReplicationManager.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/DataReplicationMgmtClient.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/DraOperationStatusClient.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/DrasClient.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/EmailConfigurationsClient.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/EventsClient.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/FabricOperationsStatusClient.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/FabricsClient.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/OperationsClient.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/PoliciesClient.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/PolicyOperationStatusClient.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/ProtectedItemOperationStatusClient.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/ProtectedItemsClient.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/RecoveryPointsClient.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/ReplicationExtensionsClient.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/ResourceProvidersClient.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/VaultOperationStatusClient.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/VaultsClient.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/WorkflowOperationStatusClient.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/WorkflowsClient.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/CheckNameAvailabilityResponseModelInner.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/DeploymentPreflightModelInner.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/DraModelInner.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/EmailConfigurationModelInner.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/EventModelInner.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/FabricModelInner.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/OperationInner.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/OperationStatusInner.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/PlannedFailoverModelInner.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/PolicyModelInner.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/ProtectedItemModelInner.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/RecoveryPointModelInner.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/ReplicationExtensionModelInner.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/VaultModelInner.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/WorkflowModelInner.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/package-info.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/package-info.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/CheckNameAvailabilityResponseModelImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DataReplicationMgmtClientBuilder.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DataReplicationMgmtClientImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DeploymentPreflightModelImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DraModelImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DraOperationStatusClientImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DraOperationStatusImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DrasClientImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DrasImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/EmailConfigurationModelImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/EmailConfigurationsClientImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/EmailConfigurationsImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/EventModelImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/EventsClientImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/EventsImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/FabricModelImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/FabricOperationsStatusClientImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/FabricOperationsStatusImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/FabricsClientImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/FabricsImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/OperationImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/OperationStatusImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/OperationsClientImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/OperationsImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/PlannedFailoverModelImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/PoliciesClientImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/PoliciesImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/PolicyModelImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/PolicyOperationStatusClientImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/PolicyOperationStatusImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ProtectedItemModelImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ProtectedItemOperationStatusClientImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ProtectedItemOperationStatusImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ProtectedItemsClientImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ProtectedItemsImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/RecoveryPointModelImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/RecoveryPointsClientImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/RecoveryPointsImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ReplicationExtensionModelImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ReplicationExtensionsClientImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ReplicationExtensionsImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ResourceProvidersClientImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ResourceProvidersImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/Utils.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/VaultModelImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/VaultOperationStatusClientImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/VaultOperationStatusImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/VaultsClientImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/VaultsImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/WorkflowModelImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/WorkflowOperationStatusClientImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/WorkflowOperationStatusImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/WorkflowsClientImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/WorkflowsImpl.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/package-info.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ActionType.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/AzStackHciClusterProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/AzStackHciFabricModelCustomProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/CheckNameAvailabilityModel.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/CheckNameAvailabilityResponseModel.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DeploymentPreflightModel.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DeploymentPreflightResource.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DraModel.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DraModelCollection.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DraModelCustomProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DraModelProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DraModelSystemData.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DraOperationStatus.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Dras.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EmailConfigurationModel.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EmailConfigurationModelCollection.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EmailConfigurationModelProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EmailConfigurationModelSystemData.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EmailConfigurations.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ErrorModel.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EventModel.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EventModelCollection.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EventModelCustomProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EventModelProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EventModelSystemData.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Events.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricModel.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricModelCollection.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricModelCustomProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricModelProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricModelSystemData.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricModelUpdate.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricModelUpdateSystemData.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricOperationsStatus.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Fabrics.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FailoverProtectedItemProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FailoverWorkflowModelCustomProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HealthErrorModel.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HealthStatus.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVMigrateFabricModelCustomProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciDiskInput.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciEventModelCustomProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciNicInput.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciPlannedFailoverCustomProps.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciPolicyModelCustomProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciProtectedDiskProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciProtectedItemCustomProps.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciProtectedNicProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciRecoveryPointCustomProps.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciRepExtnCustomProps.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/IdentityModel.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/InnerHealthErrorModel.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/LastFailedEnableProtectionJob.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/LastFailedPlannedFailoverJob.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Operation.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/OperationDisplay.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/OperationListResult.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/OperationStatus.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Operations.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Origin.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PlannedFailoverModel.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PlannedFailoverModelCustomProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PlannedFailoverModelProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Policies.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PolicyModel.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PolicyModelCollection.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PolicyModelCustomProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PolicyModelProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PolicyModelSystemData.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PolicyOperationStatus.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemActiveLocation.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemDynamicMemoryConfig.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemJobProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModel.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelCollection.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelCustomProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelPropertiesCurrentJob.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelPropertiesLastTestFailoverJob.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelSystemData.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemOperationStatus.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItems.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectionState.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProvisioningState.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/RecoveryPointModel.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/RecoveryPointModelCollection.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/RecoveryPointModelCustomProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/RecoveryPointModelProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/RecoveryPointModelSystemData.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/RecoveryPointType.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/RecoveryPoints.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ReplicationExtensionModel.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ReplicationExtensionModelCollection.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ReplicationExtensionModelCustomProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ReplicationExtensionModelProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ReplicationExtensionModelSystemData.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ReplicationExtensions.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ReplicationVaultType.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ResourceProviders.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ResynchronizationState.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/StorageContainerProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/SystemDataModel.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TaskModel.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TaskModelCustomProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TaskState.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TestFailoverCleanupWorkflowModelCustomProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TestFailoverState.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TestFailoverWorkflowModelCustomProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMNicSelection.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareDraModelCustomProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareMigrateFabricModelCustomProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciDiskInput.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciNicInput.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciPlannedFailoverCustomProps.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciPolicyModelCustomProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciProtectedDiskProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciProtectedItemCustomProps.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciProtectedNicProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciRepExtnCustomProps.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzureMigrateResyncState.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VaultModel.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VaultModelCollection.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VaultModelProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VaultModelSystemData.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VaultModelUpdate.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VaultModelUpdateSystemData.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VaultOperationStatus.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Vaults.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowModel.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowModelCollection.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowModelCustomProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowModelProperties.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowModelSystemData.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowObjectType.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowOperationStatus.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowState.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Workflows.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/package-info.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/package-info.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/module-info.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/DraCreateSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/DraDeleteSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/DraGetSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/DraListSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/DraOperationStatusGetSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/EmailConfigurationCreateSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/EmailConfigurationGetSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/EmailConfigurationListSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/EventGetSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/EventListSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/FabricCreateSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/FabricDeleteSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/FabricGetByResourceGroupSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/FabricListByResourceGroupSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/FabricListSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/FabricOperationsStatusGetSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/FabricUpdateSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/OperationsListSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/PolicyCreateSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/PolicyDeleteSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/PolicyGetSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/PolicyListSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/PolicyOperationStatusGetSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemCreateSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemDeleteSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemGetSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemListSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemOperationStatusGetSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemPlannedFailoverSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/RecoveryPointsGetSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/RecoveryPointsListSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ReplicationExtensionCreateSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ReplicationExtensionDeleteSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ReplicationExtensionGetSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ReplicationExtensionListSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ResourceProviderCheckNameAvailabilityS.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ResourceProviderDeploymentPreflightSam.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/VaultCreateSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/VaultDeleteSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/VaultGetByResourceGroupSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/VaultListByResourceGroupSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/VaultListSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/VaultOperationStatusGetSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/VaultUpdateSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/WorkflowGetSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/WorkflowListSamples.java create mode 100644 sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/WorkflowOperationStatusGetSamples.java create mode 100644 sdk/recoveryservicesdatareplication/ci.yml create mode 100644 sdk/recoveryservicesdatareplication/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 15c9b39d411d..410ea392b291 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -431,6 +431,7 @@ com.azure.resourcemanager:azure-resourcemanager-hdinsight-containers;1.0.0-beta. com.azure.resourcemanager:azure-resourcemanager-apicenter;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-hybridconnectivity;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-playwrighttesting;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-recoveryservicesdatareplication;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1 diff --git a/pom.xml b/pom.xml index 2933b7b5264a..5623ede6090d 100644 --- a/pom.xml +++ b/pom.xml @@ -155,6 +155,7 @@ sdk/quota sdk/recoveryservices sdk/recoveryservicesbackup + sdk/recoveryservicesdatareplication sdk/recoveryservicessiterecovery sdk/redisenterprise sdk/relay diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/CHANGELOG.md b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/CHANGELOG.md new file mode 100644 index 000000000000..74c08edd4d28 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2023-10-24) + +- Azure Resource Manager Recovery Services Data Replication client library for Java. This package contains Microsoft Azure SDK for Recovery Services Data Replication Management SDK. A first party Azure service enabling the data replication. Package tag package-2021-02-16-preview. 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/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/README.md b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/README.md new file mode 100644 index 000000000000..79542f78f09b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/README.md @@ -0,0 +1,107 @@ +# Azure Resource Manager Recovery Services Data Replication client library for Java + +Azure Resource Manager Recovery Services Data Replication client library for Java. + +This package contains Microsoft Azure SDK for Recovery Services Data Replication Management SDK. A first party Azure service enabling the data replication. Package tag package-2021-02-16-preview. 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-recoveryservicesdatareplication;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-recoveryservicesdatareplication + 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] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +By default, Microsoft Entra ID token authentication depends on correct configuration of the 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 `AZURE_SUBSCRIPTION_ID` environment variable. + +With above configuration, `azure` client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +RecoveryServicesDataReplicationManager manager = RecoveryServicesDataReplicationManager + .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 + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ +[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 +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Frecoveryservicesdatareplication%2Fazure-resourcemanager-recoveryservicesdatareplication%2FREADME.png) diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/SAMPLE.md b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/SAMPLE.md new file mode 100644 index 000000000000..4879fde57982 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/SAMPLE.md @@ -0,0 +1,1318 @@ +# Code snippets and samples + + +## Dra + +- [Create](#dra_create) +- [Delete](#dra_delete) +- [Get](#dra_get) +- [List](#dra_list) + +## DraOperationStatus + +- [Get](#draoperationstatus_get) + +## EmailConfiguration + +- [Create](#emailconfiguration_create) +- [Get](#emailconfiguration_get) +- [List](#emailconfiguration_list) + +## Event + +- [Get](#event_get) +- [List](#event_list) + +## Fabric + +- [Create](#fabric_create) +- [Delete](#fabric_delete) +- [GetByResourceGroup](#fabric_getbyresourcegroup) +- [List](#fabric_list) +- [ListByResourceGroup](#fabric_listbyresourcegroup) +- [Update](#fabric_update) + +## FabricOperationsStatus + +- [Get](#fabricoperationsstatus_get) + +## Operations + +- [List](#operations_list) + +## Policy + +- [Create](#policy_create) +- [Delete](#policy_delete) +- [Get](#policy_get) +- [List](#policy_list) + +## PolicyOperationStatus + +- [Get](#policyoperationstatus_get) + +## ProtectedItem + +- [Create](#protecteditem_create) +- [Delete](#protecteditem_delete) +- [Get](#protecteditem_get) +- [List](#protecteditem_list) +- [PlannedFailover](#protecteditem_plannedfailover) + +## ProtectedItemOperationStatus + +- [Get](#protecteditemoperationstatus_get) + +## RecoveryPoints + +- [Get](#recoverypoints_get) +- [List](#recoverypoints_list) + +## ReplicationExtension + +- [Create](#replicationextension_create) +- [Delete](#replicationextension_delete) +- [Get](#replicationextension_get) +- [List](#replicationextension_list) + +## ResourceProvider + +- [CheckNameAvailability](#resourceprovider_checknameavailability) +- [DeploymentPreflight](#resourceprovider_deploymentpreflight) + +## Vault + +- [Create](#vault_create) +- [Delete](#vault_delete) +- [GetByResourceGroup](#vault_getbyresourcegroup) +- [List](#vault_list) +- [ListByResourceGroup](#vault_listbyresourcegroup) +- [Update](#vault_update) + +## VaultOperationStatus + +- [Get](#vaultoperationstatus_get) + +## Workflow + +- [Get](#workflow_get) +- [List](#workflow_list) + +## WorkflowOperationStatus + +- [Get](#workflowoperationstatus_get) +### Dra_Create + +```java +import com.azure.resourcemanager.recoveryservicesdatareplication.models.DraModelCustomProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.DraModelProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.IdentityModel; + +/** Samples for Dra Create. */ +public final class DraCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Dra_Create.json + */ + /** + * Sample code: Dra_Create. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void draCreate( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .dras() + .define("M") + .withExistingReplicationFabric("rgrecoveryservicesdatareplication", "wPR") + .withProperties( + new DraModelProperties() + .withMachineId("envzcoijbqhtrpncbjbhk") + .withMachineName("y") + .withAuthenticationIdentity( + new IdentityModel() + .withTenantId("joclkkdovixwapephhxaqtefubhhmq") + .withApplicationId("cwktzrwajuvfyyymfstpey") + .withObjectId("khsiaqfbpuhp") + .withAudience("dkjobanyqgzenivyxhvavottpc") + .withAadAuthority("bubwwbowfhdmujrt")) + .withResourceAccessIdentity( + new IdentityModel() + .withTenantId("joclkkdovixwapephhxaqtefubhhmq") + .withApplicationId("cwktzrwajuvfyyymfstpey") + .withObjectId("khsiaqfbpuhp") + .withAudience("dkjobanyqgzenivyxhvavottpc") + .withAadAuthority("bubwwbowfhdmujrt")) + .withCustomProperties(new DraModelCustomProperties())) + .create(); + } +} +``` + +### Dra_Delete + +```java +/** Samples for Dra Delete. */ +public final class DraDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Dra_Delete.json + */ + /** + * Sample code: Dra_Delete. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void draDelete( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager.dras().delete("rgrecoveryservicesdatareplication", "wPR", "M", com.azure.core.util.Context.NONE); + } +} +``` + +### Dra_Get + +```java +/** Samples for Dra Get. */ +public final class DraGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Dra_Get.json + */ + /** + * Sample code: Dra_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void draGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .dras() + .getWithResponse("rgrecoveryservicesdatareplication", "wPR", "M", com.azure.core.util.Context.NONE); + } +} +``` + +### Dra_List + +```java +/** Samples for Dra List. */ +public final class DraListSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Dra_List.json + */ + /** + * Sample code: Dra_List. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void draList( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager.dras().list("rgrecoveryservicesdatareplication", "wPR", com.azure.core.util.Context.NONE); + } +} +``` + +### DraOperationStatus_Get + +```java +/** Samples for DraOperationStatus Get. */ +public final class DraOperationStatusGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/DraOperationStatus_Get.json + */ + /** + * Sample code: DraOperationStatus_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void draOperationStatusGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .draOperationStatus() + .getWithResponse( + "rgrecoveryservicesdatareplication", "wPR", "M", "dadsqwcq", com.azure.core.util.Context.NONE); + } +} +``` + +### EmailConfiguration_Create + +```java +import com.azure.resourcemanager.recoveryservicesdatareplication.models.EmailConfigurationModelProperties; +import java.util.Arrays; + +/** Samples for EmailConfiguration Create. */ +public final class EmailConfigurationCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/EmailConfiguration_Create.json + */ + /** + * Sample code: EmailConfiguration_Create. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void emailConfigurationCreate( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .emailConfigurations() + .define("0") + .withExistingReplicationVault("rgrecoveryservicesdatareplication", "4") + .withProperties( + new EmailConfigurationModelProperties() + .withSendToOwners(true) + .withCustomEmailAddresses(Arrays.asList("ketvbducyailcny")) + .withLocale("vpnjxjvdqtebnucyxiyrjiko")) + .create(); + } +} +``` + +### EmailConfiguration_Get + +```java +/** Samples for EmailConfiguration Get. */ +public final class EmailConfigurationGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/EmailConfiguration_Get.json + */ + /** + * Sample code: EmailConfiguration_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void emailConfigurationGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .emailConfigurations() + .getWithResponse("rgrecoveryservicesdatareplication", "4", "0", com.azure.core.util.Context.NONE); + } +} +``` + +### EmailConfiguration_List + +```java +/** Samples for EmailConfiguration List. */ +public final class EmailConfigurationListSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/EmailConfiguration_List.json + */ + /** + * Sample code: EmailConfiguration_List. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void emailConfigurationList( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager.emailConfigurations().list("rgrecoveryservicesdatareplication", "4", com.azure.core.util.Context.NONE); + } +} +``` + +### Event_Get + +```java +/** Samples for Event Get. */ +public final class EventGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Event_Get.json + */ + /** + * Sample code: Event_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void eventGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .events() + .getWithResponse("rgrecoveryservicesdatareplication", "4", "231CIG", com.azure.core.util.Context.NONE); + } +} +``` + +### Event_List + +```java +/** Samples for Event List. */ +public final class EventListSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Event_List.json + */ + /** + * Sample code: Event_List. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void eventList( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .events() + .list( + "rgrecoveryservicesdatareplication", + "4", + "wbglupjzvkirtgnnyasxom", + "cxtufi", + com.azure.core.util.Context.NONE); + } +} +``` + +### Fabric_Create + +```java +import com.azure.resourcemanager.recoveryservicesdatareplication.models.FabricModelCustomProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.FabricModelProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Fabric Create. */ +public final class FabricCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Fabric_Create.json + */ + /** + * Sample code: Fabric_Create. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void fabricCreate( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .fabrics() + .define("wPR") + .withRegion("tqygutlpob") + .withExistingResourceGroup("rgrecoveryservicesdatareplication") + .withProperties(new FabricModelProperties().withCustomProperties(new FabricModelCustomProperties())) + .withTags(mapOf("key3917", "fakeTokenPlaceholder")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Fabric_Delete + +```java +/** Samples for Fabric Delete. */ +public final class FabricDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Fabric_Delete.json + */ + /** + * Sample code: Fabric_Delete. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void fabricDelete( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager.fabrics().delete("rgrecoveryservicesdatareplication", "wPR", com.azure.core.util.Context.NONE); + } +} +``` + +### Fabric_GetByResourceGroup + +```java +/** Samples for Fabric GetByResourceGroup. */ +public final class FabricGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Fabric_Get.json + */ + /** + * Sample code: Fabric_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void fabricGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .fabrics() + .getByResourceGroupWithResponse( + "rgrecoveryservicesdatareplication", "wPR", com.azure.core.util.Context.NONE); + } +} +``` + +### Fabric_List + +```java +/** Samples for Fabric List. */ +public final class FabricListSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Fabric_ListBySubscription.json + */ + /** + * Sample code: Fabric_ListBySubscription. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void fabricListBySubscription( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager.fabrics().list("rmgqrpzucsizbyjscxzockbiyg", com.azure.core.util.Context.NONE); + } +} +``` + +### Fabric_ListByResourceGroup + +```java +/** Samples for Fabric ListByResourceGroup. */ +public final class FabricListByResourceGroupSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Fabric_List.json + */ + /** + * Sample code: Fabric_List. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void fabricList( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .fabrics() + .listByResourceGroup("rgrecoveryservicesdatareplication", "mjzsxwwmtvd", com.azure.core.util.Context.NONE); + } +} +``` + +### Fabric_Update + +```java +import com.azure.resourcemanager.recoveryservicesdatareplication.models.FabricModel; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.FabricModelCustomProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.FabricModelProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Fabric Update. */ +public final class FabricUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Fabric_Update.json + */ + /** + * Sample code: Fabric_Update. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void fabricUpdate( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + FabricModel resource = + manager + .fabrics() + .getByResourceGroupWithResponse( + "rgrecoveryservicesdatareplication", "wPR", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key6664", "fakeTokenPlaceholder")) + .withProperties(new FabricModelProperties().withCustomProperties(new FabricModelCustomProperties())) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### FabricOperationsStatus_Get + +```java +/** Samples for FabricOperationsStatus Get. */ +public final class FabricOperationsStatusGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/FabricOperationsStatus_Get.json + */ + /** + * Sample code: FabricOperationsStatus_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void fabricOperationsStatusGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .fabricOperationsStatus() + .getWithResponse("rgrecoveryservicesdatareplication", "wPR", "dvfwerv", com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Operations_List.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void operationsList( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Policy_Create + +```java +import com.azure.resourcemanager.recoveryservicesdatareplication.models.PolicyModelCustomProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.PolicyModelProperties; + +/** Samples for Policy Create. */ +public final class PolicyCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Policy_Create.json + */ + /** + * Sample code: Policy_Create. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void policyCreate( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .policies() + .define("fafqwc") + .withExistingReplicationVault("rgrecoveryservicesdatareplication", "4") + .withProperties(new PolicyModelProperties().withCustomProperties(new PolicyModelCustomProperties())) + .create(); + } +} +``` + +### Policy_Delete + +```java +/** Samples for Policy Delete. */ +public final class PolicyDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Policy_Delete.json + */ + /** + * Sample code: Policy_Delete. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void policyDelete( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .policies() + .delete("rgrecoveryservicesdatareplication", "4", "wqfscsdv", com.azure.core.util.Context.NONE); + } +} +``` + +### Policy_Get + +```java +/** Samples for Policy Get. */ +public final class PolicyGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Policy_Get.json + */ + /** + * Sample code: Policy_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void policyGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .policies() + .getWithResponse("rgrecoveryservicesdatareplication", "4", "wdqsacasc", com.azure.core.util.Context.NONE); + } +} +``` + +### Policy_List + +```java +/** Samples for Policy List. */ +public final class PolicyListSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Policy_List.json + */ + /** + * Sample code: Policy_List. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void policyList( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager.policies().list("rgrecoveryservicesdatareplication", "4", com.azure.core.util.Context.NONE); + } +} +``` + +### PolicyOperationStatus_Get + +```java +/** Samples for PolicyOperationStatus Get. */ +public final class PolicyOperationStatusGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/PolicyOperationStatus_Get.json + */ + /** + * Sample code: PolicyOperationStatus_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void policyOperationStatusGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .policyOperationStatus() + .getWithResponse( + "rgrecoveryservicesdatareplication", "4", "xczxcwec", "wdqfsdxv", com.azure.core.util.Context.NONE); + } +} +``` + +### ProtectedItem_Create + +```java +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ProtectedItemModelCustomProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ProtectedItemModelProperties; + +/** Samples for ProtectedItem Create. */ +public final class ProtectedItemCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/ProtectedItem_Create.json + */ + /** + * Sample code: ProtectedItem_Create. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void protectedItemCreate( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .protectedItems() + .define("d") + .withExistingReplicationVault("rgrecoveryservicesdatareplication", "4") + .withProperties( + new ProtectedItemModelProperties() + .withPolicyName("tjoeiynplt") + .withReplicationExtensionName("jwxdo") + .withCustomProperties(new ProtectedItemModelCustomProperties())) + .create(); + } +} +``` + +### ProtectedItem_Delete + +```java +/** Samples for ProtectedItem Delete. */ +public final class ProtectedItemDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/ProtectedItem_Delete.json + */ + /** + * Sample code: ProtectedItem_Delete. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void protectedItemDelete( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .protectedItems() + .delete("rgrecoveryservicesdatareplication", "4", "d", true, com.azure.core.util.Context.NONE); + } +} +``` + +### ProtectedItem_Get + +```java +/** Samples for ProtectedItem Get. */ +public final class ProtectedItemGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/ProtectedItem_Get.json + */ + /** + * Sample code: ProtectedItem_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void protectedItemGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .protectedItems() + .getWithResponse("rgrecoveryservicesdatareplication", "4", "d", com.azure.core.util.Context.NONE); + } +} +``` + +### ProtectedItem_List + +```java +/** Samples for ProtectedItem List. */ +public final class ProtectedItemListSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/ProtectedItem_List.json + */ + /** + * Sample code: ProtectedItem_List. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void protectedItemList( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager.protectedItems().list("rgrecoveryservicesdatareplication", "4", com.azure.core.util.Context.NONE); + } +} +``` + +### ProtectedItem_PlannedFailover + +```java +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.PlannedFailoverModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.PlannedFailoverModelCustomProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.PlannedFailoverModelProperties; + +/** Samples for ProtectedItem PlannedFailover. */ +public final class ProtectedItemPlannedFailoverSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/ProtectedItem_PlannedFailover.json + */ + /** + * Sample code: ProtectedItem_PlannedFailover. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void protectedItemPlannedFailover( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .protectedItems() + .plannedFailover( + "rgrecoveryservicesdatareplication", + "4", + "d", + new PlannedFailoverModelInner() + .withProperties( + new PlannedFailoverModelProperties() + .withCustomProperties(new PlannedFailoverModelCustomProperties())), + com.azure.core.util.Context.NONE); + } +} +``` + +### ProtectedItemOperationStatus_Get + +```java +/** Samples for ProtectedItemOperationStatus Get. */ +public final class ProtectedItemOperationStatusGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/ProtectedItemOperationStatus_Get.json + */ + /** + * Sample code: ProtectedItemOperationStatus_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void protectedItemOperationStatusGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .protectedItemOperationStatus() + .getWithResponse( + "rgrecoveryservicesdatareplication", "4", "d", "wdqacsc", com.azure.core.util.Context.NONE); + } +} +``` + +### RecoveryPoints_Get + +```java +/** Samples for RecoveryPoints Get. */ +public final class RecoveryPointsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/RecoveryPoints_Get.json + */ + /** + * Sample code: RecoveryPoints_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void recoveryPointsGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .recoveryPoints() + .getWithResponse("rgrecoveryservicesdatareplication", "4", "d", "1X", com.azure.core.util.Context.NONE); + } +} +``` + +### RecoveryPoints_List + +```java +/** Samples for RecoveryPoints List. */ +public final class RecoveryPointsListSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/RecoveryPoints_List.json + */ + /** + * Sample code: RecoveryPoints_List. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void recoveryPointsList( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager.recoveryPoints().list("rgrecoveryservicesdatareplication", "4", "d", com.azure.core.util.Context.NONE); + } +} +``` + +### ReplicationExtension_Create + +```java +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ReplicationExtensionModelCustomProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ReplicationExtensionModelProperties; + +/** Samples for ReplicationExtension Create. */ +public final class ReplicationExtensionCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/ReplicationExtension_Create.json + */ + /** + * Sample code: ReplicationExtension_Create. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void replicationExtensionCreate( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .replicationExtensions() + .define("g16yjJ") + .withExistingReplicationVault("rgrecoveryservicesdatareplication", "4") + .withProperties( + new ReplicationExtensionModelProperties() + .withCustomProperties(new ReplicationExtensionModelCustomProperties())) + .create(); + } +} +``` + +### ReplicationExtension_Delete + +```java +/** Samples for ReplicationExtension Delete. */ +public final class ReplicationExtensionDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/ReplicationExtension_Delete.json + */ + /** + * Sample code: ReplicationExtension_Delete. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void replicationExtensionDelete( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .replicationExtensions() + .delete("rgrecoveryservicesdatareplication", "4", "g16yjJ", com.azure.core.util.Context.NONE); + } +} +``` + +### ReplicationExtension_Get + +```java +/** Samples for ReplicationExtension Get. */ +public final class ReplicationExtensionGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/ReplicationExtension_Get.json + */ + /** + * Sample code: ReplicationExtension_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void replicationExtensionGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .replicationExtensions() + .getWithResponse("rgrecoveryservicesdatareplication", "4", "g16yjJ", com.azure.core.util.Context.NONE); + } +} +``` + +### ReplicationExtension_List + +```java +/** Samples for ReplicationExtension List. */ +public final class ReplicationExtensionListSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/ReplicationExtension_List.json + */ + /** + * Sample code: ReplicationExtension_List. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void replicationExtensionList( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .replicationExtensions() + .list("rgrecoveryservicesdatareplication", "4", com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceProvider_CheckNameAvailability + +```java +import com.azure.resourcemanager.recoveryservicesdatareplication.models.CheckNameAvailabilityModel; + +/** Samples for ResourceProvider CheckNameAvailability. */ +public final class ResourceProviderCheckNameAvailabilityS { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/CheckNameAvailability.json + */ + /** + * Sample code: CheckNameAvailability. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void checkNameAvailability( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .resourceProviders() + .checkNameAvailabilityWithResponse( + "trfqtbtmusswpibw", + new CheckNameAvailabilityModel().withName("updkdcixs").withType("gngmcancdauwhdixjjvqnfkvqc"), + com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceProvider_DeploymentPreflight + +```java +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.DeploymentPreflightModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.DeploymentPreflightResource; +import java.util.Arrays; + +/** Samples for ResourceProvider DeploymentPreflight. */ +public final class ResourceProviderDeploymentPreflightSam { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/DeploymentPreflight.json + */ + /** + * Sample code: DeploymentPreflight. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void deploymentPreflight( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .resourceProviders() + .deploymentPreflightWithResponse( + "rgrecoveryservicesdatareplication", + "kjoiahxljomjcmvabaobumg", + new DeploymentPreflightModelInner() + .withResources( + Arrays + .asList( + new DeploymentPreflightResource() + .withName("xtgugoflfc") + .withType("nsnaptduolqcxsikrewvgjbxqpt") + .withLocation("cbsgtxkjdzwbyp") + .withApiVersion("otihymhvzblycdoxo"))), + com.azure.core.util.Context.NONE); + } +} +``` + +### Vault_Create + +```java +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ReplicationVaultType; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.VaultModelProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Vault Create. */ +public final class VaultCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Vault_Create.json + */ + /** + * Sample code: Vault_Create. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void vaultCreate( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .vaults() + .define("4") + .withRegion("eck") + .withExistingResourceGroup("rgrecoveryservicesdatareplication") + .withTags(mapOf("key5359", "fakeTokenPlaceholder")) + .withProperties(new VaultModelProperties().withVaultType(ReplicationVaultType.DISASTER_RECOVERY)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Vault_Delete + +```java +/** Samples for Vault Delete. */ +public final class VaultDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Vault_Delete.json + */ + /** + * Sample code: Vault_Delete. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void vaultDelete( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager.vaults().delete("rgrecoveryservicesdatareplication", "4", com.azure.core.util.Context.NONE); + } +} +``` + +### Vault_GetByResourceGroup + +```java +/** Samples for Vault GetByResourceGroup. */ +public final class VaultGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Vault_Get.json + */ + /** + * Sample code: Vault_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void vaultGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .vaults() + .getByResourceGroupWithResponse("rgrecoveryservicesdatareplication", "4", com.azure.core.util.Context.NONE); + } +} +``` + +### Vault_List + +```java +/** Samples for Vault List. */ +public final class VaultListSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Vault_ListBySubscription.json + */ + /** + * Sample code: Vault_ListBySubscription. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void vaultListBySubscription( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager.vaults().list("dqsjhseyugyexxrlrln", com.azure.core.util.Context.NONE); + } +} +``` + +### Vault_ListByResourceGroup + +```java +/** Samples for Vault ListByResourceGroup. */ +public final class VaultListByResourceGroupSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Vault_List.json + */ + /** + * Sample code: Vault_List. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void vaultList( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .vaults() + .listByResourceGroup("rgrecoveryservicesdatareplication", "mwculdaqndp", com.azure.core.util.Context.NONE); + } +} +``` + +### Vault_Update + +```java +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ReplicationVaultType; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.VaultModel; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.VaultModelProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Vault Update. */ +public final class VaultUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Vault_Update.json + */ + /** + * Sample code: Vault_Update. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void vaultUpdate( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + VaultModel resource = + manager + .vaults() + .getByResourceGroupWithResponse( + "rgrecoveryservicesdatareplication", "4", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key8872", "fakeTokenPlaceholder")) + .withProperties(new VaultModelProperties().withVaultType(ReplicationVaultType.DISASTER_RECOVERY)) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VaultOperationStatus_Get + +```java +/** Samples for VaultOperationStatus Get. */ +public final class VaultOperationStatusGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/VaultOperationStatus_Get.json + */ + /** + * Sample code: VaultOperationStatus_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void vaultOperationStatusGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .vaultOperationStatus() + .getWithResponse("rgrecoveryservicesdatareplication", "4", "vsdvwe", com.azure.core.util.Context.NONE); + } +} +``` + +### Workflow_Get + +```java +/** Samples for Workflow Get. */ +public final class WorkflowGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Workflow_Get.json + */ + /** + * Sample code: Workflow_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void workflowGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .workflows() + .getWithResponse("rgrecoveryservicesdatareplication", "4", "ZGH4y", com.azure.core.util.Context.NONE); + } +} +``` + +### Workflow_List + +```java +/** Samples for Workflow List. */ +public final class WorkflowListSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Workflow_List.json + */ + /** + * Sample code: Workflow_List. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void workflowList( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .workflows() + .list( + "rgrecoveryservicesdatareplication", + "4", + "mnebpgmjcitjleipnttx", + "rdavrzbethhslmkqgajontnxsue", + com.azure.core.util.Context.NONE); + } +} +``` + +### WorkflowOperationStatus_Get + +```java +/** Samples for WorkflowOperationStatus Get. */ +public final class WorkflowOperationStatusGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/WorkflowOperationStatus_Get.json + */ + /** + * Sample code: WorkflowOperationStatus_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void workflowOperationStatusGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .workflowOperationStatus() + .getWithResponse( + "rgrecoveryservicesdatareplication", "4", "ZGH4y", "wdqcxc", com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/pom.xml b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/pom.xml new file mode 100644 index 000000000000..3e6956a41cb7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/pom.xml @@ -0,0 +1,62 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-recoveryservicesdatareplication + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Recovery Services Data Replication Management + This package contains Microsoft Azure SDK for Recovery Services Data Replication Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. A first party Azure service enabling the data replication. Package tag package-2021-02-16-preview. + 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 + 0 + 0 + true + + + + com.azure + azure-core + 1.44.1 + + + com.azure + azure-core-management + 1.11.7 + + + diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/RecoveryServicesDataReplicationManager.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/RecoveryServicesDataReplicationManager.java new file mode 100644 index 000000000000..f297fa2ba7e9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/RecoveryServicesDataReplicationManager.java @@ -0,0 +1,562 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication; + +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.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +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.RetryOptions; +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.recoveryservicesdatareplication.fluent.DataReplicationMgmtClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.implementation.DataReplicationMgmtClientBuilder; +import com.azure.resourcemanager.recoveryservicesdatareplication.implementation.DraOperationStatusImpl; +import com.azure.resourcemanager.recoveryservicesdatareplication.implementation.DrasImpl; +import com.azure.resourcemanager.recoveryservicesdatareplication.implementation.EmailConfigurationsImpl; +import com.azure.resourcemanager.recoveryservicesdatareplication.implementation.EventsImpl; +import com.azure.resourcemanager.recoveryservicesdatareplication.implementation.FabricOperationsStatusImpl; +import com.azure.resourcemanager.recoveryservicesdatareplication.implementation.FabricsImpl; +import com.azure.resourcemanager.recoveryservicesdatareplication.implementation.OperationsImpl; +import com.azure.resourcemanager.recoveryservicesdatareplication.implementation.PoliciesImpl; +import com.azure.resourcemanager.recoveryservicesdatareplication.implementation.PolicyOperationStatusImpl; +import com.azure.resourcemanager.recoveryservicesdatareplication.implementation.ProtectedItemOperationStatusImpl; +import com.azure.resourcemanager.recoveryservicesdatareplication.implementation.ProtectedItemsImpl; +import com.azure.resourcemanager.recoveryservicesdatareplication.implementation.RecoveryPointsImpl; +import com.azure.resourcemanager.recoveryservicesdatareplication.implementation.ReplicationExtensionsImpl; +import com.azure.resourcemanager.recoveryservicesdatareplication.implementation.ResourceProvidersImpl; +import com.azure.resourcemanager.recoveryservicesdatareplication.implementation.VaultOperationStatusImpl; +import com.azure.resourcemanager.recoveryservicesdatareplication.implementation.VaultsImpl; +import com.azure.resourcemanager.recoveryservicesdatareplication.implementation.WorkflowOperationStatusImpl; +import com.azure.resourcemanager.recoveryservicesdatareplication.implementation.WorkflowsImpl; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.DraOperationStatus; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.Dras; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.EmailConfigurations; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.Events; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.FabricOperationsStatus; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.Fabrics; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.Operations; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.Policies; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.PolicyOperationStatus; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ProtectedItemOperationStatus; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ProtectedItems; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.RecoveryPoints; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ReplicationExtensions; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ResourceProviders; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.VaultOperationStatus; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.Vaults; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.WorkflowOperationStatus; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.Workflows; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** Entry point to RecoveryServicesDataReplicationManager. A first party Azure service enabling the data replication. */ +public final class RecoveryServicesDataReplicationManager { + private Dras dras; + + private DraOperationStatus draOperationStatus; + + private EmailConfigurations emailConfigurations; + + private Events events; + + private Fabrics fabrics; + + private FabricOperationsStatus fabricOperationsStatus; + + private Policies policies; + + private PolicyOperationStatus policyOperationStatus; + + private ProtectedItems protectedItems; + + private ProtectedItemOperationStatus protectedItemOperationStatus; + + private RecoveryPoints recoveryPoints; + + private ReplicationExtensions replicationExtensions; + + private ResourceProviders resourceProviders; + + private Operations operations; + + private Vaults vaults; + + private VaultOperationStatus vaultOperationStatus; + + private Workflows workflows; + + private WorkflowOperationStatus workflowOperationStatus; + + private final DataReplicationMgmtClient clientObject; + + private RecoveryServicesDataReplicationManager( + HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new DataReplicationMgmtClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Recovery Services Data Replication service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Recovery Services Data Replication service API instance. + */ + public static RecoveryServicesDataReplicationManager authenticate( + TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of Recovery Services Data Replication service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Recovery Services Data Replication service API instance. + */ + public static RecoveryServicesDataReplicationManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new RecoveryServicesDataReplicationManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create RecoveryServicesDataReplicationManager with optional + * configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new RecoveryServicesDataReplicationManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private static 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 RetryOptions retryOptions; + 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 retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' 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, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of Recovery Services Data Replication service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Recovery Services Data Replication service API instance. + */ + public RecoveryServicesDataReplicationManager 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.recoveryservicesdatareplication") + .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) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new RecoveryServicesDataReplicationManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of Dras. It manages DraModel. + * + * @return Resource collection API of Dras. + */ + public Dras dras() { + if (this.dras == null) { + this.dras = new DrasImpl(clientObject.getDras(), this); + } + return dras; + } + + /** + * Gets the resource collection API of DraOperationStatus. + * + * @return Resource collection API of DraOperationStatus. + */ + public DraOperationStatus draOperationStatus() { + if (this.draOperationStatus == null) { + this.draOperationStatus = new DraOperationStatusImpl(clientObject.getDraOperationStatus(), this); + } + return draOperationStatus; + } + + /** + * Gets the resource collection API of EmailConfigurations. It manages EmailConfigurationModel. + * + * @return Resource collection API of EmailConfigurations. + */ + public EmailConfigurations emailConfigurations() { + if (this.emailConfigurations == null) { + this.emailConfigurations = new EmailConfigurationsImpl(clientObject.getEmailConfigurations(), this); + } + return emailConfigurations; + } + + /** + * Gets the resource collection API of Events. + * + * @return Resource collection API of Events. + */ + public Events events() { + if (this.events == null) { + this.events = new EventsImpl(clientObject.getEvents(), this); + } + return events; + } + + /** + * Gets the resource collection API of Fabrics. It manages FabricModel. + * + * @return Resource collection API of Fabrics. + */ + public Fabrics fabrics() { + if (this.fabrics == null) { + this.fabrics = new FabricsImpl(clientObject.getFabrics(), this); + } + return fabrics; + } + + /** + * Gets the resource collection API of FabricOperationsStatus. + * + * @return Resource collection API of FabricOperationsStatus. + */ + public FabricOperationsStatus fabricOperationsStatus() { + if (this.fabricOperationsStatus == null) { + this.fabricOperationsStatus = + new FabricOperationsStatusImpl(clientObject.getFabricOperationsStatus(), this); + } + return fabricOperationsStatus; + } + + /** + * Gets the resource collection API of Policies. It manages PolicyModel. + * + * @return Resource collection API of Policies. + */ + public Policies policies() { + if (this.policies == null) { + this.policies = new PoliciesImpl(clientObject.getPolicies(), this); + } + return policies; + } + + /** + * Gets the resource collection API of PolicyOperationStatus. + * + * @return Resource collection API of PolicyOperationStatus. + */ + public PolicyOperationStatus policyOperationStatus() { + if (this.policyOperationStatus == null) { + this.policyOperationStatus = new PolicyOperationStatusImpl(clientObject.getPolicyOperationStatus(), this); + } + return policyOperationStatus; + } + + /** + * Gets the resource collection API of ProtectedItems. It manages ProtectedItemModel. + * + * @return Resource collection API of ProtectedItems. + */ + public ProtectedItems protectedItems() { + if (this.protectedItems == null) { + this.protectedItems = new ProtectedItemsImpl(clientObject.getProtectedItems(), this); + } + return protectedItems; + } + + /** + * Gets the resource collection API of ProtectedItemOperationStatus. + * + * @return Resource collection API of ProtectedItemOperationStatus. + */ + public ProtectedItemOperationStatus protectedItemOperationStatus() { + if (this.protectedItemOperationStatus == null) { + this.protectedItemOperationStatus = + new ProtectedItemOperationStatusImpl(clientObject.getProtectedItemOperationStatus(), this); + } + return protectedItemOperationStatus; + } + + /** + * Gets the resource collection API of RecoveryPoints. + * + * @return Resource collection API of RecoveryPoints. + */ + public RecoveryPoints recoveryPoints() { + if (this.recoveryPoints == null) { + this.recoveryPoints = new RecoveryPointsImpl(clientObject.getRecoveryPoints(), this); + } + return recoveryPoints; + } + + /** + * Gets the resource collection API of ReplicationExtensions. It manages ReplicationExtensionModel. + * + * @return Resource collection API of ReplicationExtensions. + */ + public ReplicationExtensions replicationExtensions() { + if (this.replicationExtensions == null) { + this.replicationExtensions = new ReplicationExtensionsImpl(clientObject.getReplicationExtensions(), this); + } + return replicationExtensions; + } + + /** + * Gets the resource collection API of ResourceProviders. + * + * @return Resource collection API of ResourceProviders. + */ + public ResourceProviders resourceProviders() { + if (this.resourceProviders == null) { + this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); + } + return resourceProviders; + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of Vaults. It manages VaultModel. + * + * @return Resource collection API of Vaults. + */ + public Vaults vaults() { + if (this.vaults == null) { + this.vaults = new VaultsImpl(clientObject.getVaults(), this); + } + return vaults; + } + + /** + * Gets the resource collection API of VaultOperationStatus. + * + * @return Resource collection API of VaultOperationStatus. + */ + public VaultOperationStatus vaultOperationStatus() { + if (this.vaultOperationStatus == null) { + this.vaultOperationStatus = new VaultOperationStatusImpl(clientObject.getVaultOperationStatus(), this); + } + return vaultOperationStatus; + } + + /** + * Gets the resource collection API of Workflows. + * + * @return Resource collection API of Workflows. + */ + public Workflows workflows() { + if (this.workflows == null) { + this.workflows = new WorkflowsImpl(clientObject.getWorkflows(), this); + } + return workflows; + } + + /** + * Gets the resource collection API of WorkflowOperationStatus. + * + * @return Resource collection API of WorkflowOperationStatus. + */ + public WorkflowOperationStatus workflowOperationStatus() { + if (this.workflowOperationStatus == null) { + this.workflowOperationStatus = + new WorkflowOperationStatusImpl(clientObject.getWorkflowOperationStatus(), this); + } + return workflowOperationStatus; + } + + /** + * Gets wrapped service client DataReplicationMgmtClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. + * + * @return Wrapped service client DataReplicationMgmtClient. + */ + public DataReplicationMgmtClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/DataReplicationMgmtClient.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/DataReplicationMgmtClient.java new file mode 100644 index 000000000000..42c4665ce569 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/DataReplicationMgmtClient.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for DataReplicationMgmtClient class. */ +public interface DataReplicationMgmtClient { + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @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 DrasClient object to access its operations. + * + * @return the DrasClient object. + */ + DrasClient getDras(); + + /** + * Gets the DraOperationStatusClient object to access its operations. + * + * @return the DraOperationStatusClient object. + */ + DraOperationStatusClient getDraOperationStatus(); + + /** + * Gets the EmailConfigurationsClient object to access its operations. + * + * @return the EmailConfigurationsClient object. + */ + EmailConfigurationsClient getEmailConfigurations(); + + /** + * Gets the EventsClient object to access its operations. + * + * @return the EventsClient object. + */ + EventsClient getEvents(); + + /** + * Gets the FabricsClient object to access its operations. + * + * @return the FabricsClient object. + */ + FabricsClient getFabrics(); + + /** + * Gets the FabricOperationsStatusClient object to access its operations. + * + * @return the FabricOperationsStatusClient object. + */ + FabricOperationsStatusClient getFabricOperationsStatus(); + + /** + * Gets the PoliciesClient object to access its operations. + * + * @return the PoliciesClient object. + */ + PoliciesClient getPolicies(); + + /** + * Gets the PolicyOperationStatusClient object to access its operations. + * + * @return the PolicyOperationStatusClient object. + */ + PolicyOperationStatusClient getPolicyOperationStatus(); + + /** + * Gets the ProtectedItemsClient object to access its operations. + * + * @return the ProtectedItemsClient object. + */ + ProtectedItemsClient getProtectedItems(); + + /** + * Gets the ProtectedItemOperationStatusClient object to access its operations. + * + * @return the ProtectedItemOperationStatusClient object. + */ + ProtectedItemOperationStatusClient getProtectedItemOperationStatus(); + + /** + * Gets the RecoveryPointsClient object to access its operations. + * + * @return the RecoveryPointsClient object. + */ + RecoveryPointsClient getRecoveryPoints(); + + /** + * Gets the ReplicationExtensionsClient object to access its operations. + * + * @return the ReplicationExtensionsClient object. + */ + ReplicationExtensionsClient getReplicationExtensions(); + + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + ResourceProvidersClient getResourceProviders(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the VaultsClient object to access its operations. + * + * @return the VaultsClient object. + */ + VaultsClient getVaults(); + + /** + * Gets the VaultOperationStatusClient object to access its operations. + * + * @return the VaultOperationStatusClient object. + */ + VaultOperationStatusClient getVaultOperationStatus(); + + /** + * Gets the WorkflowsClient object to access its operations. + * + * @return the WorkflowsClient object. + */ + WorkflowsClient getWorkflows(); + + /** + * Gets the WorkflowOperationStatusClient object to access its operations. + * + * @return the WorkflowOperationStatusClient object. + */ + WorkflowOperationStatusClient getWorkflowOperationStatus(); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/DraOperationStatusClient.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/DraOperationStatusClient.java new file mode 100644 index 000000000000..81cf27313eb6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/DraOperationStatusClient.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.recoveryservicesdatareplication.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.OperationStatusInner; + +/** An instance of this class provides access to all the operations defined in DraOperationStatusClient. */ +public interface DraOperationStatusClient { + /** + * Gets the fabric agent (Dra) operation status. + * + *

Tracks the results of an asynchronous operation on the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) name. + * @param operationId The ID of an ongoing async operation. + * @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 defines the operation status along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String fabricName, String fabricAgentName, String operationId, Context context); + + /** + * Gets the fabric agent (Dra) operation status. + * + *

Tracks the results of an asynchronous operation on the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) name. + * @param operationId The ID of an ongoing async 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 defines the operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner get(String resourceGroupName, String fabricName, String fabricAgentName, String operationId); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/DrasClient.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/DrasClient.java new file mode 100644 index 000000000000..9cd00e37cd5a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/DrasClient.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.recoveryservicesdatareplication.fluent.models.DraModelInner; + +/** An instance of this class provides access to all the operations defined in DrasClient. */ +public interface DrasClient { + /** + * Gets the fabric agent (Dra). + * + *

Gets the details of the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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 the details of the fabric agent along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String fabricName, String fabricAgentName, Context context); + + /** + * Gets the fabric agent (Dra). + * + *

Gets the details of the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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 the details of the fabric agent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DraModelInner get(String resourceGroupName, String fabricName, String fabricAgentName); + + /** + * Puts the fabric agent (Dra). + * + *

Creates the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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 the {@link SyncPoller} for polling of dra model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DraModelInner> beginCreate( + String resourceGroupName, String fabricName, String fabricAgentName); + + /** + * Puts the fabric agent (Dra). + * + *

Creates the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) name. + * @param body Dra model. + * @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 {@link SyncPoller} for polling of dra model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DraModelInner> beginCreate( + String resourceGroupName, String fabricName, String fabricAgentName, DraModelInner body, Context context); + + /** + * Puts the fabric agent (Dra). + * + *

Creates the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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 dra model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DraModelInner create(String resourceGroupName, String fabricName, String fabricAgentName); + + /** + * Puts the fabric agent (Dra). + * + *

Creates the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) name. + * @param body Dra model. + * @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 dra model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DraModelInner create( + String resourceGroupName, String fabricName, String fabricAgentName, DraModelInner body, Context context); + + /** + * Deletes the fabric agent (Dra). + * + *

Deletes the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String fabricName, String fabricAgentName); + + /** + * Deletes the fabric agent (Dra). + * + *

Deletes the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String fabricName, String fabricAgentName, Context context); + + /** + * Deletes the fabric agent (Dra). + * + *

Deletes the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String fabricName, String fabricAgentName); + + /** + * Deletes the fabric agent (Dra). + * + *

Deletes the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String fabricName, String fabricAgentName, Context context); + + /** + * Lists the fabric agents (Dras). + * + *

Gets the list of fabric agents in the given fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the list of fabric agents in the given fabric as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String fabricName); + + /** + * Lists the fabric agents (Dras). + * + *

Gets the list of fabric agents in the given fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the list of fabric agents in the given fabric as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String fabricName, Context context); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/EmailConfigurationsClient.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/EmailConfigurationsClient.java new file mode 100644 index 000000000000..096fa4f7b4d8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/EmailConfigurationsClient.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.recoveryservicesdatareplication.fluent.models.EmailConfigurationModelInner; + +/** An instance of this class provides access to all the operations defined in EmailConfigurationsClient. */ +public interface EmailConfigurationsClient { + /** + * Gets the email configuration setting. + * + *

Gets the details of the alert configuration setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param emailConfigurationName The email configuration 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 the details of the alert configuration setting along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String vaultName, String emailConfigurationName, Context context); + + /** + * Gets the email configuration setting. + * + *

Gets the details of the alert configuration setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param emailConfigurationName The email configuration 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 the details of the alert configuration setting. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EmailConfigurationModelInner get(String resourceGroupName, String vaultName, String emailConfigurationName); + + /** + * Creates email configuration settings. + * + *

Creates an alert configuration setting for the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param emailConfigurationName The email configuration name. + * @param body EmailConfiguration model. + * @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 email configuration model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String vaultName, + String emailConfigurationName, + EmailConfigurationModelInner body, + Context context); + + /** + * Creates email configuration settings. + * + *

Creates an alert configuration setting for the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param emailConfigurationName The email configuration 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 email configuration model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EmailConfigurationModelInner create(String resourceGroupName, String vaultName, String emailConfigurationName); + + /** + * Lists the email configuration settings. + * + *

Gets the list of alert configuration settings for the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of alert configuration settings for the given vault as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName); + + /** + * Lists the email configuration settings. + * + *

Gets the list of alert configuration settings for the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of alert configuration settings for the given vault as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName, Context context); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/EventsClient.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/EventsClient.java new file mode 100644 index 000000000000..34ade5930ee5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/EventsClient.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.recoveryservicesdatareplication.fluent.models.EventModelInner; + +/** An instance of this class provides access to all the operations defined in EventsClient. */ +public interface EventsClient { + /** + * Gets the event. + * + *

Gets the details of the event. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param eventName The event 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 the details of the event along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String vaultName, String eventName, Context context); + + /** + * Gets the event. + * + *

Gets the details of the event. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param eventName The event 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 the details of the event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EventModelInner get(String resourceGroupName, String vaultName, String eventName); + + /** + * Lists the events. + * + *

Gets the list of events in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of events in the given vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName); + + /** + * Lists the events. + * + *

Gets the list of events in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param filter Filter string. + * @param continuationToken Continuation token. + * @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 list of events in the given vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String vaultName, String filter, String continuationToken, Context context); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/FabricOperationsStatusClient.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/FabricOperationsStatusClient.java new file mode 100644 index 000000000000..dafc327e5435 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/FabricOperationsStatusClient.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.OperationStatusInner; + +/** An instance of this class provides access to all the operations defined in FabricOperationsStatusClient. */ +public interface FabricOperationsStatusClient { + /** + * Gets the fabric operation status. + * + *

Tracks the results of an asynchronous operation on the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param operationId The ID of an ongoing async operation. + * @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 defines the operation status along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String fabricName, String operationId, Context context); + + /** + * Gets the fabric operation status. + * + *

Tracks the results of an asynchronous operation on the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param operationId The ID of an ongoing async 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 defines the operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner get(String resourceGroupName, String fabricName, String operationId); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/FabricsClient.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/FabricsClient.java new file mode 100644 index 000000000000..51a039432017 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/FabricsClient.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.recoveryservicesdatareplication.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.recoveryservicesdatareplication.fluent.models.FabricModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.FabricModelUpdate; + +/** An instance of this class provides access to all the operations defined in FabricsClient. */ +public interface FabricsClient { + /** + * Gets the fabric. + * + *

Gets the details of the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the details of the fabric along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String fabricName, Context context); + + /** + * Gets the fabric. + * + *

Gets the details of the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the details of the fabric. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FabricModelInner getByResourceGroup(String resourceGroupName, String fabricName); + + /** + * Puts the fabric. + * + *

Creates the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the {@link SyncPoller} for polling of fabric model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FabricModelInner> beginCreate(String resourceGroupName, String fabricName); + + /** + * Puts the fabric. + * + *

Creates the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param body Fabric properties. + * @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 {@link SyncPoller} for polling of fabric model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FabricModelInner> beginCreate( + String resourceGroupName, String fabricName, FabricModelInner body, Context context); + + /** + * Puts the fabric. + * + *

Creates the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 fabric model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FabricModelInner create(String resourceGroupName, String fabricName); + + /** + * Puts the fabric. + * + *

Creates the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param body Fabric properties. + * @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 fabric model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FabricModelInner create(String resourceGroupName, String fabricName, FabricModelInner body, Context context); + + /** + * Updates the fabric. + * + *

Performs update on the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the {@link SyncPoller} for polling of fabric model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FabricModelInner> beginUpdate(String resourceGroupName, String fabricName); + + /** + * Updates the fabric. + * + *

Performs update on the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param body Fabric properties. + * @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 {@link SyncPoller} for polling of fabric model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FabricModelInner> beginUpdate( + String resourceGroupName, String fabricName, FabricModelUpdate body, Context context); + + /** + * Updates the fabric. + * + *

Performs update on the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 fabric model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FabricModelInner update(String resourceGroupName, String fabricName); + + /** + * Updates the fabric. + * + *

Performs update on the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param body Fabric properties. + * @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 fabric model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FabricModelInner update(String resourceGroupName, String fabricName, FabricModelUpdate body, Context context); + + /** + * Deletes the fabric. + * + *

Removes the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String fabricName); + + /** + * Deletes the fabric. + * + *

Removes the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String fabricName, Context context); + + /** + * Deletes the fabric. + * + *

Removes the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String fabricName); + + /** + * Deletes the fabric. + * + *

Removes the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String fabricName, Context context); + + /** + * Lists the fabrics. + * + *

Gets the list of fabrics in the given 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 the list of fabrics in the given subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists the fabrics. + * + *

Gets the list of fabrics in the given subscription. + * + * @param continuationToken Continuation token from the previous call. + * @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 list of fabrics in the given subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String continuationToken, Context context); + + /** + * Lists the fabrics. + * + *

Gets the list of fabrics in the given subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of fabrics in the given subscription and resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists the fabrics. + * + *

Gets the list of fabrics in the given subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param continuationToken Continuation token from the previous call. + * @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 list of fabrics in the given subscription and resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup( + String resourceGroupName, String continuationToken, Context context); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/OperationsClient.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/OperationsClient.java new file mode 100644 index 000000000000..c813cc908f3a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/OperationsClient.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.recoveryservicesdatareplication.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Get a list of REST API operations supported by Microsoft.DataReplication. + * + *

Gets the operations. + * + * @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 operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Get a list of REST API operations supported by Microsoft.DataReplication. + * + *

Gets the operations. + * + * @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 operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/PoliciesClient.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/PoliciesClient.java new file mode 100644 index 000000000000..90879c87982f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/PoliciesClient.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.recoveryservicesdatareplication.fluent.models.PolicyModelInner; + +/** An instance of this class provides access to all the operations defined in PoliciesClient. */ +public interface PoliciesClient { + /** + * Gets the policy. + * + *

Gets the details of the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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 the details of the policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String vaultName, String policyName, Context context); + + /** + * Gets the policy. + * + *

Gets the details of the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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 the details of the policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicyModelInner get(String resourceGroupName, String vaultName, String policyName); + + /** + * Puts the policy. + * + *

Creates the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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 the {@link SyncPoller} for polling of policy model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PolicyModelInner> beginCreate( + String resourceGroupName, String vaultName, String policyName); + + /** + * Puts the policy. + * + *

Creates the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy name. + * @param body Policy model. + * @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 {@link SyncPoller} for polling of policy model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PolicyModelInner> beginCreate( + String resourceGroupName, String vaultName, String policyName, PolicyModelInner body, Context context); + + /** + * Puts the policy. + * + *

Creates the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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 policy model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicyModelInner create(String resourceGroupName, String vaultName, String policyName); + + /** + * Puts the policy. + * + *

Creates the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy name. + * @param body Policy model. + * @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 policy model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicyModelInner create( + String resourceGroupName, String vaultName, String policyName, PolicyModelInner body, Context context); + + /** + * Deletes the policy. + * + *

Removes the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String vaultName, String policyName); + + /** + * Deletes the policy. + * + *

Removes the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String vaultName, String policyName, Context context); + + /** + * Deletes the policy. + * + *

Removes the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String vaultName, String policyName); + + /** + * Deletes the policy. + * + *

Removes the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String vaultName, String policyName, Context context); + + /** + * Lists the policies. + * + *

Gets the list of policies in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of policies in the given vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName); + + /** + * Lists the policies. + * + *

Gets the list of policies in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of policies in the given vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName, Context context); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/PolicyOperationStatusClient.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/PolicyOperationStatusClient.java new file mode 100644 index 000000000000..59da78967828 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/PolicyOperationStatusClient.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.recoveryservicesdatareplication.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.OperationStatusInner; + +/** An instance of this class provides access to all the operations defined in PolicyOperationStatusClient. */ +public interface PolicyOperationStatusClient { + /** + * Gets the policy operation status. + * + *

Tracks the results of an asynchronous operation on the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy name. + * @param operationId The ID of an ongoing async operation. + * @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 defines the operation status along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String vaultName, String policyName, String operationId, Context context); + + /** + * Gets the policy operation status. + * + *

Tracks the results of an asynchronous operation on the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy name. + * @param operationId The ID of an ongoing async 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 defines the operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner get(String resourceGroupName, String vaultName, String policyName, String operationId); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/ProtectedItemOperationStatusClient.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/ProtectedItemOperationStatusClient.java new file mode 100644 index 000000000000..a8f78f60b39b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/ProtectedItemOperationStatusClient.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.recoveryservicesdatareplication.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.OperationStatusInner; + +/** An instance of this class provides access to all the operations defined in ProtectedItemOperationStatusClient. */ +public interface ProtectedItemOperationStatusClient { + /** + * Gets the protected item operation status. + * + *

Tracks the results of an asynchronous operation on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param operationId The ID of an ongoing async operation. + * @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 defines the operation status along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String vaultName, String protectedItemName, String operationId, Context context); + + /** + * Gets the protected item operation status. + * + *

Tracks the results of an asynchronous operation on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param operationId The ID of an ongoing async 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 defines the operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner get(String resourceGroupName, String vaultName, String protectedItemName, String operationId); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/ProtectedItemsClient.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/ProtectedItemsClient.java new file mode 100644 index 000000000000..aa4130a45ef7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/ProtectedItemsClient.java @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.recoveryservicesdatareplication.fluent.models.PlannedFailoverModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.ProtectedItemModelInner; + +/** An instance of this class provides access to all the operations defined in ProtectedItemsClient. */ +public interface ProtectedItemsClient { + /** + * Gets the protected item. + * + *

Gets the details of the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 the details of the protected item along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String vaultName, String protectedItemName, Context context); + + /** + * Gets the protected item. + * + *

Gets the details of the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 the details of the protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProtectedItemModelInner get(String resourceGroupName, String vaultName, String protectedItemName); + + /** + * Puts the protected item. + * + *

Creates the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 the {@link SyncPoller} for polling of protected item model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProtectedItemModelInner> beginCreate( + String resourceGroupName, String vaultName, String protectedItemName); + + /** + * Puts the protected item. + * + *

Creates the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param body Protected item model. + * @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 {@link SyncPoller} for polling of protected item model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProtectedItemModelInner> beginCreate( + String resourceGroupName, + String vaultName, + String protectedItemName, + ProtectedItemModelInner body, + Context context); + + /** + * Puts the protected item. + * + *

Creates the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 protected item model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProtectedItemModelInner create(String resourceGroupName, String vaultName, String protectedItemName); + + /** + * Puts the protected item. + * + *

Creates the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param body Protected item model. + * @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 protected item model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProtectedItemModelInner create( + String resourceGroupName, + String vaultName, + String protectedItemName, + ProtectedItemModelInner body, + Context context); + + /** + * Deletes the protected item. + * + *

Removes the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String vaultName, String protectedItemName); + + /** + * Deletes the protected item. + * + *

Removes the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param forceDelete A flag indicating whether to do force delete or not. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String vaultName, String protectedItemName, Boolean forceDelete, Context context); + + /** + * Deletes the protected item. + * + *

Removes the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String vaultName, String protectedItemName); + + /** + * Deletes the protected item. + * + *

Removes the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param forceDelete A flag indicating whether to do force delete or not. + * @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 vaultName, String protectedItemName, Boolean forceDelete, Context context); + + /** + * Lists the protected items. + * + *

Gets the list of protected items in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of protected items in the given vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName); + + /** + * Lists the protected items. + * + *

Gets the list of protected items in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of protected items in the given vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName, Context context); + + /** + * Performs planned failover. + * + *

Performs the planned failover on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 the {@link SyncPoller} for polling of planned failover model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PlannedFailoverModelInner> beginPlannedFailover( + String resourceGroupName, String vaultName, String protectedItemName); + + /** + * Performs planned failover. + * + *

Performs the planned failover on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param body Planned failover model. + * @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 {@link SyncPoller} for polling of planned failover model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PlannedFailoverModelInner> beginPlannedFailover( + String resourceGroupName, + String vaultName, + String protectedItemName, + PlannedFailoverModelInner body, + Context context); + + /** + * Performs planned failover. + * + *

Performs the planned failover on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 planned failover model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PlannedFailoverModelInner plannedFailover(String resourceGroupName, String vaultName, String protectedItemName); + + /** + * Performs planned failover. + * + *

Performs the planned failover on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param body Planned failover model. + * @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 planned failover model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PlannedFailoverModelInner plannedFailover( + String resourceGroupName, + String vaultName, + String protectedItemName, + PlannedFailoverModelInner body, + Context context); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/RecoveryPointsClient.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/RecoveryPointsClient.java new file mode 100644 index 000000000000..69ad46dbaed2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/RecoveryPointsClient.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.recoveryservicesdatareplication.fluent.models.RecoveryPointModelInner; + +/** An instance of this class provides access to all the operations defined in RecoveryPointsClient. */ +public interface RecoveryPointsClient { + /** + * Gets the recovery point. + * + *

Gets the details of the recovery point of a protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param recoveryPointName The recovery point 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 the details of the recovery point of a protected item along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String vaultName, + String protectedItemName, + String recoveryPointName, + Context context); + + /** + * Gets the recovery point. + * + *

Gets the details of the recovery point of a protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param recoveryPointName The recovery point 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 the details of the recovery point of a protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPointModelInner get( + String resourceGroupName, String vaultName, String protectedItemName, String recoveryPointName); + + /** + * Lists the recovery points. + * + *

Gets the list of recovery points of the given protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 the list of recovery points of the given protected item as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName, String protectedItemName); + + /** + * Lists the recovery points. + * + *

Gets the list of recovery points of the given protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 the list of recovery points of the given protected item as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String vaultName, String protectedItemName, Context context); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/ReplicationExtensionsClient.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/ReplicationExtensionsClient.java new file mode 100644 index 000000000000..e1eac7ec15fd --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/ReplicationExtensionsClient.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.recoveryservicesdatareplication.fluent.models.ReplicationExtensionModelInner; + +/** An instance of this class provides access to all the operations defined in ReplicationExtensionsClient. */ +public interface ReplicationExtensionsClient { + /** + * Gets the replication extension. + * + *

Gets the details of the replication extension. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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 the details of the replication extension along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String vaultName, String replicationExtensionName, Context context); + + /** + * Gets the replication extension. + * + *

Gets the details of the replication extension. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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 the details of the replication extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationExtensionModelInner get(String resourceGroupName, String vaultName, String replicationExtensionName); + + /** + * Puts the replication extension. + * + *

Creates the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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 the {@link SyncPoller} for polling of replication extension model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationExtensionModelInner> beginCreate( + String resourceGroupName, String vaultName, String replicationExtensionName); + + /** + * Puts the replication extension. + * + *

Creates the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension name. + * @param body Replication extension model. + * @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 {@link SyncPoller} for polling of replication extension model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationExtensionModelInner> beginCreate( + String resourceGroupName, + String vaultName, + String replicationExtensionName, + ReplicationExtensionModelInner body, + Context context); + + /** + * Puts the replication extension. + * + *

Creates the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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 replication extension model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationExtensionModelInner create(String resourceGroupName, String vaultName, String replicationExtensionName); + + /** + * Puts the replication extension. + * + *

Creates the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension name. + * @param body Replication extension model. + * @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 replication extension model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationExtensionModelInner create( + String resourceGroupName, + String vaultName, + String replicationExtensionName, + ReplicationExtensionModelInner body, + Context context); + + /** + * Deletes the replication extension. + * + *

Deletes the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String vaultName, String replicationExtensionName); + + /** + * Deletes the replication extension. + * + *

Deletes the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String vaultName, String replicationExtensionName, Context context); + + /** + * Deletes the replication extension. + * + *

Deletes the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String vaultName, String replicationExtensionName); + + /** + * Deletes the replication extension. + * + *

Deletes the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String vaultName, String replicationExtensionName, Context context); + + /** + * Lists the replication extensions. + * + *

Gets the list of replication extensions in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of replication extensions in the given vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName); + + /** + * Lists the replication extensions. + * + *

Gets the list of replication extensions in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of replication extensions in the given vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName, Context context); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/ResourceProvidersClient.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/ResourceProvidersClient.java new file mode 100644 index 000000000000..5039b1528e62 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/ResourceProvidersClient.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.recoveryservicesdatareplication.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.CheckNameAvailabilityResponseModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.DeploymentPreflightModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.CheckNameAvailabilityModel; + +/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +public interface ResourceProvidersClient { + /** + * Performs the resource name availability check. + * + *

Checks the resource name availability. + * + * @param location The name of the Azure region. + * @param body Resource details. + * @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 check name availability response model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + String location, CheckNameAvailabilityModel body, Context context); + + /** + * Performs the resource name availability check. + * + *

Checks the resource name availability. + * + * @param location The name of the Azure region. + * @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 check name availability response model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameAvailabilityResponseModelInner checkNameAvailability(String location); + + /** + * Performs resource deployment validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentId Deployment Id. + * @param body Deployment preflight model. + * @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 deployment preflight model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deploymentPreflightWithResponse( + String resourceGroupName, String deploymentId, DeploymentPreflightModelInner body, Context context); + + /** + * Performs resource deployment validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentId Deployment 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 deployment preflight model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentPreflightModelInner deploymentPreflight(String resourceGroupName, String deploymentId); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/VaultOperationStatusClient.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/VaultOperationStatusClient.java new file mode 100644 index 000000000000..8c72293909b4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/VaultOperationStatusClient.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.OperationStatusInner; + +/** An instance of this class provides access to all the operations defined in VaultOperationStatusClient. */ +public interface VaultOperationStatusClient { + /** + * Gets the vault operation status. + * + *

Tracks the results of an asynchronous operation on the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param operationId The ID of an ongoing async operation. + * @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 defines the operation status along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String vaultName, String operationId, Context context); + + /** + * Gets the vault operation status. + * + *

Tracks the results of an asynchronous operation on the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param operationId The ID of an ongoing async 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 defines the operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner get(String resourceGroupName, String vaultName, String operationId); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/VaultsClient.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/VaultsClient.java new file mode 100644 index 000000000000..e68c5fe455ae --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/VaultsClient.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.recoveryservicesdatareplication.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.recoveryservicesdatareplication.fluent.models.VaultModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.VaultModelUpdate; + +/** An instance of this class provides access to all the operations defined in VaultsClient. */ +public interface VaultsClient { + /** + * Gets the vault. + * + *

Gets the details of the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the details of the vault along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String vaultName, Context context); + + /** + * Gets the vault. + * + *

Gets the details of the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the details of the vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VaultModelInner getByResourceGroup(String resourceGroupName, String vaultName); + + /** + * Puts the vault. + * + *

Creates the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the {@link SyncPoller} for polling of vault model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VaultModelInner> beginCreate(String resourceGroupName, String vaultName); + + /** + * Puts the vault. + * + *

Creates the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param body Vault properties. + * @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 {@link SyncPoller} for polling of vault model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VaultModelInner> beginCreate( + String resourceGroupName, String vaultName, VaultModelInner body, Context context); + + /** + * Puts the vault. + * + *

Creates the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 vault model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VaultModelInner create(String resourceGroupName, String vaultName); + + /** + * Puts the vault. + * + *

Creates the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param body Vault properties. + * @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 vault model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VaultModelInner create(String resourceGroupName, String vaultName, VaultModelInner body, Context context); + + /** + * Updates the vault. + * + *

Performs update on the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the {@link SyncPoller} for polling of vault model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VaultModelInner> beginUpdate(String resourceGroupName, String vaultName); + + /** + * Updates the vault. + * + *

Performs update on the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param body Vault properties. + * @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 {@link SyncPoller} for polling of vault model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VaultModelInner> beginUpdate( + String resourceGroupName, String vaultName, VaultModelUpdate body, Context context); + + /** + * Updates the vault. + * + *

Performs update on the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 vault model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VaultModelInner update(String resourceGroupName, String vaultName); + + /** + * Updates the vault. + * + *

Performs update on the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param body Vault properties. + * @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 vault model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VaultModelInner update(String resourceGroupName, String vaultName, VaultModelUpdate body, Context context); + + /** + * Deletes the vault. + * + *

Removes the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String vaultName); + + /** + * Deletes the vault. + * + *

Removes the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String vaultName, Context context); + + /** + * Deletes the vault. + * + *

Removes the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String vaultName); + + /** + * Deletes the vault. + * + *

Removes the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String vaultName, Context context); + + /** + * Lists the vaults. + * + *

Gets the list of vaults in the given 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 the list of vaults in the given subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists the vaults. + * + *

Gets the list of vaults in the given subscription. + * + * @param continuationToken Continuation token from the previous call. + * @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 list of vaults in the given subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String continuationToken, Context context); + + /** + * Lists the vaults. + * + *

Gets the list of vaults in the given subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of vaults in the given subscription and resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists the vaults. + * + *

Gets the list of vaults in the given subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param continuationToken Continuation token from the previous call. + * @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 list of vaults in the given subscription and resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup( + String resourceGroupName, String continuationToken, Context context); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/WorkflowOperationStatusClient.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/WorkflowOperationStatusClient.java new file mode 100644 index 000000000000..dc7b2655cbc2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/WorkflowOperationStatusClient.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.recoveryservicesdatareplication.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.OperationStatusInner; + +/** An instance of this class provides access to all the operations defined in WorkflowOperationStatusClient. */ +public interface WorkflowOperationStatusClient { + /** + * Gets the job (workflow) operation status. + * + *

Tracks the results of an asynchronous operation on the job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param jobName The job (workflow) name. + * @param operationId The ID of an ongoing async operation. + * @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 defines the operation status along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String vaultName, String jobName, String operationId, Context context); + + /** + * Gets the job (workflow) operation status. + * + *

Tracks the results of an asynchronous operation on the job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param jobName The job (workflow) name. + * @param operationId The ID of an ongoing async 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 defines the operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner get(String resourceGroupName, String vaultName, String jobName, String operationId); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/WorkflowsClient.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/WorkflowsClient.java new file mode 100644 index 000000000000..acebd69ae35f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/WorkflowsClient.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.recoveryservicesdatareplication.fluent.models.WorkflowModelInner; + +/** An instance of this class provides access to all the operations defined in WorkflowsClient. */ +public interface WorkflowsClient { + /** + * Gets the job (workflow). + * + *

Gets the details of the job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param jobName The job (workflow) 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 the details of the job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String vaultName, String jobName, Context context); + + /** + * Gets the job (workflow). + * + *

Gets the details of the job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param jobName The job (workflow) 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 the details of the job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkflowModelInner get(String resourceGroupName, String vaultName, String jobName); + + /** + * Lists the jobs (workflows). + * + *

Gets the list of jobs in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of jobs in the given vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName); + + /** + * Lists the jobs (workflows). + * + *

Gets the list of jobs in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param filter Filter string. + * @param continuationToken Continuation token. + * @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 list of jobs in the given vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String vaultName, String filter, String continuationToken, Context context); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/CheckNameAvailabilityResponseModelInner.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/CheckNameAvailabilityResponseModelInner.java new file mode 100644 index 000000000000..0b993bb11ea6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/CheckNameAvailabilityResponseModelInner.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.recoveryservicesdatareplication.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Check name availability response model. */ +@Fluent +public final class CheckNameAvailabilityResponseModelInner { + /* + * Gets or sets a value indicating whether resource name is available or not. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /* + * Gets or sets the reason for resource name unavailability. + */ + @JsonProperty(value = "reason") + private String reason; + + /* + * Gets or sets the message for resource name unavailability. + */ + @JsonProperty(value = "message") + private String message; + + /** Creates an instance of CheckNameAvailabilityResponseModelInner class. */ + public CheckNameAvailabilityResponseModelInner() { + } + + /** + * Get the nameAvailable property: Gets or sets a value indicating whether resource name is available or not. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set the nameAvailable property: Gets or sets a value indicating whether resource name is available or not. + * + * @param nameAvailable the nameAvailable value to set. + * @return the CheckNameAvailabilityResponseModelInner object itself. + */ + public CheckNameAvailabilityResponseModelInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get the reason property: Gets or sets the reason for resource name unavailability. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason property: Gets or sets the reason for resource name unavailability. + * + * @param reason the reason value to set. + * @return the CheckNameAvailabilityResponseModelInner object itself. + */ + public CheckNameAvailabilityResponseModelInner withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get the message property: Gets or sets the message for resource name unavailability. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Gets or sets the message for resource name unavailability. + * + * @param message the message value to set. + * @return the CheckNameAvailabilityResponseModelInner object itself. + */ + public CheckNameAvailabilityResponseModelInner withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/DeploymentPreflightModelInner.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/DeploymentPreflightModelInner.java new file mode 100644 index 000000000000..0188f1f04da4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/DeploymentPreflightModelInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.DeploymentPreflightResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Deployment preflight model. */ +@Fluent +public final class DeploymentPreflightModelInner { + /* + * Gets or sets the list of resources. + */ + @JsonProperty(value = "resources") + private List resources; + + /** Creates an instance of DeploymentPreflightModelInner class. */ + public DeploymentPreflightModelInner() { + } + + /** + * Get the resources property: Gets or sets the list of resources. + * + * @return the resources value. + */ + public List resources() { + return this.resources; + } + + /** + * Set the resources property: Gets or sets the list of resources. + * + * @param resources the resources value to set. + * @return the DeploymentPreflightModelInner object itself. + */ + public DeploymentPreflightModelInner withResources(List resources) { + this.resources = resources; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resources() != null) { + resources().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/DraModelInner.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/DraModelInner.java new file mode 100644 index 000000000000..61433c10de18 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/DraModelInner.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.recoveryservicesdatareplication.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.DraModelProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.DraModelSystemData; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Dra model. */ +@Fluent +public final class DraModelInner extends ProxyResource { + /* + * Dra model properties. + */ + @JsonProperty(value = "properties", required = true) + private DraModelProperties properties; + + /* + * The systemData property. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private DraModelSystemData systemData; + + /** Creates an instance of DraModelInner class. */ + public DraModelInner() { + } + + /** + * Get the properties property: Dra model properties. + * + * @return the properties value. + */ + public DraModelProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Dra model properties. + * + * @param properties the properties value to set. + * @return the DraModelInner object itself. + */ + public DraModelInner withProperties(DraModelProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: The systemData property. + * + * @return the systemData value. + */ + public DraModelSystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property properties in model DraModelInner")); + } else { + properties().validate(); + } + if (systemData() != null) { + systemData().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DraModelInner.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/EmailConfigurationModelInner.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/EmailConfigurationModelInner.java new file mode 100644 index 000000000000..1755aac773cc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/EmailConfigurationModelInner.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.EmailConfigurationModelProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.EmailConfigurationModelSystemData; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Email configuration model. */ +@Fluent +public final class EmailConfigurationModelInner extends ProxyResource { + /* + * Email configuration model properties. + */ + @JsonProperty(value = "properties", required = true) + private EmailConfigurationModelProperties properties; + + /* + * The systemData property. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private EmailConfigurationModelSystemData systemData; + + /** Creates an instance of EmailConfigurationModelInner class. */ + public EmailConfigurationModelInner() { + } + + /** + * Get the properties property: Email configuration model properties. + * + * @return the properties value. + */ + public EmailConfigurationModelProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Email configuration model properties. + * + * @param properties the properties value to set. + * @return the EmailConfigurationModelInner object itself. + */ + public EmailConfigurationModelInner withProperties(EmailConfigurationModelProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: The systemData property. + * + * @return the systemData value. + */ + public EmailConfigurationModelSystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property properties in model EmailConfigurationModelInner")); + } else { + properties().validate(); + } + if (systemData() != null) { + systemData().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EmailConfigurationModelInner.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/EventModelInner.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/EventModelInner.java new file mode 100644 index 000000000000..fd243395da53 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/EventModelInner.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.EventModelProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.EventModelSystemData; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Event model. */ +@Fluent +public final class EventModelInner { + /* + * Event model properties. + */ + @JsonProperty(value = "properties", required = true) + private EventModelProperties properties; + + /* + * Gets or sets the Id of the resource. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Gets or sets the name of the resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Gets or sets the type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The systemData property. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private EventModelSystemData systemData; + + /** Creates an instance of EventModelInner class. */ + public EventModelInner() { + } + + /** + * Get the properties property: Event model properties. + * + * @return the properties value. + */ + public EventModelProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Event model properties. + * + * @param properties the properties value to set. + * @return the EventModelInner object itself. + */ + public EventModelInner withProperties(EventModelProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the id property: Gets or sets the Id of the resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Gets or sets the name of the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Gets or sets the type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the systemData property: The systemData property. + * + * @return the systemData value. + */ + public EventModelSystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property properties in model EventModelInner")); + } else { + properties().validate(); + } + if (systemData() != null) { + systemData().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EventModelInner.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/FabricModelInner.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/FabricModelInner.java new file mode 100644 index 000000000000..e6a5ae3e56b4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/FabricModelInner.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.recoveryservicesdatareplication.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.recoveryservicesdatareplication.models.FabricModelProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.FabricModelSystemData; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Fabric model. */ +@Fluent +public final class FabricModelInner extends Resource { + /* + * Fabric model properties. + */ + @JsonProperty(value = "properties", required = true) + private FabricModelProperties properties; + + /* + * The systemData property. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private FabricModelSystemData systemData; + + /** Creates an instance of FabricModelInner class. */ + public FabricModelInner() { + } + + /** + * Get the properties property: Fabric model properties. + * + * @return the properties value. + */ + public FabricModelProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Fabric model properties. + * + * @param properties the properties value to set. + * @return the FabricModelInner object itself. + */ + public FabricModelInner withProperties(FabricModelProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: The systemData property. + * + * @return the systemData value. + */ + public FabricModelSystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public FabricModelInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public FabricModelInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property properties in model FabricModelInner")); + } else { + properties().validate(); + } + if (systemData() != null) { + systemData().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FabricModelInner.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/OperationInner.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/OperationInner.java new file mode 100644 index 000000000000..24a315524ee1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/OperationInner.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ActionType; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.OperationDisplay; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.Origin; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * REST API Operation + * + *

Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Fluent +public final class OperationInner { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for + * ARM/control-plane operations. + */ + @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private Origin origin; + + /* + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) + private ActionType actionType; + + /** Creates an instance of OperationInner class. */ + public OperationInner() { + } + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Localized display information for this particular operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/OperationStatusInner.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/OperationStatusInner.java new file mode 100644 index 000000000000..5f2d68e766cb --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/OperationStatusInner.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the operation status. */ +@Fluent +public final class OperationStatusInner { + /* + * Gets or sets the Id. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Gets or sets the operation name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Gets or sets the status of the operation. ARM expects the terminal status to be one of + * Succeeded/ Failed/ Canceled. All other values imply that the operation is still running. + */ + @JsonProperty(value = "status") + private String status; + + /* + * Gets or sets the start time. + */ + @JsonProperty(value = "startTime") + private String startTime; + + /* + * Gets or sets the end time. + */ + @JsonProperty(value = "endTime") + private String endTime; + + /** Creates an instance of OperationStatusInner class. */ + public OperationStatusInner() { + } + + /** + * Get the id property: Gets or sets the Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Gets or sets the Id. + * + * @param id the id value to set. + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: Gets or sets the operation name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets or sets the operation name. + * + * @param name the name value to set. + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the status property: Gets or sets the status of the operation. ARM expects the terminal status to be one of + * Succeeded/ Failed/ Canceled. All other values imply that the operation is still running. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Gets or sets the status of the operation. ARM expects the terminal status to be one of + * Succeeded/ Failed/ Canceled. All other values imply that the operation is still running. + * + * @param status the status value to set. + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the startTime property: Gets or sets the start time. + * + * @return the startTime value. + */ + public String startTime() { + return this.startTime; + } + + /** + * Set the startTime property: Gets or sets the start time. + * + * @param startTime the startTime value to set. + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withStartTime(String startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: Gets or sets the end time. + * + * @return the endTime value. + */ + public String endTime() { + return this.endTime; + } + + /** + * Set the endTime property: Gets or sets the end time. + * + * @param endTime the endTime value to set. + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withEndTime(String endTime) { + this.endTime = endTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/PlannedFailoverModelInner.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/PlannedFailoverModelInner.java new file mode 100644 index 000000000000..41a00f4892cf --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/PlannedFailoverModelInner.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.PlannedFailoverModelProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Planned failover model. */ +@Fluent +public final class PlannedFailoverModelInner { + /* + * Planned failover model properties. + */ + @JsonProperty(value = "properties", required = true) + private PlannedFailoverModelProperties properties; + + /** Creates an instance of PlannedFailoverModelInner class. */ + public PlannedFailoverModelInner() { + } + + /** + * Get the properties property: Planned failover model properties. + * + * @return the properties value. + */ + public PlannedFailoverModelProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Planned failover model properties. + * + * @param properties the properties value to set. + * @return the PlannedFailoverModelInner object itself. + */ + public PlannedFailoverModelInner withProperties(PlannedFailoverModelProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property properties in model PlannedFailoverModelInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PlannedFailoverModelInner.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/PolicyModelInner.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/PolicyModelInner.java new file mode 100644 index 000000000000..e8562adf874d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/PolicyModelInner.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.recoveryservicesdatareplication.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.PolicyModelProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.PolicyModelSystemData; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Policy model. */ +@Fluent +public final class PolicyModelInner extends ProxyResource { + /* + * Policy model properties. + */ + @JsonProperty(value = "properties", required = true) + private PolicyModelProperties properties; + + /* + * The systemData property. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private PolicyModelSystemData systemData; + + /** Creates an instance of PolicyModelInner class. */ + public PolicyModelInner() { + } + + /** + * Get the properties property: Policy model properties. + * + * @return the properties value. + */ + public PolicyModelProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Policy model properties. + * + * @param properties the properties value to set. + * @return the PolicyModelInner object itself. + */ + public PolicyModelInner withProperties(PolicyModelProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: The systemData property. + * + * @return the systemData value. + */ + public PolicyModelSystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property properties in model PolicyModelInner")); + } else { + properties().validate(); + } + if (systemData() != null) { + systemData().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PolicyModelInner.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/ProtectedItemModelInner.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/ProtectedItemModelInner.java new file mode 100644 index 000000000000..e8369ef9259e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/ProtectedItemModelInner.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ProtectedItemModelProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ProtectedItemModelSystemData; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Protected item model. */ +@Fluent +public final class ProtectedItemModelInner extends ProxyResource { + /* + * Protected item model properties. + */ + @JsonProperty(value = "properties", required = true) + private ProtectedItemModelProperties properties; + + /* + * The systemData property. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private ProtectedItemModelSystemData systemData; + + /** Creates an instance of ProtectedItemModelInner class. */ + public ProtectedItemModelInner() { + } + + /** + * Get the properties property: Protected item model properties. + * + * @return the properties value. + */ + public ProtectedItemModelProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Protected item model properties. + * + * @param properties the properties value to set. + * @return the ProtectedItemModelInner object itself. + */ + public ProtectedItemModelInner withProperties(ProtectedItemModelProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: The systemData property. + * + * @return the systemData value. + */ + public ProtectedItemModelSystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property properties in model ProtectedItemModelInner")); + } else { + properties().validate(); + } + if (systemData() != null) { + systemData().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ProtectedItemModelInner.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/RecoveryPointModelInner.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/RecoveryPointModelInner.java new file mode 100644 index 000000000000..357a41eaeb54 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/RecoveryPointModelInner.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.RecoveryPointModelProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.RecoveryPointModelSystemData; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Recovery point model. */ +@Fluent +public final class RecoveryPointModelInner { + /* + * Recovery point model properties. + */ + @JsonProperty(value = "properties", required = true) + private RecoveryPointModelProperties properties; + + /* + * Gets or sets the Id of the resource. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Gets or sets the name of the resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Gets or sets the type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The systemData property. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private RecoveryPointModelSystemData systemData; + + /** Creates an instance of RecoveryPointModelInner class. */ + public RecoveryPointModelInner() { + } + + /** + * Get the properties property: Recovery point model properties. + * + * @return the properties value. + */ + public RecoveryPointModelProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Recovery point model properties. + * + * @param properties the properties value to set. + * @return the RecoveryPointModelInner object itself. + */ + public RecoveryPointModelInner withProperties(RecoveryPointModelProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the id property: Gets or sets the Id of the resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Gets or sets the name of the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Gets or sets the type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the systemData property: The systemData property. + * + * @return the systemData value. + */ + public RecoveryPointModelSystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property properties in model RecoveryPointModelInner")); + } else { + properties().validate(); + } + if (systemData() != null) { + systemData().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RecoveryPointModelInner.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/ReplicationExtensionModelInner.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/ReplicationExtensionModelInner.java new file mode 100644 index 000000000000..68367291f832 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/ReplicationExtensionModelInner.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ReplicationExtensionModelProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ReplicationExtensionModelSystemData; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Replication extension model. */ +@Fluent +public final class ReplicationExtensionModelInner extends ProxyResource { + /* + * Replication extension model properties. + */ + @JsonProperty(value = "properties", required = true) + private ReplicationExtensionModelProperties properties; + + /* + * The systemData property. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private ReplicationExtensionModelSystemData systemData; + + /** Creates an instance of ReplicationExtensionModelInner class. */ + public ReplicationExtensionModelInner() { + } + + /** + * Get the properties property: Replication extension model properties. + * + * @return the properties value. + */ + public ReplicationExtensionModelProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Replication extension model properties. + * + * @param properties the properties value to set. + * @return the ReplicationExtensionModelInner object itself. + */ + public ReplicationExtensionModelInner withProperties(ReplicationExtensionModelProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: The systemData property. + * + * @return the systemData value. + */ + public ReplicationExtensionModelSystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property properties in model ReplicationExtensionModelInner")); + } else { + properties().validate(); + } + if (systemData() != null) { + systemData().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ReplicationExtensionModelInner.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/VaultModelInner.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/VaultModelInner.java new file mode 100644 index 000000000000..17acfda23d04 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/VaultModelInner.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.VaultModelProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.VaultModelSystemData; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Vault model. */ +@Fluent +public final class VaultModelInner extends Resource { + /* + * Vault properties. + */ + @JsonProperty(value = "properties") + private VaultModelProperties properties; + + /* + * The systemData property. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private VaultModelSystemData systemData; + + /** Creates an instance of VaultModelInner class. */ + public VaultModelInner() { + } + + /** + * Get the properties property: Vault properties. + * + * @return the properties value. + */ + public VaultModelProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Vault properties. + * + * @param properties the properties value to set. + * @return the VaultModelInner object itself. + */ + public VaultModelInner withProperties(VaultModelProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: The systemData property. + * + * @return the systemData value. + */ + public VaultModelSystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public VaultModelInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VaultModelInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (systemData() != null) { + systemData().validate(); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/WorkflowModelInner.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/WorkflowModelInner.java new file mode 100644 index 000000000000..93923aab8d2e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/WorkflowModelInner.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.recoveryservicesdatareplication.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.WorkflowModelProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.WorkflowModelSystemData; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Workflow model. */ +@Fluent +public final class WorkflowModelInner extends ProxyResource { + /* + * Workflow model properties. + */ + @JsonProperty(value = "properties", required = true) + private WorkflowModelProperties properties; + + /* + * The systemData property. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private WorkflowModelSystemData systemData; + + /** Creates an instance of WorkflowModelInner class. */ + public WorkflowModelInner() { + } + + /** + * Get the properties property: Workflow model properties. + * + * @return the properties value. + */ + public WorkflowModelProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Workflow model properties. + * + * @param properties the properties value to set. + * @return the WorkflowModelInner object itself. + */ + public WorkflowModelInner withProperties(WorkflowModelProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: The systemData property. + * + * @return the systemData value. + */ + public WorkflowModelSystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property properties in model WorkflowModelInner")); + } else { + properties().validate(); + } + if (systemData() != null) { + systemData().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WorkflowModelInner.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/package-info.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/package-info.java new file mode 100644 index 000000000000..edd58162c497 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// 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 DataReplicationMgmtClient. A first party Azure service enabling the data + * replication. + */ +package com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models; diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/package-info.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/package-info.java new file mode 100644 index 000000000000..d7ac92a393d8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/fluent/package-info.java @@ -0,0 +1,9 @@ +// 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 DataReplicationMgmtClient. A first party Azure service enabling the data + * replication. + */ +package com.azure.resourcemanager.recoveryservicesdatareplication.fluent; diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/CheckNameAvailabilityResponseModelImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/CheckNameAvailabilityResponseModelImpl.java new file mode 100644 index 000000000000..a2ba1d86b8ea --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/CheckNameAvailabilityResponseModelImpl.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.implementation; + +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.CheckNameAvailabilityResponseModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.CheckNameAvailabilityResponseModel; + +public final class CheckNameAvailabilityResponseModelImpl implements CheckNameAvailabilityResponseModel { + private CheckNameAvailabilityResponseModelInner innerObject; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + CheckNameAvailabilityResponseModelImpl( + CheckNameAvailabilityResponseModelInner innerObject, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public String reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public CheckNameAvailabilityResponseModelInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DataReplicationMgmtClientBuilder.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DataReplicationMgmtClientBuilder.java new file mode 100644 index 000000000000..ff152dde8db4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DataReplicationMgmtClientBuilder.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.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 DataReplicationMgmtClientImpl type. */ +@ServiceClientBuilder(serviceClients = {DataReplicationMgmtClientImpl.class}) +public final class DataReplicationMgmtClientBuilder { + /* + * The ID of the target subscription. The value must be an UUID. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. The value must be an UUID. + * + * @param subscriptionId the subscriptionId value. + * @return the DataReplicationMgmtClientBuilder. + */ + public DataReplicationMgmtClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the DataReplicationMgmtClientBuilder. + */ + public DataReplicationMgmtClientBuilder 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 DataReplicationMgmtClientBuilder. + */ + public DataReplicationMgmtClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + 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 DataReplicationMgmtClientBuilder. + */ + public DataReplicationMgmtClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + 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 DataReplicationMgmtClientBuilder. + */ + public DataReplicationMgmtClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + 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 DataReplicationMgmtClientBuilder. + */ + public DataReplicationMgmtClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of DataReplicationMgmtClientImpl with the provided parameters. + * + * @return an instance of DataReplicationMgmtClientImpl. + */ + public DataReplicationMgmtClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + DataReplicationMgmtClientImpl client = + new DataReplicationMgmtClientImpl( + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + this.subscriptionId, + localEndpoint); + return client; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DataReplicationMgmtClientImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DataReplicationMgmtClientImpl.java new file mode 100644 index 000000000000..1c3c48880f0b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DataReplicationMgmtClientImpl.java @@ -0,0 +1,528 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.CoreUtils; +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.recoveryservicesdatareplication.fluent.DataReplicationMgmtClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.DraOperationStatusClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.DrasClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.EmailConfigurationsClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.EventsClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.FabricOperationsStatusClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.FabricsClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.OperationsClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.PoliciesClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.PolicyOperationStatusClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.ProtectedItemOperationStatusClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.ProtectedItemsClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.RecoveryPointsClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.ReplicationExtensionsClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.VaultOperationStatusClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.VaultsClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.WorkflowOperationStatusClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.WorkflowsClient; +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 reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the DataReplicationMgmtClientImpl type. */ +@ServiceClient(builder = DataReplicationMgmtClientBuilder.class) +public final class DataReplicationMgmtClientImpl implements DataReplicationMgmtClient { + /** The ID of the target subscription. The value must be an UUID. */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @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 DrasClient object to access its operations. */ + private final DrasClient dras; + + /** + * Gets the DrasClient object to access its operations. + * + * @return the DrasClient object. + */ + public DrasClient getDras() { + return this.dras; + } + + /** The DraOperationStatusClient object to access its operations. */ + private final DraOperationStatusClient draOperationStatus; + + /** + * Gets the DraOperationStatusClient object to access its operations. + * + * @return the DraOperationStatusClient object. + */ + public DraOperationStatusClient getDraOperationStatus() { + return this.draOperationStatus; + } + + /** The EmailConfigurationsClient object to access its operations. */ + private final EmailConfigurationsClient emailConfigurations; + + /** + * Gets the EmailConfigurationsClient object to access its operations. + * + * @return the EmailConfigurationsClient object. + */ + public EmailConfigurationsClient getEmailConfigurations() { + return this.emailConfigurations; + } + + /** The EventsClient object to access its operations. */ + private final EventsClient events; + + /** + * Gets the EventsClient object to access its operations. + * + * @return the EventsClient object. + */ + public EventsClient getEvents() { + return this.events; + } + + /** The FabricsClient object to access its operations. */ + private final FabricsClient fabrics; + + /** + * Gets the FabricsClient object to access its operations. + * + * @return the FabricsClient object. + */ + public FabricsClient getFabrics() { + return this.fabrics; + } + + /** The FabricOperationsStatusClient object to access its operations. */ + private final FabricOperationsStatusClient fabricOperationsStatus; + + /** + * Gets the FabricOperationsStatusClient object to access its operations. + * + * @return the FabricOperationsStatusClient object. + */ + public FabricOperationsStatusClient getFabricOperationsStatus() { + return this.fabricOperationsStatus; + } + + /** The PoliciesClient object to access its operations. */ + private final PoliciesClient policies; + + /** + * Gets the PoliciesClient object to access its operations. + * + * @return the PoliciesClient object. + */ + public PoliciesClient getPolicies() { + return this.policies; + } + + /** The PolicyOperationStatusClient object to access its operations. */ + private final PolicyOperationStatusClient policyOperationStatus; + + /** + * Gets the PolicyOperationStatusClient object to access its operations. + * + * @return the PolicyOperationStatusClient object. + */ + public PolicyOperationStatusClient getPolicyOperationStatus() { + return this.policyOperationStatus; + } + + /** The ProtectedItemsClient object to access its operations. */ + private final ProtectedItemsClient protectedItems; + + /** + * Gets the ProtectedItemsClient object to access its operations. + * + * @return the ProtectedItemsClient object. + */ + public ProtectedItemsClient getProtectedItems() { + return this.protectedItems; + } + + /** The ProtectedItemOperationStatusClient object to access its operations. */ + private final ProtectedItemOperationStatusClient protectedItemOperationStatus; + + /** + * Gets the ProtectedItemOperationStatusClient object to access its operations. + * + * @return the ProtectedItemOperationStatusClient object. + */ + public ProtectedItemOperationStatusClient getProtectedItemOperationStatus() { + return this.protectedItemOperationStatus; + } + + /** The RecoveryPointsClient object to access its operations. */ + private final RecoveryPointsClient recoveryPoints; + + /** + * Gets the RecoveryPointsClient object to access its operations. + * + * @return the RecoveryPointsClient object. + */ + public RecoveryPointsClient getRecoveryPoints() { + return this.recoveryPoints; + } + + /** The ReplicationExtensionsClient object to access its operations. */ + private final ReplicationExtensionsClient replicationExtensions; + + /** + * Gets the ReplicationExtensionsClient object to access its operations. + * + * @return the ReplicationExtensionsClient object. + */ + public ReplicationExtensionsClient getReplicationExtensions() { + return this.replicationExtensions; + } + + /** The ResourceProvidersClient object to access its operations. */ + private final ResourceProvidersClient resourceProviders; + + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + public ResourceProvidersClient getResourceProviders() { + return this.resourceProviders; + } + + /** 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 VaultsClient object to access its operations. */ + private final VaultsClient vaults; + + /** + * Gets the VaultsClient object to access its operations. + * + * @return the VaultsClient object. + */ + public VaultsClient getVaults() { + return this.vaults; + } + + /** The VaultOperationStatusClient object to access its operations. */ + private final VaultOperationStatusClient vaultOperationStatus; + + /** + * Gets the VaultOperationStatusClient object to access its operations. + * + * @return the VaultOperationStatusClient object. + */ + public VaultOperationStatusClient getVaultOperationStatus() { + return this.vaultOperationStatus; + } + + /** The WorkflowsClient object to access its operations. */ + private final WorkflowsClient workflows; + + /** + * Gets the WorkflowsClient object to access its operations. + * + * @return the WorkflowsClient object. + */ + public WorkflowsClient getWorkflows() { + return this.workflows; + } + + /** The WorkflowOperationStatusClient object to access its operations. */ + private final WorkflowOperationStatusClient workflowOperationStatus; + + /** + * Gets the WorkflowOperationStatusClient object to access its operations. + * + * @return the WorkflowOperationStatusClient object. + */ + public WorkflowOperationStatusClient getWorkflowOperationStatus() { + return this.workflowOperationStatus; + } + + /** + * Initializes an instance of DataReplicationMgmtClient 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 ID of the target subscription. The value must be an UUID. + * @param endpoint server parameter. + */ + DataReplicationMgmtClientImpl( + 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 = "2021-02-16-preview"; + this.dras = new DrasClientImpl(this); + this.draOperationStatus = new DraOperationStatusClientImpl(this); + this.emailConfigurations = new EmailConfigurationsClientImpl(this); + this.events = new EventsClientImpl(this); + this.fabrics = new FabricsClientImpl(this); + this.fabricOperationsStatus = new FabricOperationsStatusClientImpl(this); + this.policies = new PoliciesClientImpl(this); + this.policyOperationStatus = new PolicyOperationStatusClientImpl(this); + this.protectedItems = new ProtectedItemsClientImpl(this); + this.protectedItemOperationStatus = new ProtectedItemOperationStatusClientImpl(this); + this.recoveryPoints = new RecoveryPointsClientImpl(this); + this.replicationExtensions = new ReplicationExtensionsClientImpl(this); + this.resourceProviders = new ResourceProvidersClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.vaults = new VaultsClientImpl(this); + this.vaultOperationStatus = new VaultOperationStatusClientImpl(this); + this.workflows = new WorkflowsClientImpl(this); + this.workflowOperationStatus = new WorkflowOperationStatusClientImpl(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) { + return CoreUtils.mergeContexts(this.getContext(), 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)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataReplicationMgmtClientImpl.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DeploymentPreflightModelImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DeploymentPreflightModelImpl.java new file mode 100644 index 000000000000..b9038961fd28 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DeploymentPreflightModelImpl.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.implementation; + +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.DeploymentPreflightModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.DeploymentPreflightModel; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.DeploymentPreflightResource; +import java.util.Collections; +import java.util.List; + +public final class DeploymentPreflightModelImpl implements DeploymentPreflightModel { + private DeploymentPreflightModelInner innerObject; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + DeploymentPreflightModelImpl( + DeploymentPreflightModelInner innerObject, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List resources() { + List inner = this.innerModel().resources(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DeploymentPreflightModelInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DraModelImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DraModelImpl.java new file mode 100644 index 000000000000..966758252818 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DraModelImpl.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.recoveryservicesdatareplication.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.DraModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.DraModel; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.DraModelProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.DraModelSystemData; + +public final class DraModelImpl implements DraModel, DraModel.Definition { + private DraModelInner innerObject; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + DraModelImpl( + DraModelInner innerObject, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public DraModelProperties properties() { + return this.innerModel().properties(); + } + + public DraModelSystemData systemData() { + return this.innerModel().systemData(); + } + + public DraModelInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String fabricName; + + private String fabricAgentName; + + public DraModelImpl withExistingReplicationFabric(String resourceGroupName, String fabricName) { + this.resourceGroupName = resourceGroupName; + this.fabricName = fabricName; + return this; + } + + public DraModel create() { + this.innerObject = + serviceManager + .serviceClient() + .getDras() + .create(resourceGroupName, fabricName, fabricAgentName, this.innerModel(), Context.NONE); + return this; + } + + public DraModel create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDras() + .create(resourceGroupName, fabricName, fabricAgentName, this.innerModel(), context); + return this; + } + + DraModelImpl( + String name, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerObject = new DraModelInner(); + this.serviceManager = serviceManager; + this.fabricAgentName = name; + } + + public DraModel refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDras() + .getWithResponse(resourceGroupName, fabricName, fabricAgentName, Context.NONE) + .getValue(); + return this; + } + + public DraModel refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDras() + .getWithResponse(resourceGroupName, fabricName, fabricAgentName, context) + .getValue(); + return this; + } + + public DraModelImpl withProperties(DraModelProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DraOperationStatusClientImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DraOperationStatusClientImpl.java new file mode 100644 index 000000000000..e5d8c25a6d38 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DraOperationStatusClientImpl.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.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.resourcemanager.recoveryservicesdatareplication.fluent.DraOperationStatusClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.OperationStatusInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DraOperationStatusClient. */ +public final class DraOperationStatusClientImpl implements DraOperationStatusClient { + /** The proxy service used to perform REST calls. */ + private final DraOperationStatusService service; + + /** The service client containing this operation class. */ + private final DataReplicationMgmtClientImpl client; + + /** + * Initializes an instance of DraOperationStatusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DraOperationStatusClientImpl(DataReplicationMgmtClientImpl client) { + this.service = + RestProxy.create(DraOperationStatusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataReplicationMgmtClientDraOperationStatus to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataReplicationMgmtC") + public interface DraOperationStatusService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName}/operations/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("fabricName") String fabricName, + @PathParam("fabricAgentName") String fabricAgentName, + @PathParam("operationId") String operationId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the fabric agent (Dra) operation status. + * + *

Tracks the results of an asynchronous operation on the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) name. + * @param operationId The ID of an ongoing async 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 defines the operation status along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String fabricName, String fabricAgentName, String operationId) { + 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (fabricAgentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fabricAgentName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + fabricName, + fabricAgentName, + operationId, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the fabric agent (Dra) operation status. + * + *

Tracks the results of an asynchronous operation on the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) name. + * @param operationId The ID of an ongoing async operation. + * @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 defines the operation status along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String fabricName, String fabricAgentName, String operationId, 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (fabricAgentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fabricAgentName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + fabricName, + fabricAgentName, + operationId, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the fabric agent (Dra) operation status. + * + *

Tracks the results of an asynchronous operation on the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) name. + * @param operationId The ID of an ongoing async 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 defines the operation status on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String fabricName, String fabricAgentName, String operationId) { + return getWithResponseAsync(resourceGroupName, fabricName, fabricAgentName, operationId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the fabric agent (Dra) operation status. + * + *

Tracks the results of an asynchronous operation on the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) name. + * @param operationId The ID of an ongoing async operation. + * @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 defines the operation status along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String fabricName, String fabricAgentName, String operationId, Context context) { + return getWithResponseAsync(resourceGroupName, fabricName, fabricAgentName, operationId, context).block(); + } + + /** + * Gets the fabric agent (Dra) operation status. + * + *

Tracks the results of an asynchronous operation on the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) name. + * @param operationId The ID of an ongoing async 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 defines the operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner get( + String resourceGroupName, String fabricName, String fabricAgentName, String operationId) { + return getWithResponse(resourceGroupName, fabricName, fabricAgentName, operationId, Context.NONE).getValue(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DraOperationStatusImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DraOperationStatusImpl.java new file mode 100644 index 000000000000..9a40112ed81f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DraOperationStatusImpl.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.recoveryservicesdatareplication.implementation; + +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.recoveryservicesdatareplication.fluent.DraOperationStatusClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.DraOperationStatus; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.OperationStatus; + +public final class DraOperationStatusImpl implements DraOperationStatus { + private static final ClientLogger LOGGER = new ClientLogger(DraOperationStatusImpl.class); + + private final DraOperationStatusClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + public DraOperationStatusImpl( + DraOperationStatusClient innerClient, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String fabricName, String fabricAgentName, String operationId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, fabricName, fabricAgentName, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OperationStatusImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OperationStatus get( + String resourceGroupName, String fabricName, String fabricAgentName, String operationId) { + OperationStatusInner inner = + this.serviceClient().get(resourceGroupName, fabricName, fabricAgentName, operationId); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + private DraOperationStatusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DrasClientImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DrasClientImpl.java new file mode 100644 index 000000000000..2e475bc5b530 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DrasClientImpl.java @@ -0,0 +1,1192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.DrasClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.DraModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.DraModelCollection; +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 DrasClient. */ +public final class DrasClientImpl implements DrasClient { + /** The proxy service used to perform REST calls. */ + private final DrasService service; + + /** The service client containing this operation class. */ + private final DataReplicationMgmtClientImpl client; + + /** + * Initializes an instance of DrasClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DrasClientImpl(DataReplicationMgmtClientImpl client) { + this.service = RestProxy.create(DrasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataReplicationMgmtClientDras to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataReplicationMgmtC") + public interface DrasService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("fabricName") String fabricName, + @PathParam("fabricAgentName") String fabricAgentName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("fabricName") String fabricName, + @PathParam("fabricAgentName") String fabricAgentName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DraModelInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("fabricName") String fabricName, + @PathParam("fabricAgentName") String fabricAgentName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("fabricName") String fabricName, + @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); + } + + /** + * Gets the fabric agent (Dra). + * + *

Gets the details of the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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 the details of the fabric agent along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String fabricName, String fabricAgentName) { + 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (fabricAgentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fabricAgentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + fabricName, + fabricAgentName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the fabric agent (Dra). + * + *

Gets the details of the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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 the details of the fabric agent along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String fabricName, String fabricAgentName, 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (fabricAgentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fabricAgentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + fabricName, + fabricAgentName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the fabric agent (Dra). + * + *

Gets the details of the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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 the details of the fabric agent on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String fabricName, String fabricAgentName) { + return getWithResponseAsync(resourceGroupName, fabricName, fabricAgentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the fabric agent (Dra). + * + *

Gets the details of the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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 the details of the fabric agent along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String fabricName, String fabricAgentName, Context context) { + return getWithResponseAsync(resourceGroupName, fabricName, fabricAgentName, context).block(); + } + + /** + * Gets the fabric agent (Dra). + * + *

Gets the details of the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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 the details of the fabric agent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DraModelInner get(String resourceGroupName, String fabricName, String fabricAgentName) { + return getWithResponse(resourceGroupName, fabricName, fabricAgentName, Context.NONE).getValue(); + } + + /** + * Puts the fabric agent (Dra). + * + *

Creates the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) name. + * @param body Dra model. + * @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 dra model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String fabricName, String fabricAgentName, DraModelInner body) { + 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (fabricAgentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fabricAgentName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + fabricName, + fabricAgentName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Puts the fabric agent (Dra). + * + *

Creates the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) name. + * @param body Dra model. + * @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 dra model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String fabricName, String fabricAgentName, DraModelInner body, 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (fabricAgentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fabricAgentName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + fabricName, + fabricAgentName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Puts the fabric agent (Dra). + * + *

Creates the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) name. + * @param body Dra model. + * @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 {@link PollerFlux} for polling of dra model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DraModelInner> beginCreateAsync( + String resourceGroupName, String fabricName, String fabricAgentName, DraModelInner body) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, fabricName, fabricAgentName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DraModelInner.class, + DraModelInner.class, + this.client.getContext()); + } + + /** + * Puts the fabric agent (Dra). + * + *

Creates the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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 the {@link PollerFlux} for polling of dra model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DraModelInner> beginCreateAsync( + String resourceGroupName, String fabricName, String fabricAgentName) { + final DraModelInner body = null; + Mono>> mono = + createWithResponseAsync(resourceGroupName, fabricName, fabricAgentName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DraModelInner.class, + DraModelInner.class, + this.client.getContext()); + } + + /** + * Puts the fabric agent (Dra). + * + *

Creates the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) name. + * @param body Dra model. + * @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 {@link PollerFlux} for polling of dra model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DraModelInner> beginCreateAsync( + String resourceGroupName, String fabricName, String fabricAgentName, DraModelInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, fabricName, fabricAgentName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DraModelInner.class, DraModelInner.class, context); + } + + /** + * Puts the fabric agent (Dra). + * + *

Creates the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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 the {@link SyncPoller} for polling of dra model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DraModelInner> beginCreate( + String resourceGroupName, String fabricName, String fabricAgentName) { + final DraModelInner body = null; + return this.beginCreateAsync(resourceGroupName, fabricName, fabricAgentName, body).getSyncPoller(); + } + + /** + * Puts the fabric agent (Dra). + * + *

Creates the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) name. + * @param body Dra model. + * @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 {@link SyncPoller} for polling of dra model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DraModelInner> beginCreate( + String resourceGroupName, String fabricName, String fabricAgentName, DraModelInner body, Context context) { + return this.beginCreateAsync(resourceGroupName, fabricName, fabricAgentName, body, context).getSyncPoller(); + } + + /** + * Puts the fabric agent (Dra). + * + *

Creates the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) name. + * @param body Dra model. + * @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 dra model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String fabricName, String fabricAgentName, DraModelInner body) { + return beginCreateAsync(resourceGroupName, fabricName, fabricAgentName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the fabric agent (Dra). + * + *

Creates the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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 dra model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String fabricName, String fabricAgentName) { + final DraModelInner body = null; + return beginCreateAsync(resourceGroupName, fabricName, fabricAgentName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the fabric agent (Dra). + * + *

Creates the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) name. + * @param body Dra model. + * @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 dra model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String fabricName, String fabricAgentName, DraModelInner body, Context context) { + return beginCreateAsync(resourceGroupName, fabricName, fabricAgentName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the fabric agent (Dra). + * + *

Creates the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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 dra model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DraModelInner create(String resourceGroupName, String fabricName, String fabricAgentName) { + final DraModelInner body = null; + return createAsync(resourceGroupName, fabricName, fabricAgentName, body).block(); + } + + /** + * Puts the fabric agent (Dra). + * + *

Creates the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) name. + * @param body Dra model. + * @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 dra model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DraModelInner create( + String resourceGroupName, String fabricName, String fabricAgentName, DraModelInner body, Context context) { + return createAsync(resourceGroupName, fabricName, fabricAgentName, body, context).block(); + } + + /** + * Deletes the fabric agent (Dra). + * + *

Deletes the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String fabricName, String fabricAgentName) { + 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (fabricAgentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fabricAgentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + fabricName, + fabricAgentName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the fabric agent (Dra). + * + *

Deletes the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String fabricName, String fabricAgentName, 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (fabricAgentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fabricAgentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + fabricName, + fabricAgentName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the fabric agent (Dra). + * + *

Deletes the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String fabricName, String fabricAgentName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, fabricName, fabricAgentName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the fabric agent (Dra). + * + *

Deletes the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String fabricName, String fabricAgentName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, fabricName, fabricAgentName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the fabric agent (Dra). + * + *

Deletes the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String fabricName, String fabricAgentName) { + return this.beginDeleteAsync(resourceGroupName, fabricName, fabricAgentName).getSyncPoller(); + } + + /** + * Deletes the fabric agent (Dra). + * + *

Deletes the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String fabricName, String fabricAgentName, Context context) { + return this.beginDeleteAsync(resourceGroupName, fabricName, fabricAgentName, context).getSyncPoller(); + } + + /** + * Deletes the fabric agent (Dra). + * + *

Deletes the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String fabricName, String fabricAgentName) { + return beginDeleteAsync(resourceGroupName, fabricName, fabricAgentName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the fabric agent (Dra). + * + *

Deletes the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String fabricName, String fabricAgentName, Context context) { + return beginDeleteAsync(resourceGroupName, fabricName, fabricAgentName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the fabric agent (Dra). + * + *

Deletes the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String fabricName, String fabricAgentName) { + deleteAsync(resourceGroupName, fabricName, fabricAgentName).block(); + } + + /** + * Deletes the fabric agent (Dra). + * + *

Deletes the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String fabricName, String fabricAgentName, Context context) { + deleteAsync(resourceGroupName, fabricName, fabricAgentName, context).block(); + } + + /** + * Lists the fabric agents (Dras). + * + *

Gets the list of fabric agents in the given fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the list of fabric agents in the given fabric along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String fabricName) { + 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + fabricName, + 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())); + } + + /** + * Lists the fabric agents (Dras). + * + *

Gets the list of fabric agents in the given fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the list of fabric agents in the given fabric along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String fabricName, 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName 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(), + resourceGroupName, + fabricName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the fabric agents (Dras). + * + *

Gets the list of fabric agents in the given fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the list of fabric agents in the given fabric as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String fabricName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, fabricName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the fabric agents (Dras). + * + *

Gets the list of fabric agents in the given fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the list of fabric agents in the given fabric as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String fabricName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, fabricName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the fabric agents (Dras). + * + *

Gets the list of fabric agents in the given fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the list of fabric agents in the given fabric as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String fabricName) { + return new PagedIterable<>(listAsync(resourceGroupName, fabricName)); + } + + /** + * Lists the fabric agents (Dras). + * + *

Gets the list of fabric agents in the given fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the list of fabric agents in the given fabric as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String fabricName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, fabricName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 dra model collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 dra model collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DrasImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DrasImpl.java new file mode 100644 index 000000000000..1e2b3448d760 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/DrasImpl.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.recoveryservicesdatareplication.fluent.DrasClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.DraModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.DraModel; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.Dras; + +public final class DrasImpl implements Dras { + private static final ClientLogger LOGGER = new ClientLogger(DrasImpl.class); + + private final DrasClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + public DrasImpl( + DrasClient innerClient, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String fabricName, String fabricAgentName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, fabricName, fabricAgentName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DraModelImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DraModel get(String resourceGroupName, String fabricName, String fabricAgentName) { + DraModelInner inner = this.serviceClient().get(resourceGroupName, fabricName, fabricAgentName); + if (inner != null) { + return new DraModelImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String fabricName, String fabricAgentName) { + this.serviceClient().delete(resourceGroupName, fabricName, fabricAgentName); + } + + public void delete(String resourceGroupName, String fabricName, String fabricAgentName, Context context) { + this.serviceClient().delete(resourceGroupName, fabricName, fabricAgentName, context); + } + + public PagedIterable list(String resourceGroupName, String fabricName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, fabricName); + return Utils.mapPage(inner, inner1 -> new DraModelImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String fabricName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, fabricName, context); + return Utils.mapPage(inner, inner1 -> new DraModelImpl(inner1, this.manager())); + } + + public DraModel 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 fabricName = Utils.getValueFromIdByName(id, "replicationFabrics"); + if (fabricName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationFabrics'.", id))); + } + String fabricAgentName = Utils.getValueFromIdByName(id, "fabricAgents"); + if (fabricAgentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fabricAgents'.", id))); + } + return this.getWithResponse(resourceGroupName, fabricName, fabricAgentName, 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 fabricName = Utils.getValueFromIdByName(id, "replicationFabrics"); + if (fabricName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationFabrics'.", id))); + } + String fabricAgentName = Utils.getValueFromIdByName(id, "fabricAgents"); + if (fabricAgentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fabricAgents'.", id))); + } + return this.getWithResponse(resourceGroupName, fabricName, fabricAgentName, 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 fabricName = Utils.getValueFromIdByName(id, "replicationFabrics"); + if (fabricName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationFabrics'.", id))); + } + String fabricAgentName = Utils.getValueFromIdByName(id, "fabricAgents"); + if (fabricAgentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fabricAgents'.", id))); + } + this.delete(resourceGroupName, fabricName, fabricAgentName, 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 fabricName = Utils.getValueFromIdByName(id, "replicationFabrics"); + if (fabricName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationFabrics'.", id))); + } + String fabricAgentName = Utils.getValueFromIdByName(id, "fabricAgents"); + if (fabricAgentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fabricAgents'.", id))); + } + this.delete(resourceGroupName, fabricName, fabricAgentName, context); + } + + private DrasClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } + + public DraModelImpl define(String name) { + return new DraModelImpl(name, this.manager()); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/EmailConfigurationModelImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/EmailConfigurationModelImpl.java new file mode 100644 index 000000000000..1023c45a9987 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/EmailConfigurationModelImpl.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.EmailConfigurationModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.EmailConfigurationModel; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.EmailConfigurationModelProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.EmailConfigurationModelSystemData; + +public final class EmailConfigurationModelImpl implements EmailConfigurationModel, EmailConfigurationModel.Definition { + private EmailConfigurationModelInner innerObject; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + EmailConfigurationModelImpl( + EmailConfigurationModelInner innerObject, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public EmailConfigurationModelProperties properties() { + return this.innerModel().properties(); + } + + public EmailConfigurationModelSystemData systemData() { + return this.innerModel().systemData(); + } + + public EmailConfigurationModelInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String vaultName; + + private String emailConfigurationName; + + public EmailConfigurationModelImpl withExistingReplicationVault(String resourceGroupName, String vaultName) { + this.resourceGroupName = resourceGroupName; + this.vaultName = vaultName; + return this; + } + + public EmailConfigurationModel create() { + this.innerObject = + serviceManager + .serviceClient() + .getEmailConfigurations() + .createWithResponse( + resourceGroupName, vaultName, emailConfigurationName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public EmailConfigurationModel create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getEmailConfigurations() + .createWithResponse(resourceGroupName, vaultName, emailConfigurationName, this.innerModel(), context) + .getValue(); + return this; + } + + EmailConfigurationModelImpl( + String name, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerObject = new EmailConfigurationModelInner(); + this.serviceManager = serviceManager; + this.emailConfigurationName = name; + } + + public EmailConfigurationModel refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getEmailConfigurations() + .getWithResponse(resourceGroupName, vaultName, emailConfigurationName, Context.NONE) + .getValue(); + return this; + } + + public EmailConfigurationModel refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getEmailConfigurations() + .getWithResponse(resourceGroupName, vaultName, emailConfigurationName, context) + .getValue(); + return this; + } + + public EmailConfigurationModelImpl withProperties(EmailConfigurationModelProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/EmailConfigurationsClientImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/EmailConfigurationsClientImpl.java new file mode 100644 index 000000000000..c585277d76a8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/EmailConfigurationsClientImpl.java @@ -0,0 +1,753 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.implementation; + +import com.azure.core.annotation.BodyParam; +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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.EmailConfigurationsClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.EmailConfigurationModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.EmailConfigurationModelCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in EmailConfigurationsClient. */ +public final class EmailConfigurationsClientImpl implements EmailConfigurationsClient { + /** The proxy service used to perform REST calls. */ + private final EmailConfigurationsService service; + + /** The service client containing this operation class. */ + private final DataReplicationMgmtClientImpl client; + + /** + * Initializes an instance of EmailConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EmailConfigurationsClientImpl(DataReplicationMgmtClientImpl client) { + this.service = + RestProxy.create(EmailConfigurationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataReplicationMgmtClientEmailConfigurations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataReplicationMgmtC") + public interface EmailConfigurationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("emailConfigurationName") String emailConfigurationName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("emailConfigurationName") String emailConfigurationName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") EmailConfigurationModelInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @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); + } + + /** + * Gets the email configuration setting. + * + *

Gets the details of the alert configuration setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param emailConfigurationName The email configuration 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 the details of the alert configuration setting along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String emailConfigurationName) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (emailConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter emailConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + emailConfigurationName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the email configuration setting. + * + *

Gets the details of the alert configuration setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param emailConfigurationName The email configuration 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 the details of the alert configuration setting along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String emailConfigurationName, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (emailConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter emailConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + emailConfigurationName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the email configuration setting. + * + *

Gets the details of the alert configuration setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param emailConfigurationName The email configuration 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 the details of the alert configuration setting on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String vaultName, String emailConfigurationName) { + return getWithResponseAsync(resourceGroupName, vaultName, emailConfigurationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the email configuration setting. + * + *

Gets the details of the alert configuration setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param emailConfigurationName The email configuration 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 the details of the alert configuration setting along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String vaultName, String emailConfigurationName, Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, emailConfigurationName, context).block(); + } + + /** + * Gets the email configuration setting. + * + *

Gets the details of the alert configuration setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param emailConfigurationName The email configuration 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 the details of the alert configuration setting. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EmailConfigurationModelInner get(String resourceGroupName, String vaultName, String emailConfigurationName) { + return getWithResponse(resourceGroupName, vaultName, emailConfigurationName, Context.NONE).getValue(); + } + + /** + * Creates email configuration settings. + * + *

Creates an alert configuration setting for the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param emailConfigurationName The email configuration name. + * @param body EmailConfiguration model. + * @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 email configuration model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String vaultName, String emailConfigurationName, EmailConfigurationModelInner body) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (emailConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter emailConfigurationName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + emailConfigurationName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates email configuration settings. + * + *

Creates an alert configuration setting for the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param emailConfigurationName The email configuration name. + * @param body EmailConfiguration model. + * @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 email configuration model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String vaultName, + String emailConfigurationName, + EmailConfigurationModelInner body, + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (emailConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter emailConfigurationName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + emailConfigurationName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Creates email configuration settings. + * + *

Creates an alert configuration setting for the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param emailConfigurationName The email configuration 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 email configuration model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String vaultName, String emailConfigurationName) { + final EmailConfigurationModelInner body = null; + return createWithResponseAsync(resourceGroupName, vaultName, emailConfigurationName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates email configuration settings. + * + *

Creates an alert configuration setting for the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param emailConfigurationName The email configuration name. + * @param body EmailConfiguration model. + * @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 email configuration model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String vaultName, + String emailConfigurationName, + EmailConfigurationModelInner body, + Context context) { + return createWithResponseAsync(resourceGroupName, vaultName, emailConfigurationName, body, context).block(); + } + + /** + * Creates email configuration settings. + * + *

Creates an alert configuration setting for the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param emailConfigurationName The email configuration 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 email configuration model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EmailConfigurationModelInner create( + String resourceGroupName, String vaultName, String emailConfigurationName) { + final EmailConfigurationModelInner body = null; + return createWithResponse(resourceGroupName, vaultName, emailConfigurationName, body, Context.NONE).getValue(); + } + + /** + * Lists the email configuration settings. + * + *

Gets the list of alert configuration settings for the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of alert configuration settings for the given vault along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String vaultName) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + 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())); + } + + /** + * Lists the email configuration settings. + * + *

Gets the list of alert configuration settings for the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of alert configuration settings for the given vault along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String vaultName, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName 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(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the email configuration settings. + * + *

Gets the list of alert configuration settings for the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of alert configuration settings for the given vault as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vaultName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the email configuration settings. + * + *

Gets the list of alert configuration settings for the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of alert configuration settings for the given vault as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String vaultName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the email configuration settings. + * + *

Gets the list of alert configuration settings for the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of alert configuration settings for the given vault as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName) { + return new PagedIterable<>(listAsync(resourceGroupName, vaultName)); + } + + /** + * Lists the email configuration settings. + * + *

Gets the list of alert configuration settings for the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of alert configuration settings for the given vault as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String vaultName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, vaultName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 email configuration model collection along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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 URL to get the next list of items + *

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 email configuration model collection along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/EmailConfigurationsImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/EmailConfigurationsImpl.java new file mode 100644 index 000000000000..10dfd1ed8a72 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/EmailConfigurationsImpl.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.recoveryservicesdatareplication.fluent.EmailConfigurationsClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.EmailConfigurationModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.EmailConfigurationModel; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.EmailConfigurations; + +public final class EmailConfigurationsImpl implements EmailConfigurations { + private static final ClientLogger LOGGER = new ClientLogger(EmailConfigurationsImpl.class); + + private final EmailConfigurationsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + public EmailConfigurationsImpl( + EmailConfigurationsClient innerClient, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String vaultName, String emailConfigurationName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, vaultName, emailConfigurationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EmailConfigurationModelImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EmailConfigurationModel get(String resourceGroupName, String vaultName, String emailConfigurationName) { + EmailConfigurationModelInner inner = + this.serviceClient().get(resourceGroupName, vaultName, emailConfigurationName); + if (inner != null) { + return new EmailConfigurationModelImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String vaultName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, vaultName); + return Utils.mapPage(inner, inner1 -> new EmailConfigurationModelImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String vaultName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, vaultName, context); + return Utils.mapPage(inner, inner1 -> new EmailConfigurationModelImpl(inner1, this.manager())); + } + + public EmailConfigurationModel 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 vaultName = Utils.getValueFromIdByName(id, "replicationVaults"); + if (vaultName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationVaults'.", id))); + } + String emailConfigurationName = Utils.getValueFromIdByName(id, "alertSettings"); + if (emailConfigurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'alertSettings'.", id))); + } + return this.getWithResponse(resourceGroupName, vaultName, emailConfigurationName, 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 vaultName = Utils.getValueFromIdByName(id, "replicationVaults"); + if (vaultName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationVaults'.", id))); + } + String emailConfigurationName = Utils.getValueFromIdByName(id, "alertSettings"); + if (emailConfigurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'alertSettings'.", id))); + } + return this.getWithResponse(resourceGroupName, vaultName, emailConfigurationName, context); + } + + private EmailConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } + + public EmailConfigurationModelImpl define(String name) { + return new EmailConfigurationModelImpl(name, this.manager()); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/EventModelImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/EventModelImpl.java new file mode 100644 index 000000000000..acd74c752f2f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/EventModelImpl.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.recoveryservicesdatareplication.implementation; + +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.EventModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.EventModel; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.EventModelProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.EventModelSystemData; + +public final class EventModelImpl implements EventModel { + private EventModelInner innerObject; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + EventModelImpl( + EventModelInner innerObject, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public EventModelProperties properties() { + return this.innerModel().properties(); + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public EventModelSystemData systemData() { + return this.innerModel().systemData(); + } + + public EventModelInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/EventsClientImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/EventsClientImpl.java new file mode 100644 index 000000000000..04e0fc702fa7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/EventsClientImpl.java @@ -0,0 +1,569 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.resourcemanager.recoveryservicesdatareplication.fluent.EventsClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.EventModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.EventModelCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in EventsClient. */ +public final class EventsClientImpl implements EventsClient { + /** The proxy service used to perform REST calls. */ + private final EventsService service; + + /** The service client containing this operation class. */ + private final DataReplicationMgmtClientImpl client; + + /** + * Initializes an instance of EventsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EventsClientImpl(DataReplicationMgmtClientImpl client) { + this.service = RestProxy.create(EventsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataReplicationMgmtClientEvents to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataReplicationMgmtC") + public interface EventsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("eventName") String eventName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @QueryParam("$filter") String filter, + @QueryParam("continuationToken") String continuationToken, + @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); + } + + /** + * Gets the event. + * + *

Gets the details of the event. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param eventName The event 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 the details of the event along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String eventName) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (eventName == null) { + return Mono.error(new IllegalArgumentException("Parameter eventName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + eventName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the event. + * + *

Gets the details of the event. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param eventName The event 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 the details of the event along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String eventName, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (eventName == null) { + return Mono.error(new IllegalArgumentException("Parameter eventName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + eventName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the event. + * + *

Gets the details of the event. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param eventName The event 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 the details of the event on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String vaultName, String eventName) { + return getWithResponseAsync(resourceGroupName, vaultName, eventName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the event. + * + *

Gets the details of the event. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param eventName The event 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 the details of the event along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String vaultName, String eventName, Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, eventName, context).block(); + } + + /** + * Gets the event. + * + *

Gets the details of the event. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param eventName The event 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 the details of the event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EventModelInner get(String resourceGroupName, String vaultName, String eventName) { + return getWithResponse(resourceGroupName, vaultName, eventName, Context.NONE).getValue(); + } + + /** + * Lists the events. + * + *

Gets the list of events in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param filter Filter string. + * @param continuationToken Continuation token. + * @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 list of events in the given vault along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String vaultName, String filter, String continuationToken) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + filter, + continuationToken, + 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())); + } + + /** + * Lists the events. + * + *

Gets the list of events in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param filter Filter string. + * @param continuationToken Continuation token. + * @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 list of events in the given vault along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String vaultName, String filter, String continuationToken, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName 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(), + resourceGroupName, + vaultName, + filter, + continuationToken, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the events. + * + *

Gets the list of events in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param filter Filter string. + * @param continuationToken Continuation token. + * @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 list of events in the given vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String vaultName, String filter, String continuationToken) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName, filter, continuationToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the events. + * + *

Gets the list of events in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of events in the given vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vaultName) { + final String filter = null; + final String continuationToken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName, filter, continuationToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the events. + * + *

Gets the list of events in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param filter Filter string. + * @param continuationToken Continuation token. + * @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 list of events in the given vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String vaultName, String filter, String continuationToken, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName, filter, continuationToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the events. + * + *

Gets the list of events in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of events in the given vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName) { + final String filter = null; + final String continuationToken = null; + return new PagedIterable<>(listAsync(resourceGroupName, vaultName, filter, continuationToken)); + } + + /** + * Lists the events. + * + *

Gets the list of events in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param filter Filter string. + * @param continuationToken Continuation token. + * @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 list of events in the given vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String vaultName, String filter, String continuationToken, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, vaultName, filter, continuationToken, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 event model collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 event model collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/EventsImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/EventsImpl.java new file mode 100644 index 000000000000..39f53fd8564a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/EventsImpl.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.recoveryservicesdatareplication.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.recoveryservicesdatareplication.fluent.EventsClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.EventModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.EventModel; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.Events; + +public final class EventsImpl implements Events { + private static final ClientLogger LOGGER = new ClientLogger(EventsImpl.class); + + private final EventsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + public EventsImpl( + EventsClient innerClient, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String vaultName, String eventName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, vaultName, eventName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EventModelImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EventModel get(String resourceGroupName, String vaultName, String eventName) { + EventModelInner inner = this.serviceClient().get(resourceGroupName, vaultName, eventName); + if (inner != null) { + return new EventModelImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String vaultName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, vaultName); + return Utils.mapPage(inner, inner1 -> new EventModelImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String vaultName, String filter, String continuationToken, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, vaultName, filter, continuationToken, context); + return Utils.mapPage(inner, inner1 -> new EventModelImpl(inner1, this.manager())); + } + + private EventsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/FabricModelImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/FabricModelImpl.java new file mode 100644 index 000000000000..3d5e022ec620 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/FabricModelImpl.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.FabricModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.FabricModel; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.FabricModelProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.FabricModelSystemData; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.FabricModelUpdate; +import java.util.Collections; +import java.util.Map; + +public final class FabricModelImpl implements FabricModel, FabricModel.Definition, FabricModel.Update { + private FabricModelInner innerObject; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + 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 FabricModelProperties properties() { + return this.innerModel().properties(); + } + + public FabricModelSystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public FabricModelInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String fabricName; + + private FabricModelUpdate updateBody; + + public FabricModelImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public FabricModel create() { + this.innerObject = + serviceManager + .serviceClient() + .getFabrics() + .create(resourceGroupName, fabricName, this.innerModel(), Context.NONE); + return this; + } + + public FabricModel create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFabrics() + .create(resourceGroupName, fabricName, this.innerModel(), context); + return this; + } + + FabricModelImpl( + String name, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerObject = new FabricModelInner(); + this.serviceManager = serviceManager; + this.fabricName = name; + } + + public FabricModelImpl update() { + this.updateBody = new FabricModelUpdate(); + return this; + } + + public FabricModel apply() { + this.innerObject = + serviceManager.serviceClient().getFabrics().update(resourceGroupName, fabricName, updateBody, Context.NONE); + return this; + } + + public FabricModel apply(Context context) { + this.innerObject = + serviceManager.serviceClient().getFabrics().update(resourceGroupName, fabricName, updateBody, context); + return this; + } + + FabricModelImpl( + FabricModelInner innerObject, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.fabricName = Utils.getValueFromIdByName(innerObject.id(), "replicationFabrics"); + } + + public FabricModel refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getFabrics() + .getByResourceGroupWithResponse(resourceGroupName, fabricName, Context.NONE) + .getValue(); + return this; + } + + public FabricModel refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFabrics() + .getByResourceGroupWithResponse(resourceGroupName, fabricName, context) + .getValue(); + return this; + } + + public FabricModelImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public FabricModelImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public FabricModelImpl withProperties(FabricModelProperties properties) { + if (isInCreateMode()) { + this.innerModel().withProperties(properties); + return this; + } else { + this.updateBody.withProperties(properties); + return this; + } + } + + public FabricModelImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/FabricOperationsStatusClientImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/FabricOperationsStatusClientImpl.java new file mode 100644 index 000000000000..342d38147314 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/FabricOperationsStatusClientImpl.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.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.resourcemanager.recoveryservicesdatareplication.fluent.FabricOperationsStatusClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.OperationStatusInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in FabricOperationsStatusClient. */ +public final class FabricOperationsStatusClientImpl implements FabricOperationsStatusClient { + /** The proxy service used to perform REST calls. */ + private final FabricOperationsStatusService service; + + /** The service client containing this operation class. */ + private final DataReplicationMgmtClientImpl client; + + /** + * Initializes an instance of FabricOperationsStatusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FabricOperationsStatusClientImpl(DataReplicationMgmtClientImpl client) { + this.service = + RestProxy + .create(FabricOperationsStatusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataReplicationMgmtClientFabricOperationsStatus to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataReplicationMgmtC") + public interface FabricOperationsStatusService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/operations/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("fabricName") String fabricName, + @PathParam("operationId") String operationId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the fabric operation status. + * + *

Tracks the results of an asynchronous operation on the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param operationId The ID of an ongoing async 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 defines the operation status along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String fabricName, String operationId) { + 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + fabricName, + operationId, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the fabric operation status. + * + *

Tracks the results of an asynchronous operation on the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param operationId The ID of an ongoing async operation. + * @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 defines the operation status along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String fabricName, String operationId, 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + fabricName, + operationId, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the fabric operation status. + * + *

Tracks the results of an asynchronous operation on the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param operationId The ID of an ongoing async 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 defines the operation status on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String fabricName, String operationId) { + return getWithResponseAsync(resourceGroupName, fabricName, operationId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the fabric operation status. + * + *

Tracks the results of an asynchronous operation on the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param operationId The ID of an ongoing async operation. + * @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 defines the operation status along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String fabricName, String operationId, Context context) { + return getWithResponseAsync(resourceGroupName, fabricName, operationId, context).block(); + } + + /** + * Gets the fabric operation status. + * + *

Tracks the results of an asynchronous operation on the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param operationId The ID of an ongoing async 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 defines the operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner get(String resourceGroupName, String fabricName, String operationId) { + return getWithResponse(resourceGroupName, fabricName, operationId, Context.NONE).getValue(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/FabricOperationsStatusImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/FabricOperationsStatusImpl.java new file mode 100644 index 000000000000..2c6a125175cc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/FabricOperationsStatusImpl.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.implementation; + +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.recoveryservicesdatareplication.fluent.FabricOperationsStatusClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.FabricOperationsStatus; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.OperationStatus; + +public final class FabricOperationsStatusImpl implements FabricOperationsStatus { + private static final ClientLogger LOGGER = new ClientLogger(FabricOperationsStatusImpl.class); + + private final FabricOperationsStatusClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + public FabricOperationsStatusImpl( + FabricOperationsStatusClient innerClient, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String fabricName, String operationId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, fabricName, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OperationStatusImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OperationStatus get(String resourceGroupName, String fabricName, String operationId) { + OperationStatusInner inner = this.serviceClient().get(resourceGroupName, fabricName, operationId); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + private FabricOperationsStatusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/FabricsClientImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/FabricsClientImpl.java new file mode 100644 index 000000000000..4777a9114c8c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/FabricsClientImpl.java @@ -0,0 +1,1765 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.FabricsClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.FabricModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.FabricModelCollection; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.FabricModelUpdate; +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 FabricsClient. */ +public final class FabricsClientImpl implements FabricsClient { + /** The proxy service used to perform REST calls. */ + private final FabricsService service; + + /** The service client containing this operation class. */ + private final DataReplicationMgmtClientImpl client; + + /** + * Initializes an instance of FabricsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FabricsClientImpl(DataReplicationMgmtClientImpl client) { + this.service = RestProxy.create(FabricsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataReplicationMgmtClientFabrics to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataReplicationMgmtC") + public interface FabricsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("fabricName") String fabricName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("fabricName") String fabricName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") FabricModelInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("fabricName") String fabricName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") FabricModelUpdate body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("fabricName") String fabricName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationFabrics") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("continuationToken") String continuationToken, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("continuationToken") String continuationToken, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @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> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the fabric. + * + *

Gets the details of the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the details of the fabric along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String fabricName) { + 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + fabricName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the fabric. + * + *

Gets the details of the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the details of the fabric along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String fabricName, 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName 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, + fabricName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the fabric. + * + *

Gets the details of the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the details of the fabric on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String fabricName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, fabricName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the fabric. + * + *

Gets the details of the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the details of the fabric along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String fabricName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, fabricName, context).block(); + } + + /** + * Gets the fabric. + * + *

Gets the details of the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the details of the fabric. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FabricModelInner getByResourceGroup(String resourceGroupName, String fabricName) { + return getByResourceGroupWithResponse(resourceGroupName, fabricName, Context.NONE).getValue(); + } + + /** + * Puts the fabric. + * + *

Creates the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param body Fabric properties. + * @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 fabric model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String fabricName, FabricModelInner body) { + 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + fabricName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Puts the fabric. + * + *

Creates the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param body Fabric properties. + * @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 fabric model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String fabricName, FabricModelInner body, 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + fabricName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Puts the fabric. + * + *

Creates the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param body Fabric properties. + * @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 {@link PollerFlux} for polling of fabric model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FabricModelInner> beginCreateAsync( + String resourceGroupName, String fabricName, FabricModelInner body) { + Mono>> mono = createWithResponseAsync(resourceGroupName, fabricName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FabricModelInner.class, + FabricModelInner.class, + this.client.getContext()); + } + + /** + * Puts the fabric. + * + *

Creates the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the {@link PollerFlux} for polling of fabric model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FabricModelInner> beginCreateAsync( + String resourceGroupName, String fabricName) { + final FabricModelInner body = null; + Mono>> mono = createWithResponseAsync(resourceGroupName, fabricName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FabricModelInner.class, + FabricModelInner.class, + this.client.getContext()); + } + + /** + * Puts the fabric. + * + *

Creates the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param body Fabric properties. + * @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 {@link PollerFlux} for polling of fabric model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FabricModelInner> beginCreateAsync( + String resourceGroupName, String fabricName, FabricModelInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createWithResponseAsync(resourceGroupName, fabricName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), FabricModelInner.class, FabricModelInner.class, context); + } + + /** + * Puts the fabric. + * + *

Creates the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the {@link SyncPoller} for polling of fabric model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FabricModelInner> beginCreate( + String resourceGroupName, String fabricName) { + final FabricModelInner body = null; + return this.beginCreateAsync(resourceGroupName, fabricName, body).getSyncPoller(); + } + + /** + * Puts the fabric. + * + *

Creates the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param body Fabric properties. + * @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 {@link SyncPoller} for polling of fabric model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FabricModelInner> beginCreate( + String resourceGroupName, String fabricName, FabricModelInner body, Context context) { + return this.beginCreateAsync(resourceGroupName, fabricName, body, context).getSyncPoller(); + } + + /** + * Puts the fabric. + * + *

Creates the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param body Fabric properties. + * @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 fabric model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String fabricName, FabricModelInner body) { + return beginCreateAsync(resourceGroupName, fabricName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the fabric. + * + *

Creates the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 fabric model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String fabricName) { + final FabricModelInner body = null; + return beginCreateAsync(resourceGroupName, fabricName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the fabric. + * + *

Creates the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param body Fabric properties. + * @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 fabric model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String fabricName, FabricModelInner body, Context context) { + return beginCreateAsync(resourceGroupName, fabricName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the fabric. + * + *

Creates the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 fabric model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FabricModelInner create(String resourceGroupName, String fabricName) { + final FabricModelInner body = null; + return createAsync(resourceGroupName, fabricName, body).block(); + } + + /** + * Puts the fabric. + * + *

Creates the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param body Fabric properties. + * @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 fabric model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FabricModelInner create( + String resourceGroupName, String fabricName, FabricModelInner body, Context context) { + return createAsync(resourceGroupName, fabricName, body, context).block(); + } + + /** + * Updates the fabric. + * + *

Performs update on the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param body Fabric properties. + * @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 fabric model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String fabricName, FabricModelUpdate body) { + 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + fabricName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the fabric. + * + *

Performs update on the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param body Fabric properties. + * @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 fabric model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String fabricName, FabricModelUpdate body, 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + fabricName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Updates the fabric. + * + *

Performs update on the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param body Fabric properties. + * @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 {@link PollerFlux} for polling of fabric model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FabricModelInner> beginUpdateAsync( + String resourceGroupName, String fabricName, FabricModelUpdate body) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, fabricName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FabricModelInner.class, + FabricModelInner.class, + this.client.getContext()); + } + + /** + * Updates the fabric. + * + *

Performs update on the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the {@link PollerFlux} for polling of fabric model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FabricModelInner> beginUpdateAsync( + String resourceGroupName, String fabricName) { + final FabricModelUpdate body = null; + Mono>> mono = updateWithResponseAsync(resourceGroupName, fabricName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FabricModelInner.class, + FabricModelInner.class, + this.client.getContext()); + } + + /** + * Updates the fabric. + * + *

Performs update on the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param body Fabric properties. + * @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 {@link PollerFlux} for polling of fabric model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FabricModelInner> beginUpdateAsync( + String resourceGroupName, String fabricName, FabricModelUpdate body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, fabricName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), FabricModelInner.class, FabricModelInner.class, context); + } + + /** + * Updates the fabric. + * + *

Performs update on the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the {@link SyncPoller} for polling of fabric model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FabricModelInner> beginUpdate( + String resourceGroupName, String fabricName) { + final FabricModelUpdate body = null; + return this.beginUpdateAsync(resourceGroupName, fabricName, body).getSyncPoller(); + } + + /** + * Updates the fabric. + * + *

Performs update on the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param body Fabric properties. + * @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 {@link SyncPoller} for polling of fabric model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FabricModelInner> beginUpdate( + String resourceGroupName, String fabricName, FabricModelUpdate body, Context context) { + return this.beginUpdateAsync(resourceGroupName, fabricName, body, context).getSyncPoller(); + } + + /** + * Updates the fabric. + * + *

Performs update on the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param body Fabric properties. + * @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 fabric model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String fabricName, FabricModelUpdate body) { + return beginUpdateAsync(resourceGroupName, fabricName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the fabric. + * + *

Performs update on the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 fabric model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String fabricName) { + final FabricModelUpdate body = null; + return beginUpdateAsync(resourceGroupName, fabricName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the fabric. + * + *

Performs update on the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param body Fabric properties. + * @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 fabric model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String fabricName, FabricModelUpdate body, Context context) { + return beginUpdateAsync(resourceGroupName, fabricName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the fabric. + * + *

Performs update on the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 fabric model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FabricModelInner update(String resourceGroupName, String fabricName) { + final FabricModelUpdate body = null; + return updateAsync(resourceGroupName, fabricName, body).block(); + } + + /** + * Updates the fabric. + * + *

Performs update on the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param body Fabric properties. + * @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 fabric model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FabricModelInner update( + String resourceGroupName, String fabricName, FabricModelUpdate body, Context context) { + return updateAsync(resourceGroupName, fabricName, body, context).block(); + } + + /** + * Deletes the fabric. + * + *

Removes the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String fabricName) { + 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + fabricName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the fabric. + * + *

Removes the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String fabricName, 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 (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + fabricName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the fabric. + * + *

Removes the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String fabricName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, fabricName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the fabric. + * + *

Removes the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String fabricName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, fabricName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the fabric. + * + *

Removes the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String fabricName) { + return this.beginDeleteAsync(resourceGroupName, fabricName).getSyncPoller(); + } + + /** + * Deletes the fabric. + * + *

Removes the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String fabricName, Context context) { + return this.beginDeleteAsync(resourceGroupName, fabricName, context).getSyncPoller(); + } + + /** + * Deletes the fabric. + * + *

Removes the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String fabricName) { + return beginDeleteAsync(resourceGroupName, fabricName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the fabric. + * + *

Removes the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String fabricName, Context context) { + return beginDeleteAsync(resourceGroupName, fabricName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the fabric. + * + *

Removes the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String fabricName) { + deleteAsync(resourceGroupName, fabricName).block(); + } + + /** + * Deletes the fabric. + * + *

Removes the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String fabricName, Context context) { + deleteAsync(resourceGroupName, fabricName, context).block(); + } + + /** + * Lists the fabrics. + * + *

Gets the list of fabrics in the given subscription. + * + * @param continuationToken Continuation token from the previous call. + * @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 list of fabrics in the given subscription along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String continuationToken) { + 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(), + continuationToken, + 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())); + } + + /** + * Lists the fabrics. + * + *

Gets the list of fabrics in the given subscription. + * + * @param continuationToken Continuation token from the previous call. + * @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 list of fabrics in the given subscription along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String continuationToken, 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(), + continuationToken, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the fabrics. + * + *

Gets the list of fabrics in the given subscription. + * + * @param continuationToken Continuation token from the previous call. + * @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 list of fabrics in the given subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String continuationToken) { + return new PagedFlux<>( + () -> listSinglePageAsync(continuationToken), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists the fabrics. + * + *

Gets the list of fabrics in the given 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 the list of fabrics in the given subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String continuationToken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(continuationToken), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists the fabrics. + * + *

Gets the list of fabrics in the given subscription. + * + * @param continuationToken Continuation token from the previous call. + * @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 list of fabrics in the given subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String continuationToken, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(continuationToken, context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the fabrics. + * + *

Gets the list of fabrics in the given 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 the list of fabrics in the given subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String continuationToken = null; + return new PagedIterable<>(listAsync(continuationToken)); + } + + /** + * Lists the fabrics. + * + *

Gets the list of fabrics in the given subscription. + * + * @param continuationToken Continuation token from the previous call. + * @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 list of fabrics in the given subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String continuationToken, Context context) { + return new PagedIterable<>(listAsync(continuationToken, context)); + } + + /** + * Lists the fabrics. + * + *

Gets the list of fabrics in the given subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param continuationToken Continuation token from the previous call. + * @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 list of fabrics in the given subscription and resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String continuationToken) { + 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, + continuationToken, + 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())); + } + + /** + * Lists the fabrics. + * + *

Gets the list of fabrics in the given subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param continuationToken Continuation token from the previous call. + * @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 list of fabrics in the given subscription and resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String continuationToken, 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, + continuationToken, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the fabrics. + * + *

Gets the list of fabrics in the given subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param continuationToken Continuation token from the previous call. + * @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 list of fabrics in the given subscription and resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String continuationToken) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, continuationToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the fabrics. + * + *

Gets the list of fabrics in the given subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of fabrics in the given subscription and resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String continuationToken = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, continuationToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the fabrics. + * + *

Gets the list of fabrics in the given subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param continuationToken Continuation token from the previous call. + * @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 list of fabrics in the given subscription and resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String continuationToken, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, continuationToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the fabrics. + * + *

Gets the list of fabrics in the given subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of fabrics in the given subscription and resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String continuationToken = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, continuationToken)); + } + + /** + * Lists the fabrics. + * + *

Gets the list of fabrics in the given subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param continuationToken Continuation token from the previous call. + * @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 list of fabrics in the given subscription and resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, String continuationToken, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, continuationToken, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 fabric model collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(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 URL to get the next list of items + *

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 fabric model collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + 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 + .listBySubscriptionNext(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 URL to get the next list of items + *

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 fabric model collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 fabric model collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/FabricsImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/FabricsImpl.java new file mode 100644 index 000000000000..fb24a7cb15fd --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/FabricsImpl.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.recoveryservicesdatareplication.fluent.FabricsClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.FabricModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.FabricModel; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.Fabrics; + +public final class FabricsImpl implements Fabrics { + private static final ClientLogger LOGGER = new ClientLogger(FabricsImpl.class); + + private final FabricsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + public FabricsImpl( + FabricsClient innerClient, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String fabricName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, fabricName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FabricModelImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public FabricModel getByResourceGroup(String resourceGroupName, String fabricName) { + FabricModelInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, fabricName); + if (inner != null) { + return new FabricModelImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String fabricName) { + this.serviceClient().delete(resourceGroupName, fabricName); + } + + public void delete(String resourceGroupName, String fabricName, Context context) { + this.serviceClient().delete(resourceGroupName, fabricName, context); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new FabricModelImpl(inner1, this.manager())); + } + + public PagedIterable list(String continuationToken, Context context) { + PagedIterable inner = this.serviceClient().list(continuationToken, context); + return Utils.mapPage(inner, inner1 -> new FabricModelImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new FabricModelImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, String continuationToken, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, continuationToken, context); + return Utils.mapPage(inner, inner1 -> new FabricModelImpl(inner1, this.manager())); + } + + public FabricModel 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 fabricName = Utils.getValueFromIdByName(id, "replicationFabrics"); + if (fabricName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationFabrics'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, fabricName, 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 fabricName = Utils.getValueFromIdByName(id, "replicationFabrics"); + if (fabricName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationFabrics'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, fabricName, 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 fabricName = Utils.getValueFromIdByName(id, "replicationFabrics"); + if (fabricName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationFabrics'.", id))); + } + this.delete(resourceGroupName, fabricName, 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 fabricName = Utils.getValueFromIdByName(id, "replicationFabrics"); + if (fabricName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationFabrics'.", id))); + } + this.delete(resourceGroupName, fabricName, context); + } + + private FabricsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } + + public FabricModelImpl define(String name) { + return new FabricModelImpl(name, this.manager()); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/OperationImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/OperationImpl.java new file mode 100644 index 000000000000..efb0bce60d0f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/OperationImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.implementation; + +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.OperationInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ActionType; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.Operation; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.OperationDisplay; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + OperationImpl( + OperationInner innerObject, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/OperationStatusImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/OperationStatusImpl.java new file mode 100644 index 000000000000..4cd6d111702b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/OperationStatusImpl.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.implementation; + +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.OperationStatus; + +public final class OperationStatusImpl implements OperationStatus { + private OperationStatusInner innerObject; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + OperationStatusImpl( + OperationStatusInner innerObject, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String status() { + return this.innerModel().status(); + } + + public String startTime() { + return this.innerModel().startTime(); + } + + public String endTime() { + return this.innerModel().endTime(); + } + + public OperationStatusInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/OperationsClientImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..1860c3852ca5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/OperationsClientImpl.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.resourcemanager.recoveryservicesdatareplication.fluent.OperationsClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.OperationInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.OperationListResult; +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 { + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final DataReplicationMgmtClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(DataReplicationMgmtClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataReplicationMgmtClientOperations to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataReplicationMgmtC") + public interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.DataReplication/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); + } + + /** + * Get a list of REST API operations supported by Microsoft.DataReplication. + * + *

Gets the operations. + * + * @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 operations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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())); + } + + /** + * Get a list of REST API operations supported by Microsoft.DataReplication. + * + *

Gets the operations. + * + * @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 operations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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)); + } + + /** + * Get a list of REST API operations supported by Microsoft.DataReplication. + * + *

Gets the operations. + * + * @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 operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get a list of REST API operations supported by Microsoft.DataReplication. + * + *

Gets the operations. + * + * @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 operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get a list of REST API operations supported by Microsoft.DataReplication. + * + *

Gets the operations. + * + * @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 operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Get a list of REST API operations supported by Microsoft.DataReplication. + * + *

Gets the operations. + * + * @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 operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/OperationsImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/OperationsImpl.java new file mode 100644 index 000000000000..7eee4eef0175 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/OperationsImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.recoveryservicesdatareplication.fluent.OperationsClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.OperationInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.Operation; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + public OperationsImpl( + OperationsClient innerClient, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/PlannedFailoverModelImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/PlannedFailoverModelImpl.java new file mode 100644 index 000000000000..3cb10a678aa4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/PlannedFailoverModelImpl.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.recoveryservicesdatareplication.implementation; + +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.PlannedFailoverModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.PlannedFailoverModel; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.PlannedFailoverModelProperties; + +public final class PlannedFailoverModelImpl implements PlannedFailoverModel { + private PlannedFailoverModelInner innerObject; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + PlannedFailoverModelImpl( + PlannedFailoverModelInner innerObject, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public PlannedFailoverModelProperties properties() { + return this.innerModel().properties(); + } + + public PlannedFailoverModelInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/PoliciesClientImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/PoliciesClientImpl.java new file mode 100644 index 000000000000..a55861eb4fdc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/PoliciesClientImpl.java @@ -0,0 +1,1183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.PoliciesClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.PolicyModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.PolicyModelCollection; +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 PoliciesClient. */ +public final class PoliciesClientImpl implements PoliciesClient { + /** The proxy service used to perform REST calls. */ + private final PoliciesService service; + + /** The service client containing this operation class. */ + private final DataReplicationMgmtClientImpl client; + + /** + * Initializes an instance of PoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PoliciesClientImpl(DataReplicationMgmtClientImpl client) { + this.service = RestProxy.create(PoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataReplicationMgmtClientPolicies to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataReplicationMgmtC") + public interface PoliciesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("policyName") String policyName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("policyName") String policyName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PolicyModelInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("policyName") String policyName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @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); + } + + /** + * Gets the policy. + * + *

Gets the details of the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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 the details of the policy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String policyName) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + policyName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the policy. + * + *

Gets the details of the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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 the details of the policy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String policyName, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + policyName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the policy. + * + *

Gets the details of the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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 the details of the policy on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String vaultName, String policyName) { + return getWithResponseAsync(resourceGroupName, vaultName, policyName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the policy. + * + *

Gets the details of the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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 the details of the policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String vaultName, String policyName, Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, policyName, context).block(); + } + + /** + * Gets the policy. + * + *

Gets the details of the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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 the details of the policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicyModelInner get(String resourceGroupName, String vaultName, String policyName) { + return getWithResponse(resourceGroupName, vaultName, policyName, Context.NONE).getValue(); + } + + /** + * Puts the policy. + * + *

Creates the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy name. + * @param body Policy model. + * @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 policy model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String vaultName, String policyName, PolicyModelInner body) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + policyName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Puts the policy. + * + *

Creates the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy name. + * @param body Policy model. + * @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 policy model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String vaultName, String policyName, PolicyModelInner body, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + policyName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Puts the policy. + * + *

Creates the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy name. + * @param body Policy model. + * @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 {@link PollerFlux} for polling of policy model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PolicyModelInner> beginCreateAsync( + String resourceGroupName, String vaultName, String policyName, PolicyModelInner body) { + Mono>> mono = createWithResponseAsync(resourceGroupName, vaultName, policyName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PolicyModelInner.class, + PolicyModelInner.class, + this.client.getContext()); + } + + /** + * Puts the policy. + * + *

Creates the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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 the {@link PollerFlux} for polling of policy model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PolicyModelInner> beginCreateAsync( + String resourceGroupName, String vaultName, String policyName) { + final PolicyModelInner body = null; + Mono>> mono = createWithResponseAsync(resourceGroupName, vaultName, policyName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PolicyModelInner.class, + PolicyModelInner.class, + this.client.getContext()); + } + + /** + * Puts the policy. + * + *

Creates the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy name. + * @param body Policy model. + * @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 {@link PollerFlux} for polling of policy model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PolicyModelInner> beginCreateAsync( + String resourceGroupName, String vaultName, String policyName, PolicyModelInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, vaultName, policyName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PolicyModelInner.class, PolicyModelInner.class, context); + } + + /** + * Puts the policy. + * + *

Creates the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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 the {@link SyncPoller} for polling of policy model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PolicyModelInner> beginCreate( + String resourceGroupName, String vaultName, String policyName) { + final PolicyModelInner body = null; + return this.beginCreateAsync(resourceGroupName, vaultName, policyName, body).getSyncPoller(); + } + + /** + * Puts the policy. + * + *

Creates the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy name. + * @param body Policy model. + * @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 {@link SyncPoller} for polling of policy model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PolicyModelInner> beginCreate( + String resourceGroupName, String vaultName, String policyName, PolicyModelInner body, Context context) { + return this.beginCreateAsync(resourceGroupName, vaultName, policyName, body, context).getSyncPoller(); + } + + /** + * Puts the policy. + * + *

Creates the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy name. + * @param body Policy model. + * @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 policy model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String vaultName, String policyName, PolicyModelInner body) { + return beginCreateAsync(resourceGroupName, vaultName, policyName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the policy. + * + *

Creates the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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 policy model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String vaultName, String policyName) { + final PolicyModelInner body = null; + return beginCreateAsync(resourceGroupName, vaultName, policyName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the policy. + * + *

Creates the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy name. + * @param body Policy model. + * @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 policy model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String vaultName, String policyName, PolicyModelInner body, Context context) { + return beginCreateAsync(resourceGroupName, vaultName, policyName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the policy. + * + *

Creates the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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 policy model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicyModelInner create(String resourceGroupName, String vaultName, String policyName) { + final PolicyModelInner body = null; + return createAsync(resourceGroupName, vaultName, policyName, body).block(); + } + + /** + * Puts the policy. + * + *

Creates the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy name. + * @param body Policy model. + * @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 policy model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicyModelInner create( + String resourceGroupName, String vaultName, String policyName, PolicyModelInner body, Context context) { + return createAsync(resourceGroupName, vaultName, policyName, body, context).block(); + } + + /** + * Deletes the policy. + * + *

Removes the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String vaultName, String policyName) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + policyName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the policy. + * + *

Removes the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String vaultName, String policyName, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + policyName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the policy. + * + *

Removes the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String vaultName, String policyName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, vaultName, policyName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the policy. + * + *

Removes the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String vaultName, String policyName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vaultName, policyName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the policy. + * + *

Removes the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vaultName, String policyName) { + return this.beginDeleteAsync(resourceGroupName, vaultName, policyName).getSyncPoller(); + } + + /** + * Deletes the policy. + * + *

Removes the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vaultName, String policyName, Context context) { + return this.beginDeleteAsync(resourceGroupName, vaultName, policyName, context).getSyncPoller(); + } + + /** + * Deletes the policy. + * + *

Removes the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String vaultName, String policyName) { + return beginDeleteAsync(resourceGroupName, vaultName, policyName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the policy. + * + *

Removes the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String vaultName, String policyName, Context context) { + return beginDeleteAsync(resourceGroupName, vaultName, policyName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the policy. + * + *

Removes the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String vaultName, String policyName) { + deleteAsync(resourceGroupName, vaultName, policyName).block(); + } + + /** + * Deletes the policy. + * + *

Removes the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String vaultName, String policyName, Context context) { + deleteAsync(resourceGroupName, vaultName, policyName, context).block(); + } + + /** + * Lists the policies. + * + *

Gets the list of policies in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of policies in the given vault along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String vaultName) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + 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())); + } + + /** + * Lists the policies. + * + *

Gets the list of policies in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of policies in the given vault along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String vaultName, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName 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(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the policies. + * + *

Gets the list of policies in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of policies in the given vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vaultName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the policies. + * + *

Gets the list of policies in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of policies in the given vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vaultName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the policies. + * + *

Gets the list of policies in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of policies in the given vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName) { + return new PagedIterable<>(listAsync(resourceGroupName, vaultName)); + } + + /** + * Lists the policies. + * + *

Gets the list of policies in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of policies in the given vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, vaultName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 policy model collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 policy model collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/PoliciesImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/PoliciesImpl.java new file mode 100644 index 000000000000..99e1adaa04fb --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/PoliciesImpl.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.recoveryservicesdatareplication.fluent.PoliciesClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.PolicyModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.Policies; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.PolicyModel; + +public final class PoliciesImpl implements Policies { + private static final ClientLogger LOGGER = new ClientLogger(PoliciesImpl.class); + + private final PoliciesClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + public PoliciesImpl( + PoliciesClient innerClient, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String vaultName, String policyName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, vaultName, policyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PolicyModelImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PolicyModel get(String resourceGroupName, String vaultName, String policyName) { + PolicyModelInner inner = this.serviceClient().get(resourceGroupName, vaultName, policyName); + if (inner != null) { + return new PolicyModelImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String vaultName, String policyName) { + this.serviceClient().delete(resourceGroupName, vaultName, policyName); + } + + public void delete(String resourceGroupName, String vaultName, String policyName, Context context) { + this.serviceClient().delete(resourceGroupName, vaultName, policyName, context); + } + + public PagedIterable list(String resourceGroupName, String vaultName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, vaultName); + return Utils.mapPage(inner, inner1 -> new PolicyModelImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String vaultName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, vaultName, context); + return Utils.mapPage(inner, inner1 -> new PolicyModelImpl(inner1, this.manager())); + } + + public PolicyModel 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 vaultName = Utils.getValueFromIdByName(id, "replicationVaults"); + if (vaultName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationVaults'.", id))); + } + String policyName = Utils.getValueFromIdByName(id, "replicationPolicies"); + if (policyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, vaultName, policyName, 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 vaultName = Utils.getValueFromIdByName(id, "replicationVaults"); + if (vaultName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationVaults'.", id))); + } + String policyName = Utils.getValueFromIdByName(id, "replicationPolicies"); + if (policyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, vaultName, policyName, 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 vaultName = Utils.getValueFromIdByName(id, "replicationVaults"); + if (vaultName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationVaults'.", id))); + } + String policyName = Utils.getValueFromIdByName(id, "replicationPolicies"); + if (policyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationPolicies'.", id))); + } + this.delete(resourceGroupName, vaultName, policyName, 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 vaultName = Utils.getValueFromIdByName(id, "replicationVaults"); + if (vaultName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationVaults'.", id))); + } + String policyName = Utils.getValueFromIdByName(id, "replicationPolicies"); + if (policyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationPolicies'.", id))); + } + this.delete(resourceGroupName, vaultName, policyName, context); + } + + private PoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } + + public PolicyModelImpl define(String name) { + return new PolicyModelImpl(name, this.manager()); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/PolicyModelImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/PolicyModelImpl.java new file mode 100644 index 000000000000..fc8df1fbb7d8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/PolicyModelImpl.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.recoveryservicesdatareplication.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.PolicyModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.PolicyModel; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.PolicyModelProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.PolicyModelSystemData; + +public final class PolicyModelImpl implements PolicyModel, PolicyModel.Definition { + private PolicyModelInner innerObject; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + PolicyModelImpl( + PolicyModelInner innerObject, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public PolicyModelProperties properties() { + return this.innerModel().properties(); + } + + public PolicyModelSystemData systemData() { + return this.innerModel().systemData(); + } + + public PolicyModelInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String vaultName; + + private String policyName; + + public PolicyModelImpl withExistingReplicationVault(String resourceGroupName, String vaultName) { + this.resourceGroupName = resourceGroupName; + this.vaultName = vaultName; + return this; + } + + public PolicyModel create() { + this.innerObject = + serviceManager + .serviceClient() + .getPolicies() + .create(resourceGroupName, vaultName, policyName, this.innerModel(), Context.NONE); + return this; + } + + public PolicyModel create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPolicies() + .create(resourceGroupName, vaultName, policyName, this.innerModel(), context); + return this; + } + + PolicyModelImpl( + String name, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerObject = new PolicyModelInner(); + this.serviceManager = serviceManager; + this.policyName = name; + } + + public PolicyModel refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPolicies() + .getWithResponse(resourceGroupName, vaultName, policyName, Context.NONE) + .getValue(); + return this; + } + + public PolicyModel refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPolicies() + .getWithResponse(resourceGroupName, vaultName, policyName, context) + .getValue(); + return this; + } + + public PolicyModelImpl withProperties(PolicyModelProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/PolicyOperationStatusClientImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/PolicyOperationStatusClientImpl.java new file mode 100644 index 000000000000..6879d70c8f34 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/PolicyOperationStatusClientImpl.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.recoveryservicesdatareplication.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.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.resourcemanager.recoveryservicesdatareplication.fluent.PolicyOperationStatusClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.OperationStatusInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PolicyOperationStatusClient. */ +public final class PolicyOperationStatusClientImpl implements PolicyOperationStatusClient { + /** The proxy service used to perform REST calls. */ + private final PolicyOperationStatusService service; + + /** The service client containing this operation class. */ + private final DataReplicationMgmtClientImpl client; + + /** + * Initializes an instance of PolicyOperationStatusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PolicyOperationStatusClientImpl(DataReplicationMgmtClientImpl client) { + this.service = + RestProxy + .create(PolicyOperationStatusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataReplicationMgmtClientPolicyOperationStatus to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataReplicationMgmtC") + public interface PolicyOperationStatusService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName}/operations/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("policyName") String policyName, + @PathParam("operationId") String operationId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the policy operation status. + * + *

Tracks the results of an asynchronous operation on the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy name. + * @param operationId The ID of an ongoing async 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 defines the operation status along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String policyName, String operationId) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + policyName, + operationId, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the policy operation status. + * + *

Tracks the results of an asynchronous operation on the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy name. + * @param operationId The ID of an ongoing async operation. + * @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 defines the operation status along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String policyName, String operationId, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + policyName, + operationId, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the policy operation status. + * + *

Tracks the results of an asynchronous operation on the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy name. + * @param operationId The ID of an ongoing async 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 defines the operation status on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String vaultName, String policyName, String operationId) { + return getWithResponseAsync(resourceGroupName, vaultName, policyName, operationId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the policy operation status. + * + *

Tracks the results of an asynchronous operation on the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy name. + * @param operationId The ID of an ongoing async operation. + * @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 defines the operation status along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String vaultName, String policyName, String operationId, Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, policyName, operationId, context).block(); + } + + /** + * Gets the policy operation status. + * + *

Tracks the results of an asynchronous operation on the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy name. + * @param operationId The ID of an ongoing async 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 defines the operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner get(String resourceGroupName, String vaultName, String policyName, String operationId) { + return getWithResponse(resourceGroupName, vaultName, policyName, operationId, Context.NONE).getValue(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/PolicyOperationStatusImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/PolicyOperationStatusImpl.java new file mode 100644 index 000000000000..7acfec452a86 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/PolicyOperationStatusImpl.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.implementation; + +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.recoveryservicesdatareplication.fluent.PolicyOperationStatusClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.OperationStatus; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.PolicyOperationStatus; + +public final class PolicyOperationStatusImpl implements PolicyOperationStatus { + private static final ClientLogger LOGGER = new ClientLogger(PolicyOperationStatusImpl.class); + + private final PolicyOperationStatusClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + public PolicyOperationStatusImpl( + PolicyOperationStatusClient innerClient, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String vaultName, String policyName, String operationId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, vaultName, policyName, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OperationStatusImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OperationStatus get(String resourceGroupName, String vaultName, String policyName, String operationId) { + OperationStatusInner inner = this.serviceClient().get(resourceGroupName, vaultName, policyName, operationId); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + private PolicyOperationStatusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ProtectedItemModelImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ProtectedItemModelImpl.java new file mode 100644 index 000000000000..a4fd33564550 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ProtectedItemModelImpl.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.PlannedFailoverModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.ProtectedItemModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.PlannedFailoverModel; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ProtectedItemModel; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ProtectedItemModelProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ProtectedItemModelSystemData; + +public final class ProtectedItemModelImpl implements ProtectedItemModel, ProtectedItemModel.Definition { + private ProtectedItemModelInner innerObject; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + ProtectedItemModelImpl( + ProtectedItemModelInner innerObject, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ProtectedItemModelProperties properties() { + return this.innerModel().properties(); + } + + public ProtectedItemModelSystemData systemData() { + return this.innerModel().systemData(); + } + + public ProtectedItemModelInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String vaultName; + + private String protectedItemName; + + public ProtectedItemModelImpl withExistingReplicationVault(String resourceGroupName, String vaultName) { + this.resourceGroupName = resourceGroupName; + this.vaultName = vaultName; + return this; + } + + public ProtectedItemModel create() { + this.innerObject = + serviceManager + .serviceClient() + .getProtectedItems() + .create(resourceGroupName, vaultName, protectedItemName, this.innerModel(), Context.NONE); + return this; + } + + public ProtectedItemModel create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getProtectedItems() + .create(resourceGroupName, vaultName, protectedItemName, this.innerModel(), context); + return this; + } + + ProtectedItemModelImpl( + String name, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerObject = new ProtectedItemModelInner(); + this.serviceManager = serviceManager; + this.protectedItemName = name; + } + + public ProtectedItemModel refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getProtectedItems() + .getWithResponse(resourceGroupName, vaultName, protectedItemName, Context.NONE) + .getValue(); + return this; + } + + public ProtectedItemModel refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getProtectedItems() + .getWithResponse(resourceGroupName, vaultName, protectedItemName, context) + .getValue(); + return this; + } + + public PlannedFailoverModel plannedFailover() { + return serviceManager.protectedItems().plannedFailover(resourceGroupName, vaultName, protectedItemName); + } + + public PlannedFailoverModel plannedFailover(PlannedFailoverModelInner body, Context context) { + return serviceManager + .protectedItems() + .plannedFailover(resourceGroupName, vaultName, protectedItemName, body, context); + } + + public ProtectedItemModelImpl withProperties(ProtectedItemModelProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ProtectedItemOperationStatusClientImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ProtectedItemOperationStatusClientImpl.java new file mode 100644 index 000000000000..a7f839198369 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ProtectedItemOperationStatusClientImpl.java @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.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.resourcemanager.recoveryservicesdatareplication.fluent.ProtectedItemOperationStatusClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.OperationStatusInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ProtectedItemOperationStatusClient. */ +public final class ProtectedItemOperationStatusClientImpl implements ProtectedItemOperationStatusClient { + /** The proxy service used to perform REST calls. */ + private final ProtectedItemOperationStatusService service; + + /** The service client containing this operation class. */ + private final DataReplicationMgmtClientImpl client; + + /** + * Initializes an instance of ProtectedItemOperationStatusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProtectedItemOperationStatusClientImpl(DataReplicationMgmtClientImpl client) { + this.service = + RestProxy + .create( + ProtectedItemOperationStatusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataReplicationMgmtClientProtectedItemOperationStatus to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataReplicationMgmtC") + public interface ProtectedItemOperationStatusService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/operations/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("protectedItemName") String protectedItemName, + @PathParam("operationId") String operationId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the protected item operation status. + * + *

Tracks the results of an asynchronous operation on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param operationId The ID of an ongoing async 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 defines the operation status along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String protectedItemName, String operationId) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + protectedItemName, + operationId, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the protected item operation status. + * + *

Tracks the results of an asynchronous operation on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param operationId The ID of an ongoing async operation. + * @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 defines the operation status along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String protectedItemName, String operationId, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + protectedItemName, + operationId, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the protected item operation status. + * + *

Tracks the results of an asynchronous operation on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param operationId The ID of an ongoing async 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 defines the operation status on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String vaultName, String protectedItemName, String operationId) { + return getWithResponseAsync(resourceGroupName, vaultName, protectedItemName, operationId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the protected item operation status. + * + *

Tracks the results of an asynchronous operation on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param operationId The ID of an ongoing async operation. + * @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 defines the operation status along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String vaultName, String protectedItemName, String operationId, Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, protectedItemName, operationId, context).block(); + } + + /** + * Gets the protected item operation status. + * + *

Tracks the results of an asynchronous operation on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param operationId The ID of an ongoing async 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 defines the operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner get( + String resourceGroupName, String vaultName, String protectedItemName, String operationId) { + return getWithResponse(resourceGroupName, vaultName, protectedItemName, operationId, Context.NONE).getValue(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ProtectedItemOperationStatusImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ProtectedItemOperationStatusImpl.java new file mode 100644 index 000000000000..5d7878fbbc87 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ProtectedItemOperationStatusImpl.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.recoveryservicesdatareplication.implementation; + +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.recoveryservicesdatareplication.fluent.ProtectedItemOperationStatusClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.OperationStatus; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ProtectedItemOperationStatus; + +public final class ProtectedItemOperationStatusImpl implements ProtectedItemOperationStatus { + private static final ClientLogger LOGGER = new ClientLogger(ProtectedItemOperationStatusImpl.class); + + private final ProtectedItemOperationStatusClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + public ProtectedItemOperationStatusImpl( + ProtectedItemOperationStatusClient innerClient, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String vaultName, String protectedItemName, String operationId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, vaultName, protectedItemName, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OperationStatusImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OperationStatus get( + String resourceGroupName, String vaultName, String protectedItemName, String operationId) { + OperationStatusInner inner = + this.serviceClient().get(resourceGroupName, vaultName, protectedItemName, operationId); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + private ProtectedItemOperationStatusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ProtectedItemsClientImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ProtectedItemsClientImpl.java new file mode 100644 index 000000000000..42fd0f941164 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ProtectedItemsClientImpl.java @@ -0,0 +1,1684 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.ProtectedItemsClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.PlannedFailoverModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.ProtectedItemModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ProtectedItemModelCollection; +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 ProtectedItemsClient. */ +public final class ProtectedItemsClientImpl implements ProtectedItemsClient { + /** The proxy service used to perform REST calls. */ + private final ProtectedItemsService service; + + /** The service client containing this operation class. */ + private final DataReplicationMgmtClientImpl client; + + /** + * Initializes an instance of ProtectedItemsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProtectedItemsClientImpl(DataReplicationMgmtClientImpl client) { + this.service = + RestProxy.create(ProtectedItemsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataReplicationMgmtClientProtectedItems to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataReplicationMgmtC") + public interface ProtectedItemsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("protectedItemName") String protectedItemName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("protectedItemName") String protectedItemName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ProtectedItemModelInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("protectedItemName") String protectedItemName, + @QueryParam("forceDelete") Boolean forceDelete, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/plannedFailover") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> plannedFailover( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("protectedItemName") String protectedItemName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PlannedFailoverModelInner body, + @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); + } + + /** + * Gets the protected item. + * + *

Gets the details of the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 the details of the protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String protectedItemName) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + protectedItemName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the protected item. + * + *

Gets the details of the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 the details of the protected item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String protectedItemName, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + protectedItemName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the protected item. + * + *

Gets the details of the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 the details of the protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String vaultName, String protectedItemName) { + return getWithResponseAsync(resourceGroupName, vaultName, protectedItemName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the protected item. + * + *

Gets the details of the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 the details of the protected item along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String vaultName, String protectedItemName, Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, protectedItemName, context).block(); + } + + /** + * Gets the protected item. + * + *

Gets the details of the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 the details of the protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectedItemModelInner get(String resourceGroupName, String vaultName, String protectedItemName) { + return getWithResponse(resourceGroupName, vaultName, protectedItemName, Context.NONE).getValue(); + } + + /** + * Puts the protected item. + * + *

Creates the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param body Protected item model. + * @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 protected item model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String vaultName, String protectedItemName, ProtectedItemModelInner body) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + protectedItemName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Puts the protected item. + * + *

Creates the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param body Protected item model. + * @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 protected item model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String vaultName, + String protectedItemName, + ProtectedItemModelInner body, + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + protectedItemName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Puts the protected item. + * + *

Creates the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param body Protected item model. + * @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 {@link PollerFlux} for polling of protected item model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProtectedItemModelInner> beginCreateAsync( + String resourceGroupName, String vaultName, String protectedItemName, ProtectedItemModelInner body) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, vaultName, protectedItemName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ProtectedItemModelInner.class, + ProtectedItemModelInner.class, + this.client.getContext()); + } + + /** + * Puts the protected item. + * + *

Creates the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 the {@link PollerFlux} for polling of protected item model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProtectedItemModelInner> beginCreateAsync( + String resourceGroupName, String vaultName, String protectedItemName) { + final ProtectedItemModelInner body = null; + Mono>> mono = + createWithResponseAsync(resourceGroupName, vaultName, protectedItemName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ProtectedItemModelInner.class, + ProtectedItemModelInner.class, + this.client.getContext()); + } + + /** + * Puts the protected item. + * + *

Creates the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param body Protected item model. + * @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 {@link PollerFlux} for polling of protected item model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProtectedItemModelInner> beginCreateAsync( + String resourceGroupName, + String vaultName, + String protectedItemName, + ProtectedItemModelInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, vaultName, protectedItemName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ProtectedItemModelInner.class, + ProtectedItemModelInner.class, + context); + } + + /** + * Puts the protected item. + * + *

Creates the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 the {@link SyncPoller} for polling of protected item model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProtectedItemModelInner> beginCreate( + String resourceGroupName, String vaultName, String protectedItemName) { + final ProtectedItemModelInner body = null; + return this.beginCreateAsync(resourceGroupName, vaultName, protectedItemName, body).getSyncPoller(); + } + + /** + * Puts the protected item. + * + *

Creates the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param body Protected item model. + * @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 {@link SyncPoller} for polling of protected item model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProtectedItemModelInner> beginCreate( + String resourceGroupName, + String vaultName, + String protectedItemName, + ProtectedItemModelInner body, + Context context) { + return this.beginCreateAsync(resourceGroupName, vaultName, protectedItemName, body, context).getSyncPoller(); + } + + /** + * Puts the protected item. + * + *

Creates the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param body Protected item model. + * @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 protected item model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String vaultName, String protectedItemName, ProtectedItemModelInner body) { + return beginCreateAsync(resourceGroupName, vaultName, protectedItemName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the protected item. + * + *

Creates the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 protected item model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String vaultName, String protectedItemName) { + final ProtectedItemModelInner body = null; + return beginCreateAsync(resourceGroupName, vaultName, protectedItemName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the protected item. + * + *

Creates the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param body Protected item model. + * @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 protected item model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String vaultName, + String protectedItemName, + ProtectedItemModelInner body, + Context context) { + return beginCreateAsync(resourceGroupName, vaultName, protectedItemName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the protected item. + * + *

Creates the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 protected item model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectedItemModelInner create(String resourceGroupName, String vaultName, String protectedItemName) { + final ProtectedItemModelInner body = null; + return createAsync(resourceGroupName, vaultName, protectedItemName, body).block(); + } + + /** + * Puts the protected item. + * + *

Creates the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param body Protected item model. + * @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 protected item model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectedItemModelInner create( + String resourceGroupName, + String vaultName, + String protectedItemName, + ProtectedItemModelInner body, + Context context) { + return createAsync(resourceGroupName, vaultName, protectedItemName, body, context).block(); + } + + /** + * Deletes the protected item. + * + *

Removes the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param forceDelete A flag indicating whether to do force delete or not. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String vaultName, String protectedItemName, Boolean forceDelete) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + protectedItemName, + forceDelete, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the protected item. + * + *

Removes the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param forceDelete A flag indicating whether to do force delete or not. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String vaultName, String protectedItemName, Boolean forceDelete, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + protectedItemName, + forceDelete, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the protected item. + * + *

Removes the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param forceDelete A flag indicating whether to do force delete or not. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String vaultName, String protectedItemName, Boolean forceDelete) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vaultName, protectedItemName, forceDelete); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the protected item. + * + *

Removes the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String vaultName, String protectedItemName) { + final Boolean forceDelete = null; + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vaultName, protectedItemName, forceDelete); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the protected item. + * + *

Removes the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param forceDelete A flag indicating whether to do force delete or not. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String vaultName, String protectedItemName, Boolean forceDelete, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vaultName, protectedItemName, forceDelete, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the protected item. + * + *

Removes the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vaultName, String protectedItemName) { + final Boolean forceDelete = null; + return this.beginDeleteAsync(resourceGroupName, vaultName, protectedItemName, forceDelete).getSyncPoller(); + } + + /** + * Deletes the protected item. + * + *

Removes the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param forceDelete A flag indicating whether to do force delete or not. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vaultName, String protectedItemName, Boolean forceDelete, Context context) { + return this + .beginDeleteAsync(resourceGroupName, vaultName, protectedItemName, forceDelete, context) + .getSyncPoller(); + } + + /** + * Deletes the protected item. + * + *

Removes the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param forceDelete A flag indicating whether to do force delete or not. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String vaultName, String protectedItemName, Boolean forceDelete) { + return beginDeleteAsync(resourceGroupName, vaultName, protectedItemName, forceDelete) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the protected item. + * + *

Removes the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String vaultName, String protectedItemName) { + final Boolean forceDelete = null; + return beginDeleteAsync(resourceGroupName, vaultName, protectedItemName, forceDelete) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the protected item. + * + *

Removes the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param forceDelete A flag indicating whether to do force delete or not. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String vaultName, String protectedItemName, Boolean forceDelete, Context context) { + return beginDeleteAsync(resourceGroupName, vaultName, protectedItemName, forceDelete, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the protected item. + * + *

Removes the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String vaultName, String protectedItemName) { + final Boolean forceDelete = null; + deleteAsync(resourceGroupName, vaultName, protectedItemName, forceDelete).block(); + } + + /** + * Deletes the protected item. + * + *

Removes the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param forceDelete A flag indicating whether to do force delete or not. + * @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 vaultName, String protectedItemName, Boolean forceDelete, Context context) { + deleteAsync(resourceGroupName, vaultName, protectedItemName, forceDelete, context).block(); + } + + /** + * Lists the protected items. + * + *

Gets the list of protected items in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of protected items in the given vault along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String vaultName) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + 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())); + } + + /** + * Lists the protected items. + * + *

Gets the list of protected items in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of protected items in the given vault along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String vaultName, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName 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(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the protected items. + * + *

Gets the list of protected items in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of protected items in the given vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vaultName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the protected items. + * + *

Gets the list of protected items in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of protected items in the given vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vaultName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the protected items. + * + *

Gets the list of protected items in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of protected items in the given vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName) { + return new PagedIterable<>(listAsync(resourceGroupName, vaultName)); + } + + /** + * Lists the protected items. + * + *

Gets the list of protected items in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of protected items in the given vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, vaultName, context)); + } + + /** + * Performs planned failover. + * + *

Performs the planned failover on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param body Planned failover model. + * @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 planned failover model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> plannedFailoverWithResponseAsync( + String resourceGroupName, String vaultName, String protectedItemName, PlannedFailoverModelInner body) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .plannedFailover( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + protectedItemName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Performs planned failover. + * + *

Performs the planned failover on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param body Planned failover model. + * @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 planned failover model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> plannedFailoverWithResponseAsync( + String resourceGroupName, + String vaultName, + String protectedItemName, + PlannedFailoverModelInner body, + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .plannedFailover( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + protectedItemName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Performs planned failover. + * + *

Performs the planned failover on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param body Planned failover model. + * @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 {@link PollerFlux} for polling of planned failover model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PlannedFailoverModelInner> beginPlannedFailoverAsync( + String resourceGroupName, String vaultName, String protectedItemName, PlannedFailoverModelInner body) { + Mono>> mono = + plannedFailoverWithResponseAsync(resourceGroupName, vaultName, protectedItemName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PlannedFailoverModelInner.class, + PlannedFailoverModelInner.class, + this.client.getContext()); + } + + /** + * Performs planned failover. + * + *

Performs the planned failover on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 the {@link PollerFlux} for polling of planned failover model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PlannedFailoverModelInner> beginPlannedFailoverAsync( + String resourceGroupName, String vaultName, String protectedItemName) { + final PlannedFailoverModelInner body = null; + Mono>> mono = + plannedFailoverWithResponseAsync(resourceGroupName, vaultName, protectedItemName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PlannedFailoverModelInner.class, + PlannedFailoverModelInner.class, + this.client.getContext()); + } + + /** + * Performs planned failover. + * + *

Performs the planned failover on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param body Planned failover model. + * @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 {@link PollerFlux} for polling of planned failover model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PlannedFailoverModelInner> beginPlannedFailoverAsync( + String resourceGroupName, + String vaultName, + String protectedItemName, + PlannedFailoverModelInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + plannedFailoverWithResponseAsync(resourceGroupName, vaultName, protectedItemName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PlannedFailoverModelInner.class, + PlannedFailoverModelInner.class, + context); + } + + /** + * Performs planned failover. + * + *

Performs the planned failover on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 the {@link SyncPoller} for polling of planned failover model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PlannedFailoverModelInner> beginPlannedFailover( + String resourceGroupName, String vaultName, String protectedItemName) { + final PlannedFailoverModelInner body = null; + return this.beginPlannedFailoverAsync(resourceGroupName, vaultName, protectedItemName, body).getSyncPoller(); + } + + /** + * Performs planned failover. + * + *

Performs the planned failover on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param body Planned failover model. + * @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 {@link SyncPoller} for polling of planned failover model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PlannedFailoverModelInner> beginPlannedFailover( + String resourceGroupName, + String vaultName, + String protectedItemName, + PlannedFailoverModelInner body, + Context context) { + return this + .beginPlannedFailoverAsync(resourceGroupName, vaultName, protectedItemName, body, context) + .getSyncPoller(); + } + + /** + * Performs planned failover. + * + *

Performs the planned failover on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param body Planned failover model. + * @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 planned failover model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono plannedFailoverAsync( + String resourceGroupName, String vaultName, String protectedItemName, PlannedFailoverModelInner body) { + return beginPlannedFailoverAsync(resourceGroupName, vaultName, protectedItemName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Performs planned failover. + * + *

Performs the planned failover on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 planned failover model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono plannedFailoverAsync( + String resourceGroupName, String vaultName, String protectedItemName) { + final PlannedFailoverModelInner body = null; + return beginPlannedFailoverAsync(resourceGroupName, vaultName, protectedItemName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Performs planned failover. + * + *

Performs the planned failover on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param body Planned failover model. + * @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 planned failover model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono plannedFailoverAsync( + String resourceGroupName, + String vaultName, + String protectedItemName, + PlannedFailoverModelInner body, + Context context) { + return beginPlannedFailoverAsync(resourceGroupName, vaultName, protectedItemName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Performs planned failover. + * + *

Performs the planned failover on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 planned failover model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PlannedFailoverModelInner plannedFailover( + String resourceGroupName, String vaultName, String protectedItemName) { + final PlannedFailoverModelInner body = null; + return plannedFailoverAsync(resourceGroupName, vaultName, protectedItemName, body).block(); + } + + /** + * Performs planned failover. + * + *

Performs the planned failover on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param body Planned failover model. + * @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 planned failover model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PlannedFailoverModelInner plannedFailover( + String resourceGroupName, + String vaultName, + String protectedItemName, + PlannedFailoverModelInner body, + Context context) { + return plannedFailoverAsync(resourceGroupName, vaultName, protectedItemName, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 protected item model collection along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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 URL to get the next list of items + *

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 protected item model collection along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ProtectedItemsImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ProtectedItemsImpl.java new file mode 100644 index 000000000000..4809c9103956 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ProtectedItemsImpl.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.recoveryservicesdatareplication.fluent.ProtectedItemsClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.PlannedFailoverModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.ProtectedItemModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.PlannedFailoverModel; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ProtectedItemModel; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ProtectedItems; + +public final class ProtectedItemsImpl implements ProtectedItems { + private static final ClientLogger LOGGER = new ClientLogger(ProtectedItemsImpl.class); + + private final ProtectedItemsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + public ProtectedItemsImpl( + ProtectedItemsClient innerClient, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String vaultName, String protectedItemName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, vaultName, protectedItemName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProtectedItemModelImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ProtectedItemModel get(String resourceGroupName, String vaultName, String protectedItemName) { + ProtectedItemModelInner inner = this.serviceClient().get(resourceGroupName, vaultName, protectedItemName); + if (inner != null) { + return new ProtectedItemModelImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String vaultName, String protectedItemName) { + this.serviceClient().delete(resourceGroupName, vaultName, protectedItemName); + } + + public void delete( + String resourceGroupName, String vaultName, String protectedItemName, Boolean forceDelete, Context context) { + this.serviceClient().delete(resourceGroupName, vaultName, protectedItemName, forceDelete, context); + } + + public PagedIterable list(String resourceGroupName, String vaultName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, vaultName); + return Utils.mapPage(inner, inner1 -> new ProtectedItemModelImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String vaultName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, vaultName, context); + return Utils.mapPage(inner, inner1 -> new ProtectedItemModelImpl(inner1, this.manager())); + } + + public PlannedFailoverModel plannedFailover(String resourceGroupName, String vaultName, String protectedItemName) { + PlannedFailoverModelInner inner = + this.serviceClient().plannedFailover(resourceGroupName, vaultName, protectedItemName); + if (inner != null) { + return new PlannedFailoverModelImpl(inner, this.manager()); + } else { + return null; + } + } + + public PlannedFailoverModel plannedFailover( + String resourceGroupName, + String vaultName, + String protectedItemName, + PlannedFailoverModelInner body, + Context context) { + PlannedFailoverModelInner inner = + this.serviceClient().plannedFailover(resourceGroupName, vaultName, protectedItemName, body, context); + if (inner != null) { + return new PlannedFailoverModelImpl(inner, this.manager()); + } else { + return null; + } + } + + public ProtectedItemModel 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 vaultName = Utils.getValueFromIdByName(id, "replicationVaults"); + if (vaultName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationVaults'.", id))); + } + String protectedItemName = Utils.getValueFromIdByName(id, "protectedItems"); + if (protectedItemName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'protectedItems'.", id))); + } + return this.getWithResponse(resourceGroupName, vaultName, protectedItemName, 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 vaultName = Utils.getValueFromIdByName(id, "replicationVaults"); + if (vaultName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationVaults'.", id))); + } + String protectedItemName = Utils.getValueFromIdByName(id, "protectedItems"); + if (protectedItemName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'protectedItems'.", id))); + } + return this.getWithResponse(resourceGroupName, vaultName, protectedItemName, 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 vaultName = Utils.getValueFromIdByName(id, "replicationVaults"); + if (vaultName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationVaults'.", id))); + } + String protectedItemName = Utils.getValueFromIdByName(id, "protectedItems"); + if (protectedItemName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'protectedItems'.", id))); + } + Boolean localForceDelete = null; + this.delete(resourceGroupName, vaultName, protectedItemName, localForceDelete, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Boolean forceDelete, 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 vaultName = Utils.getValueFromIdByName(id, "replicationVaults"); + if (vaultName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationVaults'.", id))); + } + String protectedItemName = Utils.getValueFromIdByName(id, "protectedItems"); + if (protectedItemName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'protectedItems'.", id))); + } + this.delete(resourceGroupName, vaultName, protectedItemName, forceDelete, context); + } + + private ProtectedItemsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } + + public ProtectedItemModelImpl define(String name) { + return new ProtectedItemModelImpl(name, this.manager()); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/RecoveryPointModelImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/RecoveryPointModelImpl.java new file mode 100644 index 000000000000..36e0017bb87f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/RecoveryPointModelImpl.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.recoveryservicesdatareplication.implementation; + +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.RecoveryPointModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.RecoveryPointModel; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.RecoveryPointModelProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.RecoveryPointModelSystemData; + +public final class RecoveryPointModelImpl implements RecoveryPointModel { + private RecoveryPointModelInner innerObject; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + RecoveryPointModelImpl( + RecoveryPointModelInner innerObject, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public RecoveryPointModelProperties properties() { + return this.innerModel().properties(); + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public RecoveryPointModelSystemData systemData() { + return this.innerModel().systemData(); + } + + public RecoveryPointModelInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/RecoveryPointsClientImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/RecoveryPointsClientImpl.java new file mode 100644 index 000000000000..ecf9153cfd1a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/RecoveryPointsClientImpl.java @@ -0,0 +1,583 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.resourcemanager.recoveryservicesdatareplication.fluent.RecoveryPointsClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.RecoveryPointModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.RecoveryPointModelCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RecoveryPointsClient. */ +public final class RecoveryPointsClientImpl implements RecoveryPointsClient { + /** The proxy service used to perform REST calls. */ + private final RecoveryPointsService service; + + /** The service client containing this operation class. */ + private final DataReplicationMgmtClientImpl client; + + /** + * Initializes an instance of RecoveryPointsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RecoveryPointsClientImpl(DataReplicationMgmtClientImpl client) { + this.service = + RestProxy.create(RecoveryPointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataReplicationMgmtClientRecoveryPoints to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataReplicationMgmtC") + public interface RecoveryPointsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("protectedItemName") String protectedItemName, + @PathParam("recoveryPointName") String recoveryPointName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("protectedItemName") String protectedItemName, + @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); + } + + /** + * Gets the recovery point. + * + *

Gets the details of the recovery point of a protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param recoveryPointName The recovery point 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 the details of the recovery point of a protected item along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String protectedItemName, String recoveryPointName) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (recoveryPointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPointName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + protectedItemName, + recoveryPointName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the recovery point. + * + *

Gets the details of the recovery point of a protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param recoveryPointName The recovery point 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 the details of the recovery point of a protected item along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String vaultName, + String protectedItemName, + String recoveryPointName, + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (recoveryPointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPointName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + protectedItemName, + recoveryPointName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the recovery point. + * + *

Gets the details of the recovery point of a protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param recoveryPointName The recovery point 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 the details of the recovery point of a protected item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String vaultName, String protectedItemName, String recoveryPointName) { + return getWithResponseAsync(resourceGroupName, vaultName, protectedItemName, recoveryPointName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the recovery point. + * + *

Gets the details of the recovery point of a protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param recoveryPointName The recovery point 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 the details of the recovery point of a protected item along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String vaultName, + String protectedItemName, + String recoveryPointName, + Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, protectedItemName, recoveryPointName, context) + .block(); + } + + /** + * Gets the recovery point. + * + *

Gets the details of the recovery point of a protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param recoveryPointName The recovery point 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 the details of the recovery point of a protected item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPointModelInner get( + String resourceGroupName, String vaultName, String protectedItemName, String recoveryPointName) { + return getWithResponse(resourceGroupName, vaultName, protectedItemName, recoveryPointName, Context.NONE) + .getValue(); + } + + /** + * Lists the recovery points. + * + *

Gets the list of recovery points of the given protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 the list of recovery points of the given protected item along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String vaultName, String protectedItemName) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + protectedItemName, + 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())); + } + + /** + * Lists the recovery points. + * + *

Gets the list of recovery points of the given protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 the list of recovery points of the given protected item along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String vaultName, String protectedItemName, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName 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(), + resourceGroupName, + vaultName, + protectedItemName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the recovery points. + * + *

Gets the list of recovery points of the given protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 the list of recovery points of the given protected item as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String vaultName, String protectedItemName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName, protectedItemName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the recovery points. + * + *

Gets the list of recovery points of the given protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 the list of recovery points of the given protected item as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String vaultName, String protectedItemName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName, protectedItemName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the recovery points. + * + *

Gets the list of recovery points of the given protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 the list of recovery points of the given protected item as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String vaultName, String protectedItemName) { + return new PagedIterable<>(listAsync(resourceGroupName, vaultName, protectedItemName)); + } + + /** + * Lists the recovery points. + * + *

Gets the list of recovery points of the given protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 the list of recovery points of the given protected item as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String vaultName, String protectedItemName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, vaultName, protectedItemName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 recovery point model collection along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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 URL to get the next list of items + *

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 recovery point model collection along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/RecoveryPointsImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/RecoveryPointsImpl.java new file mode 100644 index 000000000000..c911095f2870 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/RecoveryPointsImpl.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.recoveryservicesdatareplication.fluent.RecoveryPointsClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.RecoveryPointModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.RecoveryPointModel; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.RecoveryPoints; + +public final class RecoveryPointsImpl implements RecoveryPoints { + private static final ClientLogger LOGGER = new ClientLogger(RecoveryPointsImpl.class); + + private final RecoveryPointsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + public RecoveryPointsImpl( + RecoveryPointsClient innerClient, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, + String vaultName, + String protectedItemName, + String recoveryPointName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, vaultName, protectedItemName, recoveryPointName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RecoveryPointModelImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RecoveryPointModel get( + String resourceGroupName, String vaultName, String protectedItemName, String recoveryPointName) { + RecoveryPointModelInner inner = + this.serviceClient().get(resourceGroupName, vaultName, protectedItemName, recoveryPointName); + if (inner != null) { + return new RecoveryPointModelImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list( + String resourceGroupName, String vaultName, String protectedItemName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, vaultName, protectedItemName); + return Utils.mapPage(inner, inner1 -> new RecoveryPointModelImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String vaultName, String protectedItemName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, vaultName, protectedItemName, context); + return Utils.mapPage(inner, inner1 -> new RecoveryPointModelImpl(inner1, this.manager())); + } + + private RecoveryPointsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ReplicationExtensionModelImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ReplicationExtensionModelImpl.java new file mode 100644 index 000000000000..d4081c9af5b2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ReplicationExtensionModelImpl.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.ReplicationExtensionModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ReplicationExtensionModel; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ReplicationExtensionModelProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ReplicationExtensionModelSystemData; + +public final class ReplicationExtensionModelImpl + implements ReplicationExtensionModel, ReplicationExtensionModel.Definition { + private ReplicationExtensionModelInner innerObject; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + ReplicationExtensionModelImpl( + ReplicationExtensionModelInner innerObject, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ReplicationExtensionModelProperties properties() { + return this.innerModel().properties(); + } + + public ReplicationExtensionModelSystemData systemData() { + return this.innerModel().systemData(); + } + + public ReplicationExtensionModelInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String vaultName; + + private String replicationExtensionName; + + public ReplicationExtensionModelImpl withExistingReplicationVault(String resourceGroupName, String vaultName) { + this.resourceGroupName = resourceGroupName; + this.vaultName = vaultName; + return this; + } + + public ReplicationExtensionModel create() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationExtensions() + .create(resourceGroupName, vaultName, replicationExtensionName, this.innerModel(), Context.NONE); + return this; + } + + public ReplicationExtensionModel create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationExtensions() + .create(resourceGroupName, vaultName, replicationExtensionName, this.innerModel(), context); + return this; + } + + ReplicationExtensionModelImpl( + String name, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerObject = new ReplicationExtensionModelInner(); + this.serviceManager = serviceManager; + this.replicationExtensionName = name; + } + + public ReplicationExtensionModel refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationExtensions() + .getWithResponse(resourceGroupName, vaultName, replicationExtensionName, Context.NONE) + .getValue(); + return this; + } + + public ReplicationExtensionModel refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplicationExtensions() + .getWithResponse(resourceGroupName, vaultName, replicationExtensionName, context) + .getValue(); + return this; + } + + public ReplicationExtensionModelImpl withProperties(ReplicationExtensionModelProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ReplicationExtensionsClientImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ReplicationExtensionsClientImpl.java new file mode 100644 index 000000000000..95309fb08410 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ReplicationExtensionsClientImpl.java @@ -0,0 +1,1248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.ReplicationExtensionsClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.ReplicationExtensionModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ReplicationExtensionModelCollection; +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 ReplicationExtensionsClient. */ +public final class ReplicationExtensionsClientImpl implements ReplicationExtensionsClient { + /** The proxy service used to perform REST calls. */ + private final ReplicationExtensionsService service; + + /** The service client containing this operation class. */ + private final DataReplicationMgmtClientImpl client; + + /** + * Initializes an instance of ReplicationExtensionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReplicationExtensionsClientImpl(DataReplicationMgmtClientImpl client) { + this.service = + RestProxy + .create(ReplicationExtensionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataReplicationMgmtClientReplicationExtensions to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataReplicationMgmtC") + public interface ReplicationExtensionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("replicationExtensionName") String replicationExtensionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("replicationExtensionName") String replicationExtensionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ReplicationExtensionModelInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("replicationExtensionName") String replicationExtensionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @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); + } + + /** + * Gets the replication extension. + * + *

Gets the details of the replication extension. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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 the details of the replication extension along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String replicationExtensionName) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (replicationExtensionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter replicationExtensionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + replicationExtensionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the replication extension. + * + *

Gets the details of the replication extension. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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 the details of the replication extension along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String replicationExtensionName, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (replicationExtensionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter replicationExtensionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + replicationExtensionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the replication extension. + * + *

Gets the details of the replication extension. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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 the details of the replication extension on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String vaultName, String replicationExtensionName) { + return getWithResponseAsync(resourceGroupName, vaultName, replicationExtensionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the replication extension. + * + *

Gets the details of the replication extension. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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 the details of the replication extension along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String vaultName, String replicationExtensionName, Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, replicationExtensionName, context).block(); + } + + /** + * Gets the replication extension. + * + *

Gets the details of the replication extension. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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 the details of the replication extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationExtensionModelInner get( + String resourceGroupName, String vaultName, String replicationExtensionName) { + return getWithResponse(resourceGroupName, vaultName, replicationExtensionName, Context.NONE).getValue(); + } + + /** + * Puts the replication extension. + * + *

Creates the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension name. + * @param body Replication extension model. + * @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 replication extension model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String vaultName, + String replicationExtensionName, + ReplicationExtensionModelInner body) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (replicationExtensionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter replicationExtensionName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + replicationExtensionName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Puts the replication extension. + * + *

Creates the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension name. + * @param body Replication extension model. + * @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 replication extension model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String vaultName, + String replicationExtensionName, + ReplicationExtensionModelInner body, + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (replicationExtensionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter replicationExtensionName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + replicationExtensionName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Puts the replication extension. + * + *

Creates the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension name. + * @param body Replication extension model. + * @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 {@link PollerFlux} for polling of replication extension model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationExtensionModelInner> beginCreateAsync( + String resourceGroupName, + String vaultName, + String replicationExtensionName, + ReplicationExtensionModelInner body) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, vaultName, replicationExtensionName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationExtensionModelInner.class, + ReplicationExtensionModelInner.class, + this.client.getContext()); + } + + /** + * Puts the replication extension. + * + *

Creates the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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 the {@link PollerFlux} for polling of replication extension model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationExtensionModelInner> beginCreateAsync( + String resourceGroupName, String vaultName, String replicationExtensionName) { + final ReplicationExtensionModelInner body = null; + Mono>> mono = + createWithResponseAsync(resourceGroupName, vaultName, replicationExtensionName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationExtensionModelInner.class, + ReplicationExtensionModelInner.class, + this.client.getContext()); + } + + /** + * Puts the replication extension. + * + *

Creates the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension name. + * @param body Replication extension model. + * @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 {@link PollerFlux} for polling of replication extension model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationExtensionModelInner> beginCreateAsync( + String resourceGroupName, + String vaultName, + String replicationExtensionName, + ReplicationExtensionModelInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, vaultName, replicationExtensionName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationExtensionModelInner.class, + ReplicationExtensionModelInner.class, + context); + } + + /** + * Puts the replication extension. + * + *

Creates the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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 the {@link SyncPoller} for polling of replication extension model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationExtensionModelInner> beginCreate( + String resourceGroupName, String vaultName, String replicationExtensionName) { + final ReplicationExtensionModelInner body = null; + return this.beginCreateAsync(resourceGroupName, vaultName, replicationExtensionName, body).getSyncPoller(); + } + + /** + * Puts the replication extension. + * + *

Creates the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension name. + * @param body Replication extension model. + * @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 {@link SyncPoller} for polling of replication extension model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationExtensionModelInner> beginCreate( + String resourceGroupName, + String vaultName, + String replicationExtensionName, + ReplicationExtensionModelInner body, + Context context) { + return this + .beginCreateAsync(resourceGroupName, vaultName, replicationExtensionName, body, context) + .getSyncPoller(); + } + + /** + * Puts the replication extension. + * + *

Creates the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension name. + * @param body Replication extension model. + * @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 replication extension model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String vaultName, + String replicationExtensionName, + ReplicationExtensionModelInner body) { + return beginCreateAsync(resourceGroupName, vaultName, replicationExtensionName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the replication extension. + * + *

Creates the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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 replication extension model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String vaultName, String replicationExtensionName) { + final ReplicationExtensionModelInner body = null; + return beginCreateAsync(resourceGroupName, vaultName, replicationExtensionName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the replication extension. + * + *

Creates the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension name. + * @param body Replication extension model. + * @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 replication extension model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String vaultName, + String replicationExtensionName, + ReplicationExtensionModelInner body, + Context context) { + return beginCreateAsync(resourceGroupName, vaultName, replicationExtensionName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the replication extension. + * + *

Creates the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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 replication extension model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationExtensionModelInner create( + String resourceGroupName, String vaultName, String replicationExtensionName) { + final ReplicationExtensionModelInner body = null; + return createAsync(resourceGroupName, vaultName, replicationExtensionName, body).block(); + } + + /** + * Puts the replication extension. + * + *

Creates the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension name. + * @param body Replication extension model. + * @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 replication extension model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationExtensionModelInner create( + String resourceGroupName, + String vaultName, + String replicationExtensionName, + ReplicationExtensionModelInner body, + Context context) { + return createAsync(resourceGroupName, vaultName, replicationExtensionName, body, context).block(); + } + + /** + * Deletes the replication extension. + * + *

Deletes the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String vaultName, String replicationExtensionName) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (replicationExtensionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter replicationExtensionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + replicationExtensionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the replication extension. + * + *

Deletes the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String vaultName, String replicationExtensionName, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (replicationExtensionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter replicationExtensionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + replicationExtensionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the replication extension. + * + *

Deletes the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String vaultName, String replicationExtensionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vaultName, replicationExtensionName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the replication extension. + * + *

Deletes the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String vaultName, String replicationExtensionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vaultName, replicationExtensionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the replication extension. + * + *

Deletes the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vaultName, String replicationExtensionName) { + return this.beginDeleteAsync(resourceGroupName, vaultName, replicationExtensionName).getSyncPoller(); + } + + /** + * Deletes the replication extension. + * + *

Deletes the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vaultName, String replicationExtensionName, Context context) { + return this.beginDeleteAsync(resourceGroupName, vaultName, replicationExtensionName, context).getSyncPoller(); + } + + /** + * Deletes the replication extension. + * + *

Deletes the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String vaultName, String replicationExtensionName) { + return beginDeleteAsync(resourceGroupName, vaultName, replicationExtensionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the replication extension. + * + *

Deletes the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String vaultName, String replicationExtensionName, Context context) { + return beginDeleteAsync(resourceGroupName, vaultName, replicationExtensionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the replication extension. + * + *

Deletes the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String vaultName, String replicationExtensionName) { + deleteAsync(resourceGroupName, vaultName, replicationExtensionName).block(); + } + + /** + * Deletes the replication extension. + * + *

Deletes the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String vaultName, String replicationExtensionName, Context context) { + deleteAsync(resourceGroupName, vaultName, replicationExtensionName, context).block(); + } + + /** + * Lists the replication extensions. + * + *

Gets the list of replication extensions in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of replication extensions in the given vault along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String vaultName) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + 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())); + } + + /** + * Lists the replication extensions. + * + *

Gets the list of replication extensions in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of replication extensions in the given vault along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String vaultName, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName 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(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the replication extensions. + * + *

Gets the list of replication extensions in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of replication extensions in the given vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vaultName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the replication extensions. + * + *

Gets the list of replication extensions in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of replication extensions in the given vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String vaultName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the replication extensions. + * + *

Gets the list of replication extensions in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of replication extensions in the given vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName) { + return new PagedIterable<>(listAsync(resourceGroupName, vaultName)); + } + + /** + * Lists the replication extensions. + * + *

Gets the list of replication extensions in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of replication extensions in the given vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String vaultName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, vaultName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 replication extension model collection along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 URL to get the next list of items + *

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 replication extension model collection along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ReplicationExtensionsImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ReplicationExtensionsImpl.java new file mode 100644 index 000000000000..c7a3d3b25f10 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ReplicationExtensionsImpl.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.recoveryservicesdatareplication.fluent.ReplicationExtensionsClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.ReplicationExtensionModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ReplicationExtensionModel; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ReplicationExtensions; + +public final class ReplicationExtensionsImpl implements ReplicationExtensions { + private static final ClientLogger LOGGER = new ClientLogger(ReplicationExtensionsImpl.class); + + private final ReplicationExtensionsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + public ReplicationExtensionsImpl( + ReplicationExtensionsClient innerClient, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String vaultName, String replicationExtensionName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, vaultName, replicationExtensionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ReplicationExtensionModelImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ReplicationExtensionModel get(String resourceGroupName, String vaultName, String replicationExtensionName) { + ReplicationExtensionModelInner inner = + this.serviceClient().get(resourceGroupName, vaultName, replicationExtensionName); + if (inner != null) { + return new ReplicationExtensionModelImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String vaultName, String replicationExtensionName) { + this.serviceClient().delete(resourceGroupName, vaultName, replicationExtensionName); + } + + public void delete(String resourceGroupName, String vaultName, String replicationExtensionName, Context context) { + this.serviceClient().delete(resourceGroupName, vaultName, replicationExtensionName, context); + } + + public PagedIterable list(String resourceGroupName, String vaultName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, vaultName); + return Utils.mapPage(inner, inner1 -> new ReplicationExtensionModelImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String vaultName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, vaultName, context); + return Utils.mapPage(inner, inner1 -> new ReplicationExtensionModelImpl(inner1, this.manager())); + } + + public ReplicationExtensionModel 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 vaultName = Utils.getValueFromIdByName(id, "replicationVaults"); + if (vaultName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationVaults'.", id))); + } + String replicationExtensionName = Utils.getValueFromIdByName(id, "replicationExtensions"); + if (replicationExtensionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationExtensions'.", + id))); + } + return this.getWithResponse(resourceGroupName, vaultName, replicationExtensionName, 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 vaultName = Utils.getValueFromIdByName(id, "replicationVaults"); + if (vaultName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationVaults'.", id))); + } + String replicationExtensionName = Utils.getValueFromIdByName(id, "replicationExtensions"); + if (replicationExtensionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationExtensions'.", + id))); + } + return this.getWithResponse(resourceGroupName, vaultName, replicationExtensionName, 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 vaultName = Utils.getValueFromIdByName(id, "replicationVaults"); + if (vaultName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationVaults'.", id))); + } + String replicationExtensionName = Utils.getValueFromIdByName(id, "replicationExtensions"); + if (replicationExtensionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationExtensions'.", + id))); + } + this.delete(resourceGroupName, vaultName, replicationExtensionName, 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 vaultName = Utils.getValueFromIdByName(id, "replicationVaults"); + if (vaultName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationVaults'.", id))); + } + String replicationExtensionName = Utils.getValueFromIdByName(id, "replicationExtensions"); + if (replicationExtensionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationExtensions'.", + id))); + } + this.delete(resourceGroupName, vaultName, replicationExtensionName, context); + } + + private ReplicationExtensionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } + + public ReplicationExtensionModelImpl define(String name) { + return new ReplicationExtensionModelImpl(name, this.manager()); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ResourceProvidersClientImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ResourceProvidersClientImpl.java new file mode 100644 index 000000000000..58f3e55a787f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ResourceProvidersClientImpl.java @@ -0,0 +1,393 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +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.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.resourcemanager.recoveryservicesdatareplication.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.CheckNameAvailabilityResponseModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.DeploymentPreflightModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.CheckNameAvailabilityModel; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +public final class ResourceProvidersClientImpl implements ResourceProvidersClient { + /** The proxy service used to perform REST calls. */ + private final ResourceProvidersService service; + + /** The service client containing this operation class. */ + private final DataReplicationMgmtClientImpl client; + + /** + * Initializes an instance of ResourceProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourceProvidersClientImpl(DataReplicationMgmtClientImpl client) { + this.service = + RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataReplicationMgmtClientResourceProviders to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataReplicationMgmtC") + public interface ResourceProvidersService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/locations/{location}/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CheckNameAvailabilityModel body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/deployments/{deploymentId}/preflight") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deploymentPreflight( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentId") String deploymentId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DeploymentPreflightModelInner body, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Performs the resource name availability check. + * + *

Checks the resource name availability. + * + * @param location The name of the Azure region. + * @param body Resource details. + * @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 check name availability response model along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String location, CheckNameAvailabilityModel body) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Performs the resource name availability check. + * + *

Checks the resource name availability. + * + * @param location The name of the Azure region. + * @param body Resource details. + * @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 check name availability response model along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String location, CheckNameAvailabilityModel body, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Performs the resource name availability check. + * + *

Checks the resource name availability. + * + * @param location The name of the Azure region. + * @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 check name availability response model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync(String location) { + final CheckNameAvailabilityModel body = null; + return checkNameAvailabilityWithResponseAsync(location, body).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Performs the resource name availability check. + * + *

Checks the resource name availability. + * + * @param location The name of the Azure region. + * @param body Resource details. + * @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 check name availability response model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + String location, CheckNameAvailabilityModel body, Context context) { + return checkNameAvailabilityWithResponseAsync(location, body, context).block(); + } + + /** + * Performs the resource name availability check. + * + *

Checks the resource name availability. + * + * @param location The name of the Azure region. + * @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 check name availability response model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameAvailabilityResponseModelInner checkNameAvailability(String location) { + final CheckNameAvailabilityModel body = null; + return checkNameAvailabilityWithResponse(location, body, Context.NONE).getValue(); + } + + /** + * Performs resource deployment validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentId Deployment Id. + * @param body Deployment preflight model. + * @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 deployment preflight model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deploymentPreflightWithResponseAsync( + String resourceGroupName, String deploymentId, DeploymentPreflightModelInner body) { + 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 (deploymentId == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentId is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deploymentPreflight( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + deploymentId, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Performs resource deployment validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentId Deployment Id. + * @param body Deployment preflight model. + * @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 deployment preflight model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deploymentPreflightWithResponseAsync( + String resourceGroupName, String deploymentId, DeploymentPreflightModelInner body, 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 (deploymentId == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentId is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deploymentPreflight( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + deploymentId, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Performs resource deployment validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentId Deployment Id. + * @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 deployment preflight model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deploymentPreflightAsync( + String resourceGroupName, String deploymentId) { + final DeploymentPreflightModelInner body = null; + return deploymentPreflightWithResponseAsync(resourceGroupName, deploymentId, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Performs resource deployment validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentId Deployment Id. + * @param body Deployment preflight model. + * @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 deployment preflight model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deploymentPreflightWithResponse( + String resourceGroupName, String deploymentId, DeploymentPreflightModelInner body, Context context) { + return deploymentPreflightWithResponseAsync(resourceGroupName, deploymentId, body, context).block(); + } + + /** + * Performs resource deployment validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentId Deployment Id. + * @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 deployment preflight model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentPreflightModelInner deploymentPreflight(String resourceGroupName, String deploymentId) { + final DeploymentPreflightModelInner body = null; + return deploymentPreflightWithResponse(resourceGroupName, deploymentId, body, Context.NONE).getValue(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ResourceProvidersImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ResourceProvidersImpl.java new file mode 100644 index 000000000000..0296ead1d507 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/ResourceProvidersImpl.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.implementation; + +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.recoveryservicesdatareplication.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.CheckNameAvailabilityResponseModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.DeploymentPreflightModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.CheckNameAvailabilityModel; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.CheckNameAvailabilityResponseModel; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.DeploymentPreflightModel; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ResourceProviders; + +public final class ResourceProvidersImpl implements ResourceProviders { + private static final ClientLogger LOGGER = new ClientLogger(ResourceProvidersImpl.class); + + private final ResourceProvidersClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + public ResourceProvidersImpl( + ResourceProvidersClient innerClient, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response checkNameAvailabilityWithResponse( + String location, CheckNameAvailabilityModel body, Context context) { + Response inner = + this.serviceClient().checkNameAvailabilityWithResponse(location, body, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckNameAvailabilityResponseModelImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CheckNameAvailabilityResponseModel checkNameAvailability(String location) { + CheckNameAvailabilityResponseModelInner inner = this.serviceClient().checkNameAvailability(location); + if (inner != null) { + return new CheckNameAvailabilityResponseModelImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deploymentPreflightWithResponse( + String resourceGroupName, String deploymentId, DeploymentPreflightModelInner body, Context context) { + Response inner = + this.serviceClient().deploymentPreflightWithResponse(resourceGroupName, deploymentId, body, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DeploymentPreflightModelImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DeploymentPreflightModel deploymentPreflight(String resourceGroupName, String deploymentId) { + DeploymentPreflightModelInner inner = this.serviceClient().deploymentPreflight(resourceGroupName, deploymentId); + if (inner != null) { + return new DeploymentPreflightModelImpl(inner, this.manager()); + } else { + return null; + } + } + + private ResourceProvidersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/Utils.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/Utils.java new file mode 100644 index 000000000000..1d4d5d562534 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/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.recoveryservicesdatareplication.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 { + private 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.isEmpty() && 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<>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl<>(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/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/VaultModelImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/VaultModelImpl.java new file mode 100644 index 000000000000..1922c1179333 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/VaultModelImpl.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.recoveryservicesdatareplication.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.VaultModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.VaultModel; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.VaultModelProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.VaultModelSystemData; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.VaultModelUpdate; +import java.util.Collections; +import java.util.Map; + +public final class VaultModelImpl implements VaultModel, VaultModel.Definition, VaultModel.Update { + private VaultModelInner innerObject; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + 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 VaultModelProperties properties() { + return this.innerModel().properties(); + } + + public VaultModelSystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public VaultModelInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String vaultName; + + private VaultModelUpdate updateBody; + + public VaultModelImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public VaultModel create() { + this.innerObject = + serviceManager + .serviceClient() + .getVaults() + .create(resourceGroupName, vaultName, this.innerModel(), Context.NONE); + return this; + } + + public VaultModel create(Context context) { + this.innerObject = + serviceManager.serviceClient().getVaults().create(resourceGroupName, vaultName, this.innerModel(), context); + return this; + } + + VaultModelImpl( + String name, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerObject = new VaultModelInner(); + this.serviceManager = serviceManager; + this.vaultName = name; + } + + public VaultModelImpl update() { + this.updateBody = new VaultModelUpdate(); + return this; + } + + public VaultModel apply() { + this.innerObject = + serviceManager.serviceClient().getVaults().update(resourceGroupName, vaultName, updateBody, Context.NONE); + return this; + } + + public VaultModel apply(Context context) { + this.innerObject = + serviceManager.serviceClient().getVaults().update(resourceGroupName, vaultName, updateBody, context); + return this; + } + + VaultModelImpl( + VaultModelInner innerObject, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.vaultName = Utils.getValueFromIdByName(innerObject.id(), "replicationVaults"); + } + + public VaultModel refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVaults() + .getByResourceGroupWithResponse(resourceGroupName, vaultName, Context.NONE) + .getValue(); + return this; + } + + public VaultModel refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVaults() + .getByResourceGroupWithResponse(resourceGroupName, vaultName, context) + .getValue(); + return this; + } + + public VaultModelImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VaultModelImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VaultModelImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public VaultModelImpl withProperties(VaultModelProperties properties) { + if (isInCreateMode()) { + this.innerModel().withProperties(properties); + return this; + } else { + this.updateBody.withProperties(properties); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/VaultOperationStatusClientImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/VaultOperationStatusClientImpl.java new file mode 100644 index 000000000000..de5da82ecf20 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/VaultOperationStatusClientImpl.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.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.resourcemanager.recoveryservicesdatareplication.fluent.VaultOperationStatusClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.OperationStatusInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VaultOperationStatusClient. */ +public final class VaultOperationStatusClientImpl implements VaultOperationStatusClient { + /** The proxy service used to perform REST calls. */ + private final VaultOperationStatusService service; + + /** The service client containing this operation class. */ + private final DataReplicationMgmtClientImpl client; + + /** + * Initializes an instance of VaultOperationStatusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VaultOperationStatusClientImpl(DataReplicationMgmtClientImpl client) { + this.service = + RestProxy + .create(VaultOperationStatusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataReplicationMgmtClientVaultOperationStatus to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataReplicationMgmtC") + public interface VaultOperationStatusService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/operations/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("operationId") String operationId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the vault operation status. + * + *

Tracks the results of an asynchronous operation on the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param operationId The ID of an ongoing async 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 defines the operation status along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String operationId) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + operationId, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the vault operation status. + * + *

Tracks the results of an asynchronous operation on the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param operationId The ID of an ongoing async operation. + * @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 defines the operation status along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String operationId, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + operationId, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the vault operation status. + * + *

Tracks the results of an asynchronous operation on the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param operationId The ID of an ongoing async 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 defines the operation status on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String vaultName, String operationId) { + return getWithResponseAsync(resourceGroupName, vaultName, operationId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the vault operation status. + * + *

Tracks the results of an asynchronous operation on the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param operationId The ID of an ongoing async operation. + * @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 defines the operation status along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String vaultName, String operationId, Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, operationId, context).block(); + } + + /** + * Gets the vault operation status. + * + *

Tracks the results of an asynchronous operation on the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param operationId The ID of an ongoing async 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 defines the operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner get(String resourceGroupName, String vaultName, String operationId) { + return getWithResponse(resourceGroupName, vaultName, operationId, Context.NONE).getValue(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/VaultOperationStatusImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/VaultOperationStatusImpl.java new file mode 100644 index 000000000000..552a801031ec --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/VaultOperationStatusImpl.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.implementation; + +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.recoveryservicesdatareplication.fluent.VaultOperationStatusClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.OperationStatus; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.VaultOperationStatus; + +public final class VaultOperationStatusImpl implements VaultOperationStatus { + private static final ClientLogger LOGGER = new ClientLogger(VaultOperationStatusImpl.class); + + private final VaultOperationStatusClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + public VaultOperationStatusImpl( + VaultOperationStatusClient innerClient, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String vaultName, String operationId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, vaultName, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OperationStatusImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OperationStatus get(String resourceGroupName, String vaultName, String operationId) { + OperationStatusInner inner = this.serviceClient().get(resourceGroupName, vaultName, operationId); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + private VaultOperationStatusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/VaultsClientImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/VaultsClientImpl.java new file mode 100644 index 000000000000..faa8bdbf1271 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/VaultsClientImpl.java @@ -0,0 +1,1762 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.VaultsClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.VaultModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.VaultModelCollection; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.VaultModelUpdate; +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 VaultsClient. */ +public final class VaultsClientImpl implements VaultsClient { + /** The proxy service used to perform REST calls. */ + private final VaultsService service; + + /** The service client containing this operation class. */ + private final DataReplicationMgmtClientImpl client; + + /** + * Initializes an instance of VaultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VaultsClientImpl(DataReplicationMgmtClientImpl client) { + this.service = RestProxy.create(VaultsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataReplicationMgmtClientVaults to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataReplicationMgmtC") + public interface VaultsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VaultModelInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VaultModelUpdate body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationVaults") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("continuationToken") String continuationToken, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("continuationToken") String continuationToken, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @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> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the vault. + * + *

Gets the details of the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the details of the vault along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String vaultName) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the vault. + * + *

Gets the details of the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the details of the vault along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String vaultName, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName 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, + vaultName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the vault. + * + *

Gets the details of the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the details of the vault on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String vaultName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vaultName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the vault. + * + *

Gets the details of the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the details of the vault along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String vaultName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vaultName, context).block(); + } + + /** + * Gets the vault. + * + *

Gets the details of the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the details of the vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VaultModelInner getByResourceGroup(String resourceGroupName, String vaultName) { + return getByResourceGroupWithResponse(resourceGroupName, vaultName, Context.NONE).getValue(); + } + + /** + * Puts the vault. + * + *

Creates the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param body Vault properties. + * @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 vault model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String vaultName, VaultModelInner body) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Puts the vault. + * + *

Creates the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param body Vault properties. + * @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 vault model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String vaultName, VaultModelInner body, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Puts the vault. + * + *

Creates the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param body Vault properties. + * @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 {@link PollerFlux} for polling of vault model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VaultModelInner> beginCreateAsync( + String resourceGroupName, String vaultName, VaultModelInner body) { + Mono>> mono = createWithResponseAsync(resourceGroupName, vaultName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VaultModelInner.class, + VaultModelInner.class, + this.client.getContext()); + } + + /** + * Puts the vault. + * + *

Creates the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the {@link PollerFlux} for polling of vault model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VaultModelInner> beginCreateAsync( + String resourceGroupName, String vaultName) { + final VaultModelInner body = null; + Mono>> mono = createWithResponseAsync(resourceGroupName, vaultName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VaultModelInner.class, + VaultModelInner.class, + this.client.getContext()); + } + + /** + * Puts the vault. + * + *

Creates the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param body Vault properties. + * @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 {@link PollerFlux} for polling of vault model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VaultModelInner> beginCreateAsync( + String resourceGroupName, String vaultName, VaultModelInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createWithResponseAsync(resourceGroupName, vaultName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VaultModelInner.class, VaultModelInner.class, context); + } + + /** + * Puts the vault. + * + *

Creates the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the {@link SyncPoller} for polling of vault model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VaultModelInner> beginCreate( + String resourceGroupName, String vaultName) { + final VaultModelInner body = null; + return this.beginCreateAsync(resourceGroupName, vaultName, body).getSyncPoller(); + } + + /** + * Puts the vault. + * + *

Creates the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param body Vault properties. + * @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 {@link SyncPoller} for polling of vault model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VaultModelInner> beginCreate( + String resourceGroupName, String vaultName, VaultModelInner body, Context context) { + return this.beginCreateAsync(resourceGroupName, vaultName, body, context).getSyncPoller(); + } + + /** + * Puts the vault. + * + *

Creates the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param body Vault properties. + * @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 vault model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String vaultName, VaultModelInner body) { + return beginCreateAsync(resourceGroupName, vaultName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the vault. + * + *

Creates the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 vault model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String vaultName) { + final VaultModelInner body = null; + return beginCreateAsync(resourceGroupName, vaultName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the vault. + * + *

Creates the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param body Vault properties. + * @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 vault model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String vaultName, VaultModelInner body, Context context) { + return beginCreateAsync(resourceGroupName, vaultName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the vault. + * + *

Creates the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 vault model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VaultModelInner create(String resourceGroupName, String vaultName) { + final VaultModelInner body = null; + return createAsync(resourceGroupName, vaultName, body).block(); + } + + /** + * Puts the vault. + * + *

Creates the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param body Vault properties. + * @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 vault model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VaultModelInner create(String resourceGroupName, String vaultName, VaultModelInner body, Context context) { + return createAsync(resourceGroupName, vaultName, body, context).block(); + } + + /** + * Updates the vault. + * + *

Performs update on the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param body Vault properties. + * @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 vault model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String vaultName, VaultModelUpdate body) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the vault. + * + *

Performs update on the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param body Vault properties. + * @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 vault model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String vaultName, VaultModelUpdate body, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Updates the vault. + * + *

Performs update on the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param body Vault properties. + * @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 {@link PollerFlux} for polling of vault model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VaultModelInner> beginUpdateAsync( + String resourceGroupName, String vaultName, VaultModelUpdate body) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, vaultName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VaultModelInner.class, + VaultModelInner.class, + this.client.getContext()); + } + + /** + * Updates the vault. + * + *

Performs update on the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the {@link PollerFlux} for polling of vault model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VaultModelInner> beginUpdateAsync( + String resourceGroupName, String vaultName) { + final VaultModelUpdate body = null; + Mono>> mono = updateWithResponseAsync(resourceGroupName, vaultName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VaultModelInner.class, + VaultModelInner.class, + this.client.getContext()); + } + + /** + * Updates the vault. + * + *

Performs update on the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param body Vault properties. + * @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 {@link PollerFlux} for polling of vault model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VaultModelInner> beginUpdateAsync( + String resourceGroupName, String vaultName, VaultModelUpdate body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, vaultName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VaultModelInner.class, VaultModelInner.class, context); + } + + /** + * Updates the vault. + * + *

Performs update on the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the {@link SyncPoller} for polling of vault model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VaultModelInner> beginUpdate( + String resourceGroupName, String vaultName) { + final VaultModelUpdate body = null; + return this.beginUpdateAsync(resourceGroupName, vaultName, body).getSyncPoller(); + } + + /** + * Updates the vault. + * + *

Performs update on the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param body Vault properties. + * @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 {@link SyncPoller} for polling of vault model. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VaultModelInner> beginUpdate( + String resourceGroupName, String vaultName, VaultModelUpdate body, Context context) { + return this.beginUpdateAsync(resourceGroupName, vaultName, body, context).getSyncPoller(); + } + + /** + * Updates the vault. + * + *

Performs update on the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param body Vault properties. + * @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 vault model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String vaultName, VaultModelUpdate body) { + return beginUpdateAsync(resourceGroupName, vaultName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the vault. + * + *

Performs update on the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 vault model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String vaultName) { + final VaultModelUpdate body = null; + return beginUpdateAsync(resourceGroupName, vaultName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the vault. + * + *

Performs update on the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param body Vault properties. + * @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 vault model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String vaultName, VaultModelUpdate body, Context context) { + return beginUpdateAsync(resourceGroupName, vaultName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the vault. + * + *

Performs update on the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 vault model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VaultModelInner update(String resourceGroupName, String vaultName) { + final VaultModelUpdate body = null; + return updateAsync(resourceGroupName, vaultName, body).block(); + } + + /** + * Updates the vault. + * + *

Performs update on the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param body Vault properties. + * @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 vault model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VaultModelInner update(String resourceGroupName, String vaultName, VaultModelUpdate body, Context context) { + return updateAsync(resourceGroupName, vaultName, body, context).block(); + } + + /** + * Deletes the vault. + * + *

Removes the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String vaultName) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the vault. + * + *

Removes the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String vaultName, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the vault. + * + *

Removes the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String vaultName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, vaultName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the vault. + * + *

Removes the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String vaultName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, vaultName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the vault. + * + *

Removes the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String vaultName) { + return this.beginDeleteAsync(resourceGroupName, vaultName).getSyncPoller(); + } + + /** + * Deletes the vault. + * + *

Removes the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String vaultName, Context context) { + return this.beginDeleteAsync(resourceGroupName, vaultName, context).getSyncPoller(); + } + + /** + * Deletes the vault. + * + *

Removes the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String vaultName) { + return beginDeleteAsync(resourceGroupName, vaultName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the vault. + * + *

Removes the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String vaultName, Context context) { + return beginDeleteAsync(resourceGroupName, vaultName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the vault. + * + *

Removes the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String vaultName) { + deleteAsync(resourceGroupName, vaultName).block(); + } + + /** + * Deletes the vault. + * + *

Removes the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String vaultName, Context context) { + deleteAsync(resourceGroupName, vaultName, context).block(); + } + + /** + * Lists the vaults. + * + *

Gets the list of vaults in the given subscription. + * + * @param continuationToken Continuation token from the previous call. + * @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 list of vaults in the given subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String continuationToken) { + 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(), + continuationToken, + 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())); + } + + /** + * Lists the vaults. + * + *

Gets the list of vaults in the given subscription. + * + * @param continuationToken Continuation token from the previous call. + * @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 list of vaults in the given subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String continuationToken, 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(), + continuationToken, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the vaults. + * + *

Gets the list of vaults in the given subscription. + * + * @param continuationToken Continuation token from the previous call. + * @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 list of vaults in the given subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String continuationToken) { + return new PagedFlux<>( + () -> listSinglePageAsync(continuationToken), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists the vaults. + * + *

Gets the list of vaults in the given 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 the list of vaults in the given subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String continuationToken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(continuationToken), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists the vaults. + * + *

Gets the list of vaults in the given subscription. + * + * @param continuationToken Continuation token from the previous call. + * @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 list of vaults in the given subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String continuationToken, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(continuationToken, context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the vaults. + * + *

Gets the list of vaults in the given 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 the list of vaults in the given subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String continuationToken = null; + return new PagedIterable<>(listAsync(continuationToken)); + } + + /** + * Lists the vaults. + * + *

Gets the list of vaults in the given subscription. + * + * @param continuationToken Continuation token from the previous call. + * @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 list of vaults in the given subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String continuationToken, Context context) { + return new PagedIterable<>(listAsync(continuationToken, context)); + } + + /** + * Lists the vaults. + * + *

Gets the list of vaults in the given subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param continuationToken Continuation token from the previous call. + * @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 list of vaults in the given subscription and resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String continuationToken) { + 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, + continuationToken, + 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())); + } + + /** + * Lists the vaults. + * + *

Gets the list of vaults in the given subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param continuationToken Continuation token from the previous call. + * @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 list of vaults in the given subscription and resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String continuationToken, 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, + continuationToken, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the vaults. + * + *

Gets the list of vaults in the given subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param continuationToken Continuation token from the previous call. + * @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 list of vaults in the given subscription and resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String continuationToken) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, continuationToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the vaults. + * + *

Gets the list of vaults in the given subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of vaults in the given subscription and resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String continuationToken = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, continuationToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the vaults. + * + *

Gets the list of vaults in the given subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param continuationToken Continuation token from the previous call. + * @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 list of vaults in the given subscription and resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String continuationToken, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, continuationToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the vaults. + * + *

Gets the list of vaults in the given subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of vaults in the given subscription and resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String continuationToken = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, continuationToken)); + } + + /** + * Lists the vaults. + * + *

Gets the list of vaults in the given subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param continuationToken Continuation token from the previous call. + * @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 list of vaults in the given subscription and resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, String continuationToken, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, continuationToken, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 vault model collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(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 URL to get the next list of items + *

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 vault model collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + 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 + .listBySubscriptionNext(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 URL to get the next list of items + *

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 vault model collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 vault model collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/VaultsImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/VaultsImpl.java new file mode 100644 index 000000000000..a57ae025e9ca --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/VaultsImpl.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.recoveryservicesdatareplication.fluent.VaultsClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.VaultModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.VaultModel; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.Vaults; + +public final class VaultsImpl implements Vaults { + private static final ClientLogger LOGGER = new ClientLogger(VaultsImpl.class); + + private final VaultsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + public VaultsImpl( + VaultsClient innerClient, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String vaultName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, vaultName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VaultModelImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VaultModel getByResourceGroup(String resourceGroupName, String vaultName) { + VaultModelInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, vaultName); + if (inner != null) { + return new VaultModelImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String vaultName) { + this.serviceClient().delete(resourceGroupName, vaultName); + } + + public void delete(String resourceGroupName, String vaultName, Context context) { + this.serviceClient().delete(resourceGroupName, vaultName, context); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VaultModelImpl(inner1, this.manager())); + } + + public PagedIterable list(String continuationToken, Context context) { + PagedIterable inner = this.serviceClient().list(continuationToken, context); + return Utils.mapPage(inner, inner1 -> new VaultModelImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VaultModelImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, String continuationToken, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, continuationToken, context); + return Utils.mapPage(inner, inner1 -> new VaultModelImpl(inner1, this.manager())); + } + + public VaultModel 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 vaultName = Utils.getValueFromIdByName(id, "replicationVaults"); + if (vaultName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationVaults'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, vaultName, 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 vaultName = Utils.getValueFromIdByName(id, "replicationVaults"); + if (vaultName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationVaults'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, vaultName, 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 vaultName = Utils.getValueFromIdByName(id, "replicationVaults"); + if (vaultName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationVaults'.", id))); + } + this.delete(resourceGroupName, vaultName, 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 vaultName = Utils.getValueFromIdByName(id, "replicationVaults"); + if (vaultName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'replicationVaults'.", id))); + } + this.delete(resourceGroupName, vaultName, context); + } + + private VaultsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } + + public VaultModelImpl define(String name) { + return new VaultModelImpl(name, this.manager()); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/WorkflowModelImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/WorkflowModelImpl.java new file mode 100644 index 000000000000..6431d2ecc9b5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/WorkflowModelImpl.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.recoveryservicesdatareplication.implementation; + +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.WorkflowModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.WorkflowModel; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.WorkflowModelProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.WorkflowModelSystemData; + +public final class WorkflowModelImpl implements WorkflowModel { + private WorkflowModelInner innerObject; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + WorkflowModelImpl( + WorkflowModelInner innerObject, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public WorkflowModelProperties properties() { + return this.innerModel().properties(); + } + + public WorkflowModelSystemData systemData() { + return this.innerModel().systemData(); + } + + public WorkflowModelInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/WorkflowOperationStatusClientImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/WorkflowOperationStatusClientImpl.java new file mode 100644 index 000000000000..da573857a650 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/WorkflowOperationStatusClientImpl.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.recoveryservicesdatareplication.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.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.resourcemanager.recoveryservicesdatareplication.fluent.WorkflowOperationStatusClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.OperationStatusInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in WorkflowOperationStatusClient. */ +public final class WorkflowOperationStatusClientImpl implements WorkflowOperationStatusClient { + /** The proxy service used to perform REST calls. */ + private final WorkflowOperationStatusService service; + + /** The service client containing this operation class. */ + private final DataReplicationMgmtClientImpl client; + + /** + * Initializes an instance of WorkflowOperationStatusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkflowOperationStatusClientImpl(DataReplicationMgmtClientImpl client) { + this.service = + RestProxy + .create(WorkflowOperationStatusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataReplicationMgmtClientWorkflowOperationStatus to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataReplicationMgmtC") + public interface WorkflowOperationStatusService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName}/operations/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("jobName") String jobName, + @PathParam("operationId") String operationId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the job (workflow) operation status. + * + *

Tracks the results of an asynchronous operation on the job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param jobName The job (workflow) name. + * @param operationId The ID of an ongoing async 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 defines the operation status along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String jobName, String operationId) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + jobName, + operationId, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the job (workflow) operation status. + * + *

Tracks the results of an asynchronous operation on the job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param jobName The job (workflow) name. + * @param operationId The ID of an ongoing async operation. + * @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 defines the operation status along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String jobName, String operationId, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + jobName, + operationId, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the job (workflow) operation status. + * + *

Tracks the results of an asynchronous operation on the job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param jobName The job (workflow) name. + * @param operationId The ID of an ongoing async 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 defines the operation status on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String vaultName, String jobName, String operationId) { + return getWithResponseAsync(resourceGroupName, vaultName, jobName, operationId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the job (workflow) operation status. + * + *

Tracks the results of an asynchronous operation on the job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param jobName The job (workflow) name. + * @param operationId The ID of an ongoing async operation. + * @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 defines the operation status along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String vaultName, String jobName, String operationId, Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, jobName, operationId, context).block(); + } + + /** + * Gets the job (workflow) operation status. + * + *

Tracks the results of an asynchronous operation on the job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param jobName The job (workflow) name. + * @param operationId The ID of an ongoing async 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 defines the operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner get(String resourceGroupName, String vaultName, String jobName, String operationId) { + return getWithResponse(resourceGroupName, vaultName, jobName, operationId, Context.NONE).getValue(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/WorkflowOperationStatusImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/WorkflowOperationStatusImpl.java new file mode 100644 index 000000000000..2e6a16ceeb4c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/WorkflowOperationStatusImpl.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.implementation; + +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.recoveryservicesdatareplication.fluent.WorkflowOperationStatusClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.OperationStatus; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.WorkflowOperationStatus; + +public final class WorkflowOperationStatusImpl implements WorkflowOperationStatus { + private static final ClientLogger LOGGER = new ClientLogger(WorkflowOperationStatusImpl.class); + + private final WorkflowOperationStatusClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + public WorkflowOperationStatusImpl( + WorkflowOperationStatusClient innerClient, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String vaultName, String jobName, String operationId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, vaultName, jobName, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OperationStatusImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OperationStatus get(String resourceGroupName, String vaultName, String jobName, String operationId) { + OperationStatusInner inner = this.serviceClient().get(resourceGroupName, vaultName, jobName, operationId); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + private WorkflowOperationStatusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/WorkflowsClientImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/WorkflowsClientImpl.java new file mode 100644 index 000000000000..9983496e378e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/WorkflowsClientImpl.java @@ -0,0 +1,570 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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.resourcemanager.recoveryservicesdatareplication.fluent.WorkflowsClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.WorkflowModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.WorkflowModelCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in WorkflowsClient. */ +public final class WorkflowsClientImpl implements WorkflowsClient { + /** The proxy service used to perform REST calls. */ + private final WorkflowsService service; + + /** The service client containing this operation class. */ + private final DataReplicationMgmtClientImpl client; + + /** + * Initializes an instance of WorkflowsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkflowsClientImpl(DataReplicationMgmtClientImpl client) { + this.service = + RestProxy.create(WorkflowsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataReplicationMgmtClientWorkflows to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataReplicationMgmtC") + public interface WorkflowsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("jobName") String jobName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @QueryParam("$filter") String filter, + @QueryParam("continuationToken") String continuationToken, + @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); + } + + /** + * Gets the job (workflow). + * + *

Gets the details of the job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param jobName The job (workflow) 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 the details of the job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String jobName) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + jobName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the job (workflow). + * + *

Gets the details of the job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param jobName The job (workflow) 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 the details of the job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String jobName, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + jobName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the job (workflow). + * + *

Gets the details of the job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param jobName The job (workflow) 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 the details of the job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String vaultName, String jobName) { + return getWithResponseAsync(resourceGroupName, vaultName, jobName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the job (workflow). + * + *

Gets the details of the job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param jobName The job (workflow) 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 the details of the job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String vaultName, String jobName, Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, jobName, context).block(); + } + + /** + * Gets the job (workflow). + * + *

Gets the details of the job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param jobName The job (workflow) 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 the details of the job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkflowModelInner get(String resourceGroupName, String vaultName, String jobName) { + return getWithResponse(resourceGroupName, vaultName, jobName, Context.NONE).getValue(); + } + + /** + * Lists the jobs (workflows). + * + *

Gets the list of jobs in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param filter Filter string. + * @param continuationToken Continuation token. + * @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 list of jobs in the given vault along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String vaultName, String filter, String continuationToken) { + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + filter, + continuationToken, + 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())); + } + + /** + * Lists the jobs (workflows). + * + *

Gets the list of jobs in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param filter Filter string. + * @param continuationToken Continuation token. + * @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 list of jobs in the given vault along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String vaultName, String filter, String continuationToken, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName 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(), + resourceGroupName, + vaultName, + filter, + continuationToken, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the jobs (workflows). + * + *

Gets the list of jobs in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param filter Filter string. + * @param continuationToken Continuation token. + * @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 list of jobs in the given vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String vaultName, String filter, String continuationToken) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName, filter, continuationToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the jobs (workflows). + * + *

Gets the list of jobs in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of jobs in the given vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vaultName) { + final String filter = null; + final String continuationToken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName, filter, continuationToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the jobs (workflows). + * + *

Gets the list of jobs in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param filter Filter string. + * @param continuationToken Continuation token. + * @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 list of jobs in the given vault as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String vaultName, String filter, String continuationToken, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName, filter, continuationToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the jobs (workflows). + * + *

Gets the list of jobs in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of jobs in the given vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName) { + final String filter = null; + final String continuationToken = null; + return new PagedIterable<>(listAsync(resourceGroupName, vaultName, filter, continuationToken)); + } + + /** + * Lists the jobs (workflows). + * + *

Gets the list of jobs in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param filter Filter string. + * @param continuationToken Continuation token. + * @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 list of jobs in the given vault as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String vaultName, String filter, String continuationToken, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, vaultName, filter, continuationToken, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 workflow model collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 workflow model collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/WorkflowsImpl.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/WorkflowsImpl.java new file mode 100644 index 000000000000..3ca0c9672a53 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/WorkflowsImpl.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.recoveryservicesdatareplication.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.recoveryservicesdatareplication.fluent.WorkflowsClient; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.WorkflowModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.WorkflowModel; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.Workflows; + +public final class WorkflowsImpl implements Workflows { + private static final ClientLogger LOGGER = new ClientLogger(WorkflowsImpl.class); + + private final WorkflowsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager; + + public WorkflowsImpl( + WorkflowsClient innerClient, + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager + serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String vaultName, String jobName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, vaultName, jobName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WorkflowModelImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public WorkflowModel get(String resourceGroupName, String vaultName, String jobName) { + WorkflowModelInner inner = this.serviceClient().get(resourceGroupName, vaultName, jobName); + if (inner != null) { + return new WorkflowModelImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String vaultName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, vaultName); + return Utils.mapPage(inner, inner1 -> new WorkflowModelImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String vaultName, String filter, String continuationToken, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, vaultName, filter, continuationToken, context); + return Utils.mapPage(inner, inner1 -> new WorkflowModelImpl(inner1, this.manager())); + } + + private WorkflowsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/package-info.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/package-info.java new file mode 100644 index 000000000000..fa5aeb3ed87b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/implementation/package-info.java @@ -0,0 +1,9 @@ +// 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 DataReplicationMgmtClient. A first party Azure service enabling the data + * replication. + */ +package com.azure.resourcemanager.recoveryservicesdatareplication.implementation; diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ActionType.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ActionType.java new file mode 100644 index 000000000000..8c1b8fed723f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ActionType.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ +public final class ActionType extends ExpandableStringEnum { + /** Static value Internal for ActionType. */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + @JsonCreator + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/AzStackHciClusterProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/AzStackHciClusterProperties.java new file mode 100644 index 000000000000..6ac64fc0a199 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/AzStackHciClusterProperties.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** AzStackHCI cluster properties. */ +@Fluent +public final class AzStackHciClusterProperties { + /* + * Gets or sets the AzStackHCICluster FQDN name. + */ + @JsonProperty(value = "clusterName", required = true) + private String clusterName; + + /* + * Gets or sets the AzStackHCICluster resource name. + */ + @JsonProperty(value = "resourceName", required = true) + private String resourceName; + + /* + * Gets or sets the Storage account name. + */ + @JsonProperty(value = "storageAccountName", required = true) + private String storageAccountName; + + /* + * Gets or sets the list of AzStackHCICluster Storage Container. + */ + @JsonProperty(value = "storageContainers", required = true) + private List storageContainers; + + /** Creates an instance of AzStackHciClusterProperties class. */ + public AzStackHciClusterProperties() { + } + + /** + * Get the clusterName property: Gets or sets the AzStackHCICluster FQDN name. + * + * @return the clusterName value. + */ + public String clusterName() { + return this.clusterName; + } + + /** + * Set the clusterName property: Gets or sets the AzStackHCICluster FQDN name. + * + * @param clusterName the clusterName value to set. + * @return the AzStackHciClusterProperties object itself. + */ + public AzStackHciClusterProperties withClusterName(String clusterName) { + this.clusterName = clusterName; + return this; + } + + /** + * Get the resourceName property: Gets or sets the AzStackHCICluster resource name. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Set the resourceName property: Gets or sets the AzStackHCICluster resource name. + * + * @param resourceName the resourceName value to set. + * @return the AzStackHciClusterProperties object itself. + */ + public AzStackHciClusterProperties withResourceName(String resourceName) { + this.resourceName = resourceName; + return this; + } + + /** + * Get the storageAccountName property: Gets or sets the Storage account name. + * + * @return the storageAccountName value. + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set the storageAccountName property: Gets or sets the Storage account name. + * + * @param storageAccountName the storageAccountName value to set. + * @return the AzStackHciClusterProperties object itself. + */ + public AzStackHciClusterProperties withStorageAccountName(String storageAccountName) { + this.storageAccountName = storageAccountName; + return this; + } + + /** + * Get the storageContainers property: Gets or sets the list of AzStackHCICluster Storage Container. + * + * @return the storageContainers value. + */ + public List storageContainers() { + return this.storageContainers; + } + + /** + * Set the storageContainers property: Gets or sets the list of AzStackHCICluster Storage Container. + * + * @param storageContainers the storageContainers value to set. + * @return the AzStackHciClusterProperties object itself. + */ + public AzStackHciClusterProperties withStorageContainers(List storageContainers) { + this.storageContainers = storageContainers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (clusterName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property clusterName in model AzStackHciClusterProperties")); + } + if (resourceName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property resourceName in model AzStackHciClusterProperties")); + } + if (storageAccountName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property storageAccountName in model AzStackHciClusterProperties")); + } + if (storageContainers() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property storageContainers in model AzStackHciClusterProperties")); + } else { + storageContainers().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AzStackHciClusterProperties.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/AzStackHciFabricModelCustomProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/AzStackHciFabricModelCustomProperties.java new file mode 100644 index 000000000000..16414467d9e4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/AzStackHciFabricModelCustomProperties.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** AzStackHCI fabric model custom properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("AzStackHCI") +@Fluent +public final class AzStackHciFabricModelCustomProperties extends FabricModelCustomProperties { + /* + * Gets or sets the ARM Id of the AzStackHCI site. + */ + @JsonProperty(value = "azStackHciSiteId", required = true) + private String azStackHciSiteId; + + /* + * Gets or sets the Appliance name. + */ + @JsonProperty(value = "applianceName", access = JsonProperty.Access.WRITE_ONLY) + private List applianceName; + + /* + * AzStackHCI cluster properties. + */ + @JsonProperty(value = "cluster", required = true) + private AzStackHciClusterProperties cluster; + + /* + * Gets or sets the fabric resource Id. + */ + @JsonProperty(value = "fabricResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String fabricResourceId; + + /* + * Gets or sets the fabric container Id. + */ + @JsonProperty(value = "fabricContainerId", access = JsonProperty.Access.WRITE_ONLY) + private String fabricContainerId; + + /* + * Gets or sets the Migration solution ARM Id. + */ + @JsonProperty(value = "migrationSolutionId", required = true) + private String migrationSolutionId; + + /* + * Gets or sets the migration hub Uri. + */ + @JsonProperty(value = "migrationHubUri", access = JsonProperty.Access.WRITE_ONLY) + private String migrationHubUri; + + /** Creates an instance of AzStackHciFabricModelCustomProperties class. */ + public AzStackHciFabricModelCustomProperties() { + } + + /** + * Get the azStackHciSiteId property: Gets or sets the ARM Id of the AzStackHCI site. + * + * @return the azStackHciSiteId value. + */ + public String azStackHciSiteId() { + return this.azStackHciSiteId; + } + + /** + * Set the azStackHciSiteId property: Gets or sets the ARM Id of the AzStackHCI site. + * + * @param azStackHciSiteId the azStackHciSiteId value to set. + * @return the AzStackHciFabricModelCustomProperties object itself. + */ + public AzStackHciFabricModelCustomProperties withAzStackHciSiteId(String azStackHciSiteId) { + this.azStackHciSiteId = azStackHciSiteId; + return this; + } + + /** + * Get the applianceName property: Gets or sets the Appliance name. + * + * @return the applianceName value. + */ + public List applianceName() { + return this.applianceName; + } + + /** + * Get the cluster property: AzStackHCI cluster properties. + * + * @return the cluster value. + */ + public AzStackHciClusterProperties cluster() { + return this.cluster; + } + + /** + * Set the cluster property: AzStackHCI cluster properties. + * + * @param cluster the cluster value to set. + * @return the AzStackHciFabricModelCustomProperties object itself. + */ + public AzStackHciFabricModelCustomProperties withCluster(AzStackHciClusterProperties cluster) { + this.cluster = cluster; + return this; + } + + /** + * Get the fabricResourceId property: Gets or sets the fabric resource Id. + * + * @return the fabricResourceId value. + */ + public String fabricResourceId() { + return this.fabricResourceId; + } + + /** + * Get the fabricContainerId property: Gets or sets the fabric container Id. + * + * @return the fabricContainerId value. + */ + public String fabricContainerId() { + return this.fabricContainerId; + } + + /** + * Get the migrationSolutionId property: Gets or sets the Migration solution ARM Id. + * + * @return the migrationSolutionId value. + */ + public String migrationSolutionId() { + return this.migrationSolutionId; + } + + /** + * Set the migrationSolutionId property: Gets or sets the Migration solution ARM Id. + * + * @param migrationSolutionId the migrationSolutionId value to set. + * @return the AzStackHciFabricModelCustomProperties object itself. + */ + public AzStackHciFabricModelCustomProperties withMigrationSolutionId(String migrationSolutionId) { + this.migrationSolutionId = migrationSolutionId; + return this; + } + + /** + * Get the migrationHubUri property: Gets or sets the migration hub Uri. + * + * @return the migrationHubUri value. + */ + public String migrationHubUri() { + return this.migrationHubUri; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (azStackHciSiteId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property azStackHciSiteId in model AzStackHciFabricModelCustomProperties")); + } + if (cluster() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property cluster in model AzStackHciFabricModelCustomProperties")); + } else { + cluster().validate(); + } + if (migrationSolutionId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property migrationSolutionId in model" + + " AzStackHciFabricModelCustomProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AzStackHciFabricModelCustomProperties.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/CheckNameAvailabilityModel.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/CheckNameAvailabilityModel.java new file mode 100644 index 000000000000..033a4b7b4278 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/CheckNameAvailabilityModel.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Check name availability model. */ +@Fluent +public final class CheckNameAvailabilityModel { + /* + * Gets or sets the resource name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Gets or sets the resource type. + */ + @JsonProperty(value = "type") + private String type; + + /** Creates an instance of CheckNameAvailabilityModel class. */ + public CheckNameAvailabilityModel() { + } + + /** + * Get the name property: Gets or sets the resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets or sets the resource name. + * + * @param name the name value to set. + * @return the CheckNameAvailabilityModel object itself. + */ + public CheckNameAvailabilityModel withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: Gets or sets the resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Gets or sets the resource type. + * + * @param type the type value to set. + * @return the CheckNameAvailabilityModel object itself. + */ + public CheckNameAvailabilityModel withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/CheckNameAvailabilityResponseModel.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/CheckNameAvailabilityResponseModel.java new file mode 100644 index 000000000000..8b8ddd3e1acf --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/CheckNameAvailabilityResponseModel.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.CheckNameAvailabilityResponseModelInner; + +/** An immutable client-side representation of CheckNameAvailabilityResponseModel. */ +public interface CheckNameAvailabilityResponseModel { + /** + * Gets the nameAvailable property: Gets or sets a value indicating whether resource name is available or not. + * + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * Gets the reason property: Gets or sets the reason for resource name unavailability. + * + * @return the reason value. + */ + String reason(); + + /** + * Gets the message property: Gets or sets the message for resource name unavailability. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner + * com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.CheckNameAvailabilityResponseModelInner + * object. + * + * @return the inner object. + */ + CheckNameAvailabilityResponseModelInner innerModel(); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DeploymentPreflightModel.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DeploymentPreflightModel.java new file mode 100644 index 000000000000..beeca20739cd --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DeploymentPreflightModel.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.DeploymentPreflightModelInner; +import java.util.List; + +/** An immutable client-side representation of DeploymentPreflightModel. */ +public interface DeploymentPreflightModel { + /** + * Gets the resources property: Gets or sets the list of resources. + * + * @return the resources value. + */ + List resources(); + + /** + * Gets the inner + * com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.DeploymentPreflightModelInner object. + * + * @return the inner object. + */ + DeploymentPreflightModelInner innerModel(); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DeploymentPreflightResource.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DeploymentPreflightResource.java new file mode 100644 index 000000000000..f3c87bf395f9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DeploymentPreflightResource.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Deployment preflight resource. */ +@Fluent +public final class DeploymentPreflightResource { + /* + * Gets or sets the resource name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Gets or sets the resource type. + */ + @JsonProperty(value = "type") + private String type; + + /* + * Gets or sets the location of the resource. + */ + @JsonProperty(value = "location") + private String location; + + /* + * Gets or sets the Api version. + */ + @JsonProperty(value = "apiVersion") + private String apiVersion; + + /** Creates an instance of DeploymentPreflightResource class. */ + public DeploymentPreflightResource() { + } + + /** + * Get the name property: Gets or sets the resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets or sets the resource name. + * + * @param name the name value to set. + * @return the DeploymentPreflightResource object itself. + */ + public DeploymentPreflightResource withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: Gets or sets the resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Gets or sets the resource type. + * + * @param type the type value to set. + * @return the DeploymentPreflightResource object itself. + */ + public DeploymentPreflightResource withType(String type) { + this.type = type; + return this; + } + + /** + * Get the location property: Gets or sets the location of the resource. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Gets or sets the location of the resource. + * + * @param location the location value to set. + * @return the DeploymentPreflightResource object itself. + */ + public DeploymentPreflightResource withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the apiVersion property: Gets or sets the Api version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** + * Set the apiVersion property: Gets or sets the Api version. + * + * @param apiVersion the apiVersion value to set. + * @return the DeploymentPreflightResource object itself. + */ + public DeploymentPreflightResource withApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DraModel.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DraModel.java new file mode 100644 index 000000000000..bbb043582b0c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DraModel.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.DraModelInner; + +/** An immutable client-side representation of DraModel. */ +public interface DraModel { + /** + * 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 properties property: Dra model properties. + * + * @return the properties value. + */ + DraModelProperties properties(); + + /** + * Gets the systemData property: The systemData property. + * + * @return the systemData value. + */ + DraModelSystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.DraModelInner object. + * + * @return the inner object. + */ + DraModelInner innerModel(); + + /** The entirety of the DraModel definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + + /** The DraModel definition stages. */ + interface DefinitionStages { + /** The first stage of the DraModel definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the DraModel definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, fabricName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @return the next definition stage. + */ + WithProperties withExistingReplicationFabric(String resourceGroupName, String fabricName); + } + + /** The stage of the DraModel definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Dra model properties.. + * + * @param properties Dra model properties. + * @return the next definition stage. + */ + WithCreate withProperties(DraModelProperties properties); + } + + /** + * The stage of the DraModel 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + DraModel create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DraModel create(Context context); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DraModel refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DraModel refresh(Context context); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DraModelCollection.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DraModelCollection.java new file mode 100644 index 000000000000..835bf58a9961 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DraModelCollection.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.DraModelInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Dra model collection. */ +@Fluent +public final class DraModelCollection { + /* + * Gets or sets the list of Dras. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets or sets the value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of DraModelCollection class. */ + public DraModelCollection() { + } + + /** + * Get the value property: Gets or sets the list of Dras. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets the list of Dras. + * + * @param value the value value to set. + * @return the DraModelCollection object itself. + */ + public DraModelCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets or sets the value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets or sets the value of next link. + * + * @param nextLink the nextLink value to set. + * @return the DraModelCollection object itself. + */ + public DraModelCollection 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/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DraModelCustomProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DraModelCustomProperties.java new file mode 100644 index 000000000000..424e8730bcbd --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DraModelCustomProperties.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Dra model custom properties. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = DraModelCustomProperties.class) +@JsonTypeName("DraModelCustomProperties") +@JsonSubTypes({@JsonSubTypes.Type(name = "VMware", value = VMwareDraModelCustomProperties.class)}) +@Immutable +public class DraModelCustomProperties { + /** Creates an instance of DraModelCustomProperties class. */ + public DraModelCustomProperties() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DraModelProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DraModelProperties.java new file mode 100644 index 000000000000..44b1d6e4a887 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DraModelProperties.java @@ -0,0 +1,286 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Dra model properties. */ +@Fluent +public final class DraModelProperties { + /* + * Gets or sets the Dra correlation Id. + */ + @JsonProperty(value = "correlationId", access = JsonProperty.Access.WRITE_ONLY) + private String correlationId; + + /* + * Gets or sets the machine Id where Dra is running. + */ + @JsonProperty(value = "machineId", required = true) + private String machineId; + + /* + * Gets or sets the machine name where Dra is running. + */ + @JsonProperty(value = "machineName", required = true) + private String machineName; + + /* + * Identity model. + */ + @JsonProperty(value = "authenticationIdentity", required = true) + private IdentityModel authenticationIdentity; + + /* + * Identity model. + */ + @JsonProperty(value = "resourceAccessIdentity", required = true) + private IdentityModel resourceAccessIdentity; + + /* + * Gets or sets a value indicating whether Dra is responsive. + */ + @JsonProperty(value = "isResponsive", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isResponsive; + + /* + * Gets or sets the time when last heartbeat was sent by the Dra. + */ + @JsonProperty(value = "lastHeartbeat", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastHeartbeat; + + /* + * Gets or sets the Dra version. + */ + @JsonProperty(value = "versionNumber", access = JsonProperty.Access.WRITE_ONLY) + private String versionNumber; + + /* + * Gets or sets the provisioning state of the Dra. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Gets or sets the list of health errors. + */ + @JsonProperty(value = "healthErrors", access = JsonProperty.Access.WRITE_ONLY) + private List healthErrors; + + /* + * Dra model custom properties. + */ + @JsonProperty(value = "customProperties", required = true) + private DraModelCustomProperties customProperties; + + /** Creates an instance of DraModelProperties class. */ + public DraModelProperties() { + } + + /** + * Get the correlationId property: Gets or sets the Dra correlation Id. + * + * @return the correlationId value. + */ + public String correlationId() { + return this.correlationId; + } + + /** + * Get the machineId property: Gets or sets the machine Id where Dra is running. + * + * @return the machineId value. + */ + public String machineId() { + return this.machineId; + } + + /** + * Set the machineId property: Gets or sets the machine Id where Dra is running. + * + * @param machineId the machineId value to set. + * @return the DraModelProperties object itself. + */ + public DraModelProperties withMachineId(String machineId) { + this.machineId = machineId; + return this; + } + + /** + * Get the machineName property: Gets or sets the machine name where Dra is running. + * + * @return the machineName value. + */ + public String machineName() { + return this.machineName; + } + + /** + * Set the machineName property: Gets or sets the machine name where Dra is running. + * + * @param machineName the machineName value to set. + * @return the DraModelProperties object itself. + */ + public DraModelProperties withMachineName(String machineName) { + this.machineName = machineName; + return this; + } + + /** + * Get the authenticationIdentity property: Identity model. + * + * @return the authenticationIdentity value. + */ + public IdentityModel authenticationIdentity() { + return this.authenticationIdentity; + } + + /** + * Set the authenticationIdentity property: Identity model. + * + * @param authenticationIdentity the authenticationIdentity value to set. + * @return the DraModelProperties object itself. + */ + public DraModelProperties withAuthenticationIdentity(IdentityModel authenticationIdentity) { + this.authenticationIdentity = authenticationIdentity; + return this; + } + + /** + * Get the resourceAccessIdentity property: Identity model. + * + * @return the resourceAccessIdentity value. + */ + public IdentityModel resourceAccessIdentity() { + return this.resourceAccessIdentity; + } + + /** + * Set the resourceAccessIdentity property: Identity model. + * + * @param resourceAccessIdentity the resourceAccessIdentity value to set. + * @return the DraModelProperties object itself. + */ + public DraModelProperties withResourceAccessIdentity(IdentityModel resourceAccessIdentity) { + this.resourceAccessIdentity = resourceAccessIdentity; + return this; + } + + /** + * Get the isResponsive property: Gets or sets a value indicating whether Dra is responsive. + * + * @return the isResponsive value. + */ + public Boolean isResponsive() { + return this.isResponsive; + } + + /** + * Get the lastHeartbeat property: Gets or sets the time when last heartbeat was sent by the Dra. + * + * @return the lastHeartbeat value. + */ + public OffsetDateTime lastHeartbeat() { + return this.lastHeartbeat; + } + + /** + * Get the versionNumber property: Gets or sets the Dra version. + * + * @return the versionNumber value. + */ + public String versionNumber() { + return this.versionNumber; + } + + /** + * Get the provisioningState property: Gets or sets the provisioning state of the Dra. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the healthErrors property: Gets or sets the list of health errors. + * + * @return the healthErrors value. + */ + public List healthErrors() { + return this.healthErrors; + } + + /** + * Get the customProperties property: Dra model custom properties. + * + * @return the customProperties value. + */ + public DraModelCustomProperties customProperties() { + return this.customProperties; + } + + /** + * Set the customProperties property: Dra model custom properties. + * + * @param customProperties the customProperties value to set. + * @return the DraModelProperties object itself. + */ + public DraModelProperties withCustomProperties(DraModelCustomProperties customProperties) { + this.customProperties = customProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (machineId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property machineId in model DraModelProperties")); + } + if (machineName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property machineName in model DraModelProperties")); + } + if (authenticationIdentity() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property authenticationIdentity in model DraModelProperties")); + } else { + authenticationIdentity().validate(); + } + if (resourceAccessIdentity() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property resourceAccessIdentity in model DraModelProperties")); + } else { + resourceAccessIdentity().validate(); + } + if (healthErrors() != null) { + healthErrors().forEach(e -> e.validate()); + } + if (customProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property customProperties in model DraModelProperties")); + } else { + customProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DraModelProperties.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DraModelSystemData.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DraModelSystemData.java new file mode 100644 index 000000000000..b2def7ca739a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DraModelSystemData.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import java.time.OffsetDateTime; + +/** The DraModelSystemData model. */ +@Fluent +public final class DraModelSystemData extends SystemDataModel { + /** Creates an instance of DraModelSystemData class. */ + public DraModelSystemData() { + } + + /** {@inheritDoc} */ + @Override + public DraModelSystemData withCreatedBy(String createdBy) { + super.withCreatedBy(createdBy); + return this; + } + + /** {@inheritDoc} */ + @Override + public DraModelSystemData withCreatedByType(String createdByType) { + super.withCreatedByType(createdByType); + return this; + } + + /** {@inheritDoc} */ + @Override + public DraModelSystemData withCreatedAt(OffsetDateTime createdAt) { + super.withCreatedAt(createdAt); + return this; + } + + /** {@inheritDoc} */ + @Override + public DraModelSystemData withLastModifiedBy(String lastModifiedBy) { + super.withLastModifiedBy(lastModifiedBy); + return this; + } + + /** {@inheritDoc} */ + @Override + public DraModelSystemData withLastModifiedByType(String lastModifiedByType) { + super.withLastModifiedByType(lastModifiedByType); + return this; + } + + /** {@inheritDoc} */ + @Override + public DraModelSystemData withLastModifiedAt(OffsetDateTime lastModifiedAt) { + super.withLastModifiedAt(lastModifiedAt); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DraOperationStatus.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DraOperationStatus.java new file mode 100644 index 000000000000..01dcbc930764 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/DraOperationStatus.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DraOperationStatus. */ +public interface DraOperationStatus { + /** + * Gets the fabric agent (Dra) operation status. + * + *

Tracks the results of an asynchronous operation on the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) name. + * @param operationId The ID of an ongoing async operation. + * @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 defines the operation status along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String fabricName, String fabricAgentName, String operationId, Context context); + + /** + * Gets the fabric agent (Dra) operation status. + * + *

Tracks the results of an asynchronous operation on the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) name. + * @param operationId The ID of an ongoing async 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 defines the operation status. + */ + OperationStatus get(String resourceGroupName, String fabricName, String fabricAgentName, String operationId); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Dras.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Dras.java new file mode 100644 index 000000000000..28144130c7cb --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Dras.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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 Dras. */ +public interface Dras { + /** + * Gets the fabric agent (Dra). + * + *

Gets the details of the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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 the details of the fabric agent along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String fabricName, String fabricAgentName, Context context); + + /** + * Gets the fabric agent (Dra). + * + *

Gets the details of the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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 the details of the fabric agent. + */ + DraModel get(String resourceGroupName, String fabricName, String fabricAgentName); + + /** + * Deletes the fabric agent (Dra). + * + *

Deletes the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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. + */ + void delete(String resourceGroupName, String fabricName, String fabricAgentName); + + /** + * Deletes the fabric agent (Dra). + * + *

Deletes the fabric agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param fabricAgentName The fabric agent (Dra) 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. + */ + void delete(String resourceGroupName, String fabricName, String fabricAgentName, Context context); + + /** + * Lists the fabric agents (Dras). + * + *

Gets the list of fabric agents in the given fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the list of fabric agents in the given fabric as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String fabricName); + + /** + * Lists the fabric agents (Dras). + * + *

Gets the list of fabric agents in the given fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the list of fabric agents in the given fabric as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String fabricName, Context context); + + /** + * Gets the fabric agent (Dra). + * + *

Gets the details of the fabric agent. + * + * @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 the details of the fabric agent along with {@link Response}. + */ + DraModel getById(String id); + + /** + * Gets the fabric agent (Dra). + * + *

Gets the details of the fabric agent. + * + * @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 the details of the fabric agent along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the fabric agent (Dra). + * + *

Deletes the fabric agent. + * + * @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 the fabric agent (Dra). + * + *

Deletes the fabric agent. + * + * @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 DraModel resource. + * + * @param name resource name. + * @return the first stage of the new DraModel definition. + */ + DraModel.DefinitionStages.Blank define(String name); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EmailConfigurationModel.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EmailConfigurationModel.java new file mode 100644 index 000000000000..db4e8467ce45 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EmailConfigurationModel.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.recoveryservicesdatareplication.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.EmailConfigurationModelInner; + +/** An immutable client-side representation of EmailConfigurationModel. */ +public interface EmailConfigurationModel { + /** + * 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 properties property: Email configuration model properties. + * + * @return the properties value. + */ + EmailConfigurationModelProperties properties(); + + /** + * Gets the systemData property: The systemData property. + * + * @return the systemData value. + */ + EmailConfigurationModelSystemData systemData(); + + /** + * Gets the inner + * com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.EmailConfigurationModelInner object. + * + * @return the inner object. + */ + EmailConfigurationModelInner innerModel(); + + /** The entirety of the EmailConfigurationModel definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + + /** The EmailConfigurationModel definition stages. */ + interface DefinitionStages { + /** The first stage of the EmailConfigurationModel definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the EmailConfigurationModel definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, vaultName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @return the next definition stage. + */ + WithProperties withExistingReplicationVault(String resourceGroupName, String vaultName); + } + + /** The stage of the EmailConfigurationModel definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Email configuration model properties.. + * + * @param properties Email configuration model properties. + * @return the next definition stage. + */ + WithCreate withProperties(EmailConfigurationModelProperties properties); + } + + /** + * The stage of the EmailConfigurationModel 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + EmailConfigurationModel create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + EmailConfigurationModel create(Context context); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + EmailConfigurationModel refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + EmailConfigurationModel refresh(Context context); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EmailConfigurationModelCollection.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EmailConfigurationModelCollection.java new file mode 100644 index 000000000000..f8fbc9f48461 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EmailConfigurationModelCollection.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.EmailConfigurationModelInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Email configuration model collection. */ +@Fluent +public final class EmailConfigurationModelCollection { + /* + * Gets or sets the list of email configurations. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets or sets the value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of EmailConfigurationModelCollection class. */ + public EmailConfigurationModelCollection() { + } + + /** + * Get the value property: Gets or sets the list of email configurations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets the list of email configurations. + * + * @param value the value value to set. + * @return the EmailConfigurationModelCollection object itself. + */ + public EmailConfigurationModelCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets or sets the value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets or sets the value of next link. + * + * @param nextLink the nextLink value to set. + * @return the EmailConfigurationModelCollection object itself. + */ + public EmailConfigurationModelCollection 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/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EmailConfigurationModelProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EmailConfigurationModelProperties.java new file mode 100644 index 000000000000..738355605fa1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EmailConfigurationModelProperties.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Email configuration model properties. */ +@Fluent +public final class EmailConfigurationModelProperties { + /* + * Gets or sets a value indicating whether to send email to subscription administrator. + */ + @JsonProperty(value = "sendToOwners", required = true) + private boolean sendToOwners; + + /* + * Gets or sets the custom email address for sending emails. + */ + @JsonProperty(value = "customEmailAddresses") + private List customEmailAddresses; + + /* + * Gets or sets the locale for the email notification. + */ + @JsonProperty(value = "locale") + private String locale; + + /** Creates an instance of EmailConfigurationModelProperties class. */ + public EmailConfigurationModelProperties() { + } + + /** + * Get the sendToOwners property: Gets or sets a value indicating whether to send email to subscription + * administrator. + * + * @return the sendToOwners value. + */ + public boolean sendToOwners() { + return this.sendToOwners; + } + + /** + * Set the sendToOwners property: Gets or sets a value indicating whether to send email to subscription + * administrator. + * + * @param sendToOwners the sendToOwners value to set. + * @return the EmailConfigurationModelProperties object itself. + */ + public EmailConfigurationModelProperties withSendToOwners(boolean sendToOwners) { + this.sendToOwners = sendToOwners; + return this; + } + + /** + * Get the customEmailAddresses property: Gets or sets the custom email address for sending emails. + * + * @return the customEmailAddresses value. + */ + public List customEmailAddresses() { + return this.customEmailAddresses; + } + + /** + * Set the customEmailAddresses property: Gets or sets the custom email address for sending emails. + * + * @param customEmailAddresses the customEmailAddresses value to set. + * @return the EmailConfigurationModelProperties object itself. + */ + public EmailConfigurationModelProperties withCustomEmailAddresses(List customEmailAddresses) { + this.customEmailAddresses = customEmailAddresses; + return this; + } + + /** + * Get the locale property: Gets or sets the locale for the email notification. + * + * @return the locale value. + */ + public String locale() { + return this.locale; + } + + /** + * Set the locale property: Gets or sets the locale for the email notification. + * + * @param locale the locale value to set. + * @return the EmailConfigurationModelProperties object itself. + */ + public EmailConfigurationModelProperties withLocale(String locale) { + this.locale = locale; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EmailConfigurationModelSystemData.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EmailConfigurationModelSystemData.java new file mode 100644 index 000000000000..8045b4083882 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EmailConfigurationModelSystemData.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import java.time.OffsetDateTime; + +/** The EmailConfigurationModelSystemData model. */ +@Fluent +public final class EmailConfigurationModelSystemData extends SystemDataModel { + /** Creates an instance of EmailConfigurationModelSystemData class. */ + public EmailConfigurationModelSystemData() { + } + + /** {@inheritDoc} */ + @Override + public EmailConfigurationModelSystemData withCreatedBy(String createdBy) { + super.withCreatedBy(createdBy); + return this; + } + + /** {@inheritDoc} */ + @Override + public EmailConfigurationModelSystemData withCreatedByType(String createdByType) { + super.withCreatedByType(createdByType); + return this; + } + + /** {@inheritDoc} */ + @Override + public EmailConfigurationModelSystemData withCreatedAt(OffsetDateTime createdAt) { + super.withCreatedAt(createdAt); + return this; + } + + /** {@inheritDoc} */ + @Override + public EmailConfigurationModelSystemData withLastModifiedBy(String lastModifiedBy) { + super.withLastModifiedBy(lastModifiedBy); + return this; + } + + /** {@inheritDoc} */ + @Override + public EmailConfigurationModelSystemData withLastModifiedByType(String lastModifiedByType) { + super.withLastModifiedByType(lastModifiedByType); + return this; + } + + /** {@inheritDoc} */ + @Override + public EmailConfigurationModelSystemData withLastModifiedAt(OffsetDateTime lastModifiedAt) { + super.withLastModifiedAt(lastModifiedAt); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EmailConfigurations.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EmailConfigurations.java new file mode 100644 index 000000000000..f4d079fe776c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EmailConfigurations.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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 EmailConfigurations. */ +public interface EmailConfigurations { + /** + * Gets the email configuration setting. + * + *

Gets the details of the alert configuration setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param emailConfigurationName The email configuration 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 the details of the alert configuration setting along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String vaultName, String emailConfigurationName, Context context); + + /** + * Gets the email configuration setting. + * + *

Gets the details of the alert configuration setting. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param emailConfigurationName The email configuration 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 the details of the alert configuration setting. + */ + EmailConfigurationModel get(String resourceGroupName, String vaultName, String emailConfigurationName); + + /** + * Lists the email configuration settings. + * + *

Gets the list of alert configuration settings for the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of alert configuration settings for the given vault as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String vaultName); + + /** + * Lists the email configuration settings. + * + *

Gets the list of alert configuration settings for the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of alert configuration settings for the given vault as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String vaultName, Context context); + + /** + * Gets the email configuration setting. + * + *

Gets the details of the alert configuration setting. + * + * @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 the details of the alert configuration setting along with {@link Response}. + */ + EmailConfigurationModel getById(String id); + + /** + * Gets the email configuration setting. + * + *

Gets the details of the alert configuration setting. + * + * @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 the details of the alert configuration setting along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new EmailConfigurationModel resource. + * + * @param name resource name. + * @return the first stage of the new EmailConfigurationModel definition. + */ + EmailConfigurationModel.DefinitionStages.Blank define(String name); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ErrorModel.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ErrorModel.java new file mode 100644 index 000000000000..e9b74e0680b2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ErrorModel.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Error model. */ +@Immutable +public final class ErrorModel { + /* + * Gets or sets the error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * Gets or sets the error type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Gets or sets the error severity. + */ + @JsonProperty(value = "severity", access = JsonProperty.Access.WRITE_ONLY) + private String severity; + + /* + * Gets or sets the creation time of error. + */ + @JsonProperty(value = "creationTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationTime; + + /* + * Gets or sets the error message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * Gets or sets the possible causes of error. + */ + @JsonProperty(value = "causes", access = JsonProperty.Access.WRITE_ONLY) + private String causes; + + /* + * Gets or sets the recommended action to resolve error. + */ + @JsonProperty(value = "recommendation", access = JsonProperty.Access.WRITE_ONLY) + private String recommendation; + + /** Creates an instance of ErrorModel class. */ + public ErrorModel() { + } + + /** + * Get the code property: Gets or sets the error code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the type property: Gets or sets the error type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the severity property: Gets or sets the error severity. + * + * @return the severity value. + */ + public String severity() { + return this.severity; + } + + /** + * Get the creationTime property: Gets or sets the creation time of error. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.creationTime; + } + + /** + * Get the message property: Gets or sets the error message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the causes property: Gets or sets the possible causes of error. + * + * @return the causes value. + */ + public String causes() { + return this.causes; + } + + /** + * Get the recommendation property: Gets or sets the recommended action to resolve error. + * + * @return the recommendation value. + */ + public String recommendation() { + return this.recommendation; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EventModel.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EventModel.java new file mode 100644 index 000000000000..3dd496d1a5f9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EventModel.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.recoveryservicesdatareplication.models; + +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.EventModelInner; + +/** An immutable client-side representation of EventModel. */ +public interface EventModel { + /** + * Gets the properties property: Event model properties. + * + * @return the properties value. + */ + EventModelProperties properties(); + + /** + * Gets the id property: Gets or sets the Id of the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Gets or sets the name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Gets or sets the type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The systemData property. + * + * @return the systemData value. + */ + EventModelSystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.EventModelInner object. + * + * @return the inner object. + */ + EventModelInner innerModel(); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EventModelCollection.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EventModelCollection.java new file mode 100644 index 000000000000..9f5a95ebb858 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EventModelCollection.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.EventModelInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Event model collection. */ +@Fluent +public final class EventModelCollection { + /* + * Gets or sets the list of events. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets or sets the value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of EventModelCollection class. */ + public EventModelCollection() { + } + + /** + * Get the value property: Gets or sets the list of events. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets the list of events. + * + * @param value the value value to set. + * @return the EventModelCollection object itself. + */ + public EventModelCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets or sets the value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets or sets the value of next link. + * + * @param nextLink the nextLink value to set. + * @return the EventModelCollection object itself. + */ + public EventModelCollection 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/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EventModelCustomProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EventModelCustomProperties.java new file mode 100644 index 000000000000..1cb7fa6e1bb0 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EventModelCustomProperties.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Event model custom properties. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = EventModelCustomProperties.class) +@JsonTypeName("EventModelCustomProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "HyperVToAzStackHCI", value = HyperVToAzStackHciEventModelCustomProperties.class) +}) +@Immutable +public class EventModelCustomProperties { + /** Creates an instance of EventModelCustomProperties class. */ + public EventModelCustomProperties() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EventModelProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EventModelProperties.java new file mode 100644 index 000000000000..5bfda250c95c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EventModelProperties.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Event model properties. */ +@Fluent +public final class EventModelProperties { + /* + * Gets or sets the resource type. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /* + * Gets or sets the resource name. + */ + @JsonProperty(value = "resourceName", access = JsonProperty.Access.WRITE_ONLY) + private String resourceName; + + /* + * Gets or sets the event type. + */ + @JsonProperty(value = "eventType", access = JsonProperty.Access.WRITE_ONLY) + private String eventType; + + /* + * Gets or sets the event name. + */ + @JsonProperty(value = "eventName", access = JsonProperty.Access.WRITE_ONLY) + private String eventName; + + /* + * Gets or sets the time at which the event occurred at source. + */ + @JsonProperty(value = "timeOfOccurrence", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timeOfOccurrence; + + /* + * Gets or sets the event severity. + */ + @JsonProperty(value = "severity", access = JsonProperty.Access.WRITE_ONLY) + private String severity; + + /* + * Gets or sets the event description. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * Gets or sets the event correlation Id. + */ + @JsonProperty(value = "correlationId", access = JsonProperty.Access.WRITE_ONLY) + private String correlationId; + + /* + * Gets or sets the errors associated with this event. + */ + @JsonProperty(value = "healthErrors", access = JsonProperty.Access.WRITE_ONLY) + private List healthErrors; + + /* + * Event model custom properties. + */ + @JsonProperty(value = "customProperties", required = true) + private EventModelCustomProperties customProperties; + + /** Creates an instance of EventModelProperties class. */ + public EventModelProperties() { + } + + /** + * Get the resourceType property: Gets or sets the resource type. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the resourceName property: Gets or sets the resource name. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Get the eventType property: Gets or sets the event type. + * + * @return the eventType value. + */ + public String eventType() { + return this.eventType; + } + + /** + * Get the eventName property: Gets or sets the event name. + * + * @return the eventName value. + */ + public String eventName() { + return this.eventName; + } + + /** + * Get the timeOfOccurrence property: Gets or sets the time at which the event occurred at source. + * + * @return the timeOfOccurrence value. + */ + public OffsetDateTime timeOfOccurrence() { + return this.timeOfOccurrence; + } + + /** + * Get the severity property: Gets or sets the event severity. + * + * @return the severity value. + */ + public String severity() { + return this.severity; + } + + /** + * Get the description property: Gets or sets the event description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the correlationId property: Gets or sets the event correlation Id. + * + * @return the correlationId value. + */ + public String correlationId() { + return this.correlationId; + } + + /** + * Get the healthErrors property: Gets or sets the errors associated with this event. + * + * @return the healthErrors value. + */ + public List healthErrors() { + return this.healthErrors; + } + + /** + * Get the customProperties property: Event model custom properties. + * + * @return the customProperties value. + */ + public EventModelCustomProperties customProperties() { + return this.customProperties; + } + + /** + * Set the customProperties property: Event model custom properties. + * + * @param customProperties the customProperties value to set. + * @return the EventModelProperties object itself. + */ + public EventModelProperties withCustomProperties(EventModelCustomProperties customProperties) { + this.customProperties = customProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (healthErrors() != null) { + healthErrors().forEach(e -> e.validate()); + } + if (customProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property customProperties in model EventModelProperties")); + } else { + customProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EventModelProperties.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EventModelSystemData.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EventModelSystemData.java new file mode 100644 index 000000000000..8cabb71ba352 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/EventModelSystemData.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import java.time.OffsetDateTime; + +/** The EventModelSystemData model. */ +@Fluent +public final class EventModelSystemData extends SystemDataModel { + /** Creates an instance of EventModelSystemData class. */ + public EventModelSystemData() { + } + + /** {@inheritDoc} */ + @Override + public EventModelSystemData withCreatedBy(String createdBy) { + super.withCreatedBy(createdBy); + return this; + } + + /** {@inheritDoc} */ + @Override + public EventModelSystemData withCreatedByType(String createdByType) { + super.withCreatedByType(createdByType); + return this; + } + + /** {@inheritDoc} */ + @Override + public EventModelSystemData withCreatedAt(OffsetDateTime createdAt) { + super.withCreatedAt(createdAt); + return this; + } + + /** {@inheritDoc} */ + @Override + public EventModelSystemData withLastModifiedBy(String lastModifiedBy) { + super.withLastModifiedBy(lastModifiedBy); + return this; + } + + /** {@inheritDoc} */ + @Override + public EventModelSystemData withLastModifiedByType(String lastModifiedByType) { + super.withLastModifiedByType(lastModifiedByType); + return this; + } + + /** {@inheritDoc} */ + @Override + public EventModelSystemData withLastModifiedAt(OffsetDateTime lastModifiedAt) { + super.withLastModifiedAt(lastModifiedAt); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Events.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Events.java new file mode 100644 index 000000000000..9b494f74586f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Events.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.recoveryservicesdatareplication.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 Events. */ +public interface Events { + /** + * Gets the event. + * + *

Gets the details of the event. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param eventName The event 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 the details of the event along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String vaultName, String eventName, Context context); + + /** + * Gets the event. + * + *

Gets the details of the event. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param eventName The event 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 the details of the event. + */ + EventModel get(String resourceGroupName, String vaultName, String eventName); + + /** + * Lists the events. + * + *

Gets the list of events in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of events in the given vault as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String vaultName); + + /** + * Lists the events. + * + *

Gets the list of events in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param filter Filter string. + * @param continuationToken Continuation token. + * @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 list of events in the given vault as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String vaultName, String filter, String continuationToken, Context context); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricModel.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricModel.java new file mode 100644 index 000000000000..a885795bcb21 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricModel.java @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.FabricModelInner; +import java.util.Map; + +/** An immutable client-side representation of FabricModel. */ +public interface FabricModel { + /** + * 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 properties property: Fabric model properties. + * + * @return the properties value. + */ + FabricModelProperties properties(); + + /** + * Gets the systemData property: The systemData property. + * + * @return the systemData value. + */ + FabricModelSystemData systemData(); + + /** + * 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.FabricModelInner object. + * + * @return the inner object. + */ + FabricModelInner innerModel(); + + /** The entirety of the FabricModel definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + + /** The FabricModel definition stages. */ + interface DefinitionStages { + /** The first stage of the FabricModel definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the FabricModel 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 FabricModel definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithProperties withExistingResourceGroup(String resourceGroupName); + } + + /** The stage of the FabricModel definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Fabric model properties.. + * + * @param properties Fabric model properties. + * @return the next definition stage. + */ + WithCreate withProperties(FabricModelProperties properties); + } + + /** + * The stage of the FabricModel 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + FabricModel create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + FabricModel create(Context context); + } + + /** The stage of the FabricModel 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); + } + } + + /** + * Begins update for the FabricModel resource. + * + * @return the stage of resource update. + */ + FabricModel.Update update(); + + /** The template for FabricModel update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + FabricModel apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + FabricModel apply(Context context); + } + + /** The FabricModel update stages. */ + interface UpdateStages { + /** The stage of the FabricModel update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Gets or sets the resource tags.. + * + * @param tags Gets or sets the resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** The stage of the FabricModel update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Fabric model properties.. + * + * @param properties Fabric model properties. + * @return the next definition stage. + */ + Update withProperties(FabricModelProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + FabricModel refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + FabricModel refresh(Context context); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricModelCollection.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricModelCollection.java new file mode 100644 index 000000000000..e99ce3428f1f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricModelCollection.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.FabricModelInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Fabric model collection. */ +@Fluent +public final class FabricModelCollection { + /* + * Gets or sets the list of fabrics. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets or sets the value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of FabricModelCollection class. */ + public FabricModelCollection() { + } + + /** + * Get the value property: Gets or sets the list of fabrics. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets the list of fabrics. + * + * @param value the value value to set. + * @return the FabricModelCollection object itself. + */ + public FabricModelCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets or sets the value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets or sets the value of next link. + * + * @param nextLink the nextLink value to set. + * @return the FabricModelCollection object itself. + */ + public FabricModelCollection 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/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricModelCustomProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricModelCustomProperties.java new file mode 100644 index 000000000000..257506172a06 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricModelCustomProperties.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Fabric model custom properties. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = FabricModelCustomProperties.class) +@JsonTypeName("FabricModelCustomProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzStackHCI", value = AzStackHciFabricModelCustomProperties.class), + @JsonSubTypes.Type(name = "HyperVMigrate", value = HyperVMigrateFabricModelCustomProperties.class), + @JsonSubTypes.Type(name = "VMwareMigrate", value = VMwareMigrateFabricModelCustomProperties.class) +}) +@Immutable +public class FabricModelCustomProperties { + /** Creates an instance of FabricModelCustomProperties class. */ + public FabricModelCustomProperties() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricModelProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricModelProperties.java new file mode 100644 index 000000000000..ea4d99d95ba4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricModelProperties.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Fabric model properties. */ +@Fluent +public final class FabricModelProperties { + /* + * Gets or sets the provisioning state of the fabric. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Gets or sets the service endpoint. + */ + @JsonProperty(value = "serviceEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String serviceEndpoint; + + /* + * Gets or sets the service resource Id. + */ + @JsonProperty(value = "serviceResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String serviceResourceId; + + /* + * Gets or sets the fabric health. + */ + @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) + private HealthStatus health; + + /* + * Gets or sets the list of health errors. + */ + @JsonProperty(value = "healthErrors", access = JsonProperty.Access.WRITE_ONLY) + private List healthErrors; + + /* + * Fabric model custom properties. + */ + @JsonProperty(value = "customProperties", required = true) + private FabricModelCustomProperties customProperties; + + /** Creates an instance of FabricModelProperties class. */ + public FabricModelProperties() { + } + + /** + * Get the provisioningState property: Gets or sets the provisioning state of the fabric. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the serviceEndpoint property: Gets or sets the service endpoint. + * + * @return the serviceEndpoint value. + */ + public String serviceEndpoint() { + return this.serviceEndpoint; + } + + /** + * Get the serviceResourceId property: Gets or sets the service resource Id. + * + * @return the serviceResourceId value. + */ + public String serviceResourceId() { + return this.serviceResourceId; + } + + /** + * Get the health property: Gets or sets the fabric health. + * + * @return the health value. + */ + public HealthStatus health() { + return this.health; + } + + /** + * Get the healthErrors property: Gets or sets the list of health errors. + * + * @return the healthErrors value. + */ + public List healthErrors() { + return this.healthErrors; + } + + /** + * Get the customProperties property: Fabric model custom properties. + * + * @return the customProperties value. + */ + public FabricModelCustomProperties customProperties() { + return this.customProperties; + } + + /** + * Set the customProperties property: Fabric model custom properties. + * + * @param customProperties the customProperties value to set. + * @return the FabricModelProperties object itself. + */ + public FabricModelProperties withCustomProperties(FabricModelCustomProperties customProperties) { + this.customProperties = customProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (healthErrors() != null) { + healthErrors().forEach(e -> e.validate()); + } + if (customProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property customProperties in model FabricModelProperties")); + } else { + customProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FabricModelProperties.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricModelSystemData.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricModelSystemData.java new file mode 100644 index 000000000000..9f23794187b5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricModelSystemData.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import java.time.OffsetDateTime; + +/** The FabricModelSystemData model. */ +@Fluent +public final class FabricModelSystemData extends SystemDataModel { + /** Creates an instance of FabricModelSystemData class. */ + public FabricModelSystemData() { + } + + /** {@inheritDoc} */ + @Override + public FabricModelSystemData withCreatedBy(String createdBy) { + super.withCreatedBy(createdBy); + return this; + } + + /** {@inheritDoc} */ + @Override + public FabricModelSystemData withCreatedByType(String createdByType) { + super.withCreatedByType(createdByType); + return this; + } + + /** {@inheritDoc} */ + @Override + public FabricModelSystemData withCreatedAt(OffsetDateTime createdAt) { + super.withCreatedAt(createdAt); + return this; + } + + /** {@inheritDoc} */ + @Override + public FabricModelSystemData withLastModifiedBy(String lastModifiedBy) { + super.withLastModifiedBy(lastModifiedBy); + return this; + } + + /** {@inheritDoc} */ + @Override + public FabricModelSystemData withLastModifiedByType(String lastModifiedByType) { + super.withLastModifiedByType(lastModifiedByType); + return this; + } + + /** {@inheritDoc} */ + @Override + public FabricModelSystemData withLastModifiedAt(OffsetDateTime lastModifiedAt) { + super.withLastModifiedAt(lastModifiedAt); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricModelUpdate.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricModelUpdate.java new file mode 100644 index 000000000000..a8157c04d44b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricModelUpdate.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Fabric model for update. */ +@Fluent +public final class FabricModelUpdate extends ProxyResource { + /* + * Gets or sets the resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * Fabric model properties. + */ + @JsonProperty(value = "properties") + private FabricModelProperties properties; + + /* + * The systemData property. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private FabricModelUpdateSystemData systemData; + + /** Creates an instance of FabricModelUpdate class. */ + public FabricModelUpdate() { + } + + /** + * Get the tags property: Gets or sets the resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Gets or sets the resource tags. + * + * @param tags the tags value to set. + * @return the FabricModelUpdate object itself. + */ + public FabricModelUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties property: Fabric model properties. + * + * @return the properties value. + */ + public FabricModelProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Fabric model properties. + * + * @param properties the properties value to set. + * @return the FabricModelUpdate object itself. + */ + public FabricModelUpdate withProperties(FabricModelProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: The systemData property. + * + * @return the systemData value. + */ + public FabricModelUpdateSystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (systemData() != null) { + systemData().validate(); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricModelUpdateSystemData.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricModelUpdateSystemData.java new file mode 100644 index 000000000000..8e771342e396 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricModelUpdateSystemData.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import java.time.OffsetDateTime; + +/** The FabricModelUpdateSystemData model. */ +@Fluent +public final class FabricModelUpdateSystemData extends SystemDataModel { + /** Creates an instance of FabricModelUpdateSystemData class. */ + public FabricModelUpdateSystemData() { + } + + /** {@inheritDoc} */ + @Override + public FabricModelUpdateSystemData withCreatedBy(String createdBy) { + super.withCreatedBy(createdBy); + return this; + } + + /** {@inheritDoc} */ + @Override + public FabricModelUpdateSystemData withCreatedByType(String createdByType) { + super.withCreatedByType(createdByType); + return this; + } + + /** {@inheritDoc} */ + @Override + public FabricModelUpdateSystemData withCreatedAt(OffsetDateTime createdAt) { + super.withCreatedAt(createdAt); + return this; + } + + /** {@inheritDoc} */ + @Override + public FabricModelUpdateSystemData withLastModifiedBy(String lastModifiedBy) { + super.withLastModifiedBy(lastModifiedBy); + return this; + } + + /** {@inheritDoc} */ + @Override + public FabricModelUpdateSystemData withLastModifiedByType(String lastModifiedByType) { + super.withLastModifiedByType(lastModifiedByType); + return this; + } + + /** {@inheritDoc} */ + @Override + public FabricModelUpdateSystemData withLastModifiedAt(OffsetDateTime lastModifiedAt) { + super.withLastModifiedAt(lastModifiedAt); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricOperationsStatus.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricOperationsStatus.java new file mode 100644 index 000000000000..19820377d47e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FabricOperationsStatus.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of FabricOperationsStatus. */ +public interface FabricOperationsStatus { + /** + * Gets the fabric operation status. + * + *

Tracks the results of an asynchronous operation on the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param operationId The ID of an ongoing async operation. + * @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 defines the operation status along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String fabricName, String operationId, Context context); + + /** + * Gets the fabric operation status. + * + *

Tracks the results of an asynchronous operation on the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric name. + * @param operationId The ID of an ongoing async 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 defines the operation status. + */ + OperationStatus get(String resourceGroupName, String fabricName, String operationId); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Fabrics.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Fabrics.java new file mode 100644 index 000000000000..e878a377fa13 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Fabrics.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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 Fabrics. */ +public interface Fabrics { + /** + * Gets the fabric. + * + *

Gets the details of the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the details of the fabric along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String fabricName, Context context); + + /** + * Gets the fabric. + * + *

Gets the details of the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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 the details of the fabric. + */ + FabricModel getByResourceGroup(String resourceGroupName, String fabricName); + + /** + * Deletes the fabric. + * + *

Removes the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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. + */ + void deleteByResourceGroup(String resourceGroupName, String fabricName); + + /** + * Deletes the fabric. + * + *

Removes the fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fabricName The fabric 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. + */ + void delete(String resourceGroupName, String fabricName, Context context); + + /** + * Lists the fabrics. + * + *

Gets the list of fabrics in the given 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 the list of fabrics in the given subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists the fabrics. + * + *

Gets the list of fabrics in the given subscription. + * + * @param continuationToken Continuation token from the previous call. + * @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 list of fabrics in the given subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String continuationToken, Context context); + + /** + * Lists the fabrics. + * + *

Gets the list of fabrics in the given subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of fabrics in the given subscription and resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists the fabrics. + * + *

Gets the list of fabrics in the given subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param continuationToken Continuation token from the previous call. + * @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 list of fabrics in the given subscription and resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, String continuationToken, Context context); + + /** + * Gets the fabric. + * + *

Gets the details of the fabric. + * + * @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 the details of the fabric along with {@link Response}. + */ + FabricModel getById(String id); + + /** + * Gets the fabric. + * + *

Gets the details of the fabric. + * + * @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 the details of the fabric along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the fabric. + * + *

Removes the fabric. + * + * @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 the fabric. + * + *

Removes the fabric. + * + * @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 FabricModel resource. + * + * @param name resource name. + * @return the first stage of the new FabricModel definition. + */ + FabricModel.DefinitionStages.Blank define(String name); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FailoverProtectedItemProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FailoverProtectedItemProperties.java new file mode 100644 index 000000000000..0dd3c592240c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FailoverProtectedItemProperties.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Failover properties of the protected item. */ +@Immutable +public final class FailoverProtectedItemProperties { + /* + * Gets or sets the protected item name. + */ + @JsonProperty(value = "protectedItemName", access = JsonProperty.Access.WRITE_ONLY) + private String protectedItemName; + + /* + * Gets or sets the VM name. + */ + @JsonProperty(value = "vmName", access = JsonProperty.Access.WRITE_ONLY) + private String vmName; + + /* + * Gets or sets the test VM name. + */ + @JsonProperty(value = "testVmName", access = JsonProperty.Access.WRITE_ONLY) + private String testVmName; + + /* + * Gets or sets the recovery point Id. + */ + @JsonProperty(value = "recoveryPointId", access = JsonProperty.Access.WRITE_ONLY) + private String recoveryPointId; + + /* + * Gets or sets the recovery point time. + */ + @JsonProperty(value = "recoveryPointTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime recoveryPointTime; + + /* + * Gets or sets the network name. + */ + @JsonProperty(value = "networkName", access = JsonProperty.Access.WRITE_ONLY) + private String networkName; + + /* + * Gets or sets the network subnet. + */ + @JsonProperty(value = "subnet", access = JsonProperty.Access.WRITE_ONLY) + private String subnet; + + /** Creates an instance of FailoverProtectedItemProperties class. */ + public FailoverProtectedItemProperties() { + } + + /** + * Get the protectedItemName property: Gets or sets the protected item name. + * + * @return the protectedItemName value. + */ + public String protectedItemName() { + return this.protectedItemName; + } + + /** + * Get the vmName property: Gets or sets the VM name. + * + * @return the vmName value. + */ + public String vmName() { + return this.vmName; + } + + /** + * Get the testVmName property: Gets or sets the test VM name. + * + * @return the testVmName value. + */ + public String testVmName() { + return this.testVmName; + } + + /** + * Get the recoveryPointId property: Gets or sets the recovery point Id. + * + * @return the recoveryPointId value. + */ + public String recoveryPointId() { + return this.recoveryPointId; + } + + /** + * Get the recoveryPointTime property: Gets or sets the recovery point time. + * + * @return the recoveryPointTime value. + */ + public OffsetDateTime recoveryPointTime() { + return this.recoveryPointTime; + } + + /** + * Get the networkName property: Gets or sets the network name. + * + * @return the networkName value. + */ + public String networkName() { + return this.networkName; + } + + /** + * Get the subnet property: Gets or sets the network subnet. + * + * @return the subnet value. + */ + public String subnet() { + return this.subnet; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FailoverWorkflowModelCustomProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FailoverWorkflowModelCustomProperties.java new file mode 100644 index 000000000000..3c307d4b6aee --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/FailoverWorkflowModelCustomProperties.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Failover workflow model custom properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("FailoverWorkflowDetails") +@Immutable +public final class FailoverWorkflowModelCustomProperties extends WorkflowModelCustomProperties { + /* + * Gets or sets the failed over protected item details. + */ + @JsonProperty(value = "protectedItemDetails", access = JsonProperty.Access.WRITE_ONLY) + private List protectedItemDetails; + + /** Creates an instance of FailoverWorkflowModelCustomProperties class. */ + public FailoverWorkflowModelCustomProperties() { + } + + /** + * Get the protectedItemDetails property: Gets or sets the failed over protected item details. + * + * @return the protectedItemDetails value. + */ + public List protectedItemDetails() { + return this.protectedItemDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (protectedItemDetails() != null) { + protectedItemDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HealthErrorModel.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HealthErrorModel.java new file mode 100644 index 000000000000..dfe2eb01dbb3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HealthErrorModel.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Health error model. */ +@Fluent +public final class HealthErrorModel { + /* + * Gets or sets the type of affected resource type. + */ + @JsonProperty(value = "affectedResourceType") + private String affectedResourceType; + + /* + * Gets or sets the list of affected resource correlation Ids. This can be used to + * uniquely identify the count of items affected by a specific category and severity + * as well as count of item affected by an specific issue. + */ + @JsonProperty(value = "affectedResourceCorrelationIds") + private List affectedResourceCorrelationIds; + + /* + * Gets or sets a list of child health errors associated with this error. + */ + @JsonProperty(value = "childErrors") + private List childErrors; + + /* + * Gets or sets the error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * Gets or sets the health category. + */ + @JsonProperty(value = "healthCategory", access = JsonProperty.Access.WRITE_ONLY) + private String healthCategory; + + /* + * Gets or sets the error category. + */ + @JsonProperty(value = "category", access = JsonProperty.Access.WRITE_ONLY) + private String category; + + /* + * Gets or sets the error severity. + */ + @JsonProperty(value = "severity", access = JsonProperty.Access.WRITE_ONLY) + private String severity; + + /* + * Gets or sets the error source. + */ + @JsonProperty(value = "source", access = JsonProperty.Access.WRITE_ONLY) + private String source; + + /* + * Gets or sets the error creation time. + */ + @JsonProperty(value = "creationTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationTime; + + /* + * Gets or sets a value indicating whether the error is customer resolvable. + */ + @JsonProperty(value = "isCustomerResolvable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isCustomerResolvable; + + /* + * Gets or sets the error summary. + */ + @JsonProperty(value = "summary", access = JsonProperty.Access.WRITE_ONLY) + private String summary; + + /* + * Gets or sets the error message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * Gets or sets possible causes of the error. + */ + @JsonProperty(value = "causes", access = JsonProperty.Access.WRITE_ONLY) + private String causes; + + /* + * Gets or sets recommended action to resolve the error. + */ + @JsonProperty(value = "recommendation", access = JsonProperty.Access.WRITE_ONLY) + private String recommendation; + + /** Creates an instance of HealthErrorModel class. */ + public HealthErrorModel() { + } + + /** + * Get the affectedResourceType property: Gets or sets the type of affected resource type. + * + * @return the affectedResourceType value. + */ + public String affectedResourceType() { + return this.affectedResourceType; + } + + /** + * Set the affectedResourceType property: Gets or sets the type of affected resource type. + * + * @param affectedResourceType the affectedResourceType value to set. + * @return the HealthErrorModel object itself. + */ + public HealthErrorModel withAffectedResourceType(String affectedResourceType) { + this.affectedResourceType = affectedResourceType; + return this; + } + + /** + * Get the affectedResourceCorrelationIds property: Gets or sets the list of affected resource correlation Ids. This + * can be used to uniquely identify the count of items affected by a specific category and severity as well as count + * of item affected by an specific issue. + * + * @return the affectedResourceCorrelationIds value. + */ + public List affectedResourceCorrelationIds() { + return this.affectedResourceCorrelationIds; + } + + /** + * Set the affectedResourceCorrelationIds property: Gets or sets the list of affected resource correlation Ids. This + * can be used to uniquely identify the count of items affected by a specific category and severity as well as count + * of item affected by an specific issue. + * + * @param affectedResourceCorrelationIds the affectedResourceCorrelationIds value to set. + * @return the HealthErrorModel object itself. + */ + public HealthErrorModel withAffectedResourceCorrelationIds(List affectedResourceCorrelationIds) { + this.affectedResourceCorrelationIds = affectedResourceCorrelationIds; + return this; + } + + /** + * Get the childErrors property: Gets or sets a list of child health errors associated with this error. + * + * @return the childErrors value. + */ + public List childErrors() { + return this.childErrors; + } + + /** + * Set the childErrors property: Gets or sets a list of child health errors associated with this error. + * + * @param childErrors the childErrors value to set. + * @return the HealthErrorModel object itself. + */ + public HealthErrorModel withChildErrors(List childErrors) { + this.childErrors = childErrors; + return this; + } + + /** + * Get the code property: Gets or sets the error code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the healthCategory property: Gets or sets the health category. + * + * @return the healthCategory value. + */ + public String healthCategory() { + return this.healthCategory; + } + + /** + * Get the category property: Gets or sets the error category. + * + * @return the category value. + */ + public String category() { + return this.category; + } + + /** + * Get the severity property: Gets or sets the error severity. + * + * @return the severity value. + */ + public String severity() { + return this.severity; + } + + /** + * Get the source property: Gets or sets the error source. + * + * @return the source value. + */ + public String source() { + return this.source; + } + + /** + * Get the creationTime property: Gets or sets the error creation time. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.creationTime; + } + + /** + * Get the isCustomerResolvable property: Gets or sets a value indicating whether the error is customer resolvable. + * + * @return the isCustomerResolvable value. + */ + public Boolean isCustomerResolvable() { + return this.isCustomerResolvable; + } + + /** + * Get the summary property: Gets or sets the error summary. + * + * @return the summary value. + */ + public String summary() { + return this.summary; + } + + /** + * Get the message property: Gets or sets the error message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the causes property: Gets or sets possible causes of the error. + * + * @return the causes value. + */ + public String causes() { + return this.causes; + } + + /** + * Get the recommendation property: Gets or sets recommended action to resolve the error. + * + * @return the recommendation value. + */ + public String recommendation() { + return this.recommendation; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (childErrors() != null) { + childErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HealthStatus.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HealthStatus.java new file mode 100644 index 000000000000..a98486d16863 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HealthStatus.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.recoveryservicesdatareplication.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Gets or sets the fabric health. */ +public final class HealthStatus extends ExpandableStringEnum { + /** Static value Normal for HealthStatus. */ + public static final HealthStatus NORMAL = fromString("Normal"); + + /** Static value Warning for HealthStatus. */ + public static final HealthStatus WARNING = fromString("Warning"); + + /** Static value Critical for HealthStatus. */ + public static final HealthStatus CRITICAL = fromString("Critical"); + + /** + * Creates a new instance of HealthStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HealthStatus() { + } + + /** + * Creates or finds a HealthStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding HealthStatus. + */ + @JsonCreator + public static HealthStatus fromString(String name) { + return fromString(name, HealthStatus.class); + } + + /** + * Gets known HealthStatus values. + * + * @return known HealthStatus values. + */ + public static Collection values() { + return values(HealthStatus.class); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVMigrateFabricModelCustomProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVMigrateFabricModelCustomProperties.java new file mode 100644 index 000000000000..3f32cd5c2870 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVMigrateFabricModelCustomProperties.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** HyperV migrate fabric model custom properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVMigrate") +@Fluent +public final class HyperVMigrateFabricModelCustomProperties extends FabricModelCustomProperties { + /* + * Gets or sets the ARM Id of the HyperV site. + */ + @JsonProperty(value = "hyperVSiteId", required = true) + private String hyperVSiteId; + + /* + * Gets or sets the fabric resource Id. + */ + @JsonProperty(value = "fabricResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String fabricResourceId; + + /* + * Gets or sets the fabric container Id. + */ + @JsonProperty(value = "fabricContainerId", access = JsonProperty.Access.WRITE_ONLY) + private String fabricContainerId; + + /* + * Gets or sets the migration solution ARM Id. + */ + @JsonProperty(value = "migrationSolutionId", required = true) + private String migrationSolutionId; + + /* + * Gets or sets the migration hub Uri. + */ + @JsonProperty(value = "migrationHubUri", access = JsonProperty.Access.WRITE_ONLY) + private String migrationHubUri; + + /** Creates an instance of HyperVMigrateFabricModelCustomProperties class. */ + public HyperVMigrateFabricModelCustomProperties() { + } + + /** + * Get the hyperVSiteId property: Gets or sets the ARM Id of the HyperV site. + * + * @return the hyperVSiteId value. + */ + public String hyperVSiteId() { + return this.hyperVSiteId; + } + + /** + * Set the hyperVSiteId property: Gets or sets the ARM Id of the HyperV site. + * + * @param hyperVSiteId the hyperVSiteId value to set. + * @return the HyperVMigrateFabricModelCustomProperties object itself. + */ + public HyperVMigrateFabricModelCustomProperties withHyperVSiteId(String hyperVSiteId) { + this.hyperVSiteId = hyperVSiteId; + return this; + } + + /** + * Get the fabricResourceId property: Gets or sets the fabric resource Id. + * + * @return the fabricResourceId value. + */ + public String fabricResourceId() { + return this.fabricResourceId; + } + + /** + * Get the fabricContainerId property: Gets or sets the fabric container Id. + * + * @return the fabricContainerId value. + */ + public String fabricContainerId() { + return this.fabricContainerId; + } + + /** + * Get the migrationSolutionId property: Gets or sets the migration solution ARM Id. + * + * @return the migrationSolutionId value. + */ + public String migrationSolutionId() { + return this.migrationSolutionId; + } + + /** + * Set the migrationSolutionId property: Gets or sets the migration solution ARM Id. + * + * @param migrationSolutionId the migrationSolutionId value to set. + * @return the HyperVMigrateFabricModelCustomProperties object itself. + */ + public HyperVMigrateFabricModelCustomProperties withMigrationSolutionId(String migrationSolutionId) { + this.migrationSolutionId = migrationSolutionId; + return this; + } + + /** + * Get the migrationHubUri property: Gets or sets the migration hub Uri. + * + * @return the migrationHubUri value. + */ + public String migrationHubUri() { + return this.migrationHubUri; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (hyperVSiteId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property hyperVSiteId in model HyperVMigrateFabricModelCustomProperties")); + } + if (migrationSolutionId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property migrationSolutionId in model" + + " HyperVMigrateFabricModelCustomProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HyperVMigrateFabricModelCustomProperties.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciDiskInput.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciDiskInput.java new file mode 100644 index 000000000000..0782128ae799 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciDiskInput.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** HyperVToAzStack disk input. */ +@Fluent +public final class HyperVToAzStackHciDiskInput { + /* + * Gets or sets the disk Id. + */ + @JsonProperty(value = "diskId", required = true) + private String diskId; + + /* + * Gets or sets the target storage account ARM Id. + */ + @JsonProperty(value = "storageContainerId") + private String storageContainerId; + + /* + * Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard + * disk. + */ + @JsonProperty(value = "isDynamic") + private Boolean isDynamic; + + /* + * Gets or sets the disk size in GB. + */ + @JsonProperty(value = "diskSizeGB", required = true) + private long diskSizeGB; + + /* + * Gets or sets the type of the virtual hard disk, vhd or vhdx. + */ + @JsonProperty(value = "diskFileFormat", required = true) + private String diskFileFormat; + + /* + * Gets or sets a value indicating whether disk is os disk. + */ + @JsonProperty(value = "isOsDisk", required = true) + private boolean isOsDisk; + + /** Creates an instance of HyperVToAzStackHciDiskInput class. */ + public HyperVToAzStackHciDiskInput() { + } + + /** + * Get the diskId property: Gets or sets the disk Id. + * + * @return the diskId value. + */ + public String diskId() { + return this.diskId; + } + + /** + * Set the diskId property: Gets or sets the disk Id. + * + * @param diskId the diskId value to set. + * @return the HyperVToAzStackHciDiskInput object itself. + */ + public HyperVToAzStackHciDiskInput withDiskId(String diskId) { + this.diskId = diskId; + return this; + } + + /** + * Get the storageContainerId property: Gets or sets the target storage account ARM Id. + * + * @return the storageContainerId value. + */ + public String storageContainerId() { + return this.storageContainerId; + } + + /** + * Set the storageContainerId property: Gets or sets the target storage account ARM Id. + * + * @param storageContainerId the storageContainerId value to set. + * @return the HyperVToAzStackHciDiskInput object itself. + */ + public HyperVToAzStackHciDiskInput withStorageContainerId(String storageContainerId) { + this.storageContainerId = storageContainerId; + return this; + } + + /** + * Get the isDynamic property: Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard + * disk. + * + * @return the isDynamic value. + */ + public Boolean isDynamic() { + return this.isDynamic; + } + + /** + * Set the isDynamic property: Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard + * disk. + * + * @param isDynamic the isDynamic value to set. + * @return the HyperVToAzStackHciDiskInput object itself. + */ + public HyperVToAzStackHciDiskInput withIsDynamic(Boolean isDynamic) { + this.isDynamic = isDynamic; + return this; + } + + /** + * Get the diskSizeGB property: Gets or sets the disk size in GB. + * + * @return the diskSizeGB value. + */ + public long diskSizeGB() { + return this.diskSizeGB; + } + + /** + * Set the diskSizeGB property: Gets or sets the disk size in GB. + * + * @param diskSizeGB the diskSizeGB value to set. + * @return the HyperVToAzStackHciDiskInput object itself. + */ + public HyperVToAzStackHciDiskInput withDiskSizeGB(long diskSizeGB) { + this.diskSizeGB = diskSizeGB; + return this; + } + + /** + * Get the diskFileFormat property: Gets or sets the type of the virtual hard disk, vhd or vhdx. + * + * @return the diskFileFormat value. + */ + public String diskFileFormat() { + return this.diskFileFormat; + } + + /** + * Set the diskFileFormat property: Gets or sets the type of the virtual hard disk, vhd or vhdx. + * + * @param diskFileFormat the diskFileFormat value to set. + * @return the HyperVToAzStackHciDiskInput object itself. + */ + public HyperVToAzStackHciDiskInput withDiskFileFormat(String diskFileFormat) { + this.diskFileFormat = diskFileFormat; + return this; + } + + /** + * Get the isOsDisk property: Gets or sets a value indicating whether disk is os disk. + * + * @return the isOsDisk value. + */ + public boolean isOsDisk() { + return this.isOsDisk; + } + + /** + * Set the isOsDisk property: Gets or sets a value indicating whether disk is os disk. + * + * @param isOsDisk the isOsDisk value to set. + * @return the HyperVToAzStackHciDiskInput object itself. + */ + public HyperVToAzStackHciDiskInput withIsOsDisk(boolean isOsDisk) { + this.isOsDisk = isOsDisk; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (diskId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property diskId in model HyperVToAzStackHciDiskInput")); + } + if (diskFileFormat() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property diskFileFormat in model HyperVToAzStackHciDiskInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HyperVToAzStackHciDiskInput.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciEventModelCustomProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciEventModelCustomProperties.java new file mode 100644 index 000000000000..9a56f27e75a8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciEventModelCustomProperties.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * HyperV to AzStackHCI event model custom properties. This class provides provider specific details for events of type + * DataContract.HealthEvents.HealthEventType.ProtectedItemHealth and + * DataContract.HealthEvents.HealthEventType.AgentHealth. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVToAzStackHCI") +@Immutable +public final class HyperVToAzStackHciEventModelCustomProperties extends EventModelCustomProperties { + /* + * Gets or sets the friendly name of the source which has raised this health event. + */ + @JsonProperty(value = "eventSourceFriendlyName", access = JsonProperty.Access.WRITE_ONLY) + private String eventSourceFriendlyName; + + /* + * Gets or sets the protected item friendly name. + */ + @JsonProperty(value = "protectedItemFriendlyName", access = JsonProperty.Access.WRITE_ONLY) + private String protectedItemFriendlyName; + + /* + * Gets or sets the source appliance name. + */ + @JsonProperty(value = "sourceApplianceName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceApplianceName; + + /* + * Gets or sets the source target name. + */ + @JsonProperty(value = "targetApplianceName", access = JsonProperty.Access.WRITE_ONLY) + private String targetApplianceName; + + /* + * Gets or sets the server type. + */ + @JsonProperty(value = "serverType", access = JsonProperty.Access.WRITE_ONLY) + private String serverType; + + /** Creates an instance of HyperVToAzStackHciEventModelCustomProperties class. */ + public HyperVToAzStackHciEventModelCustomProperties() { + } + + /** + * Get the eventSourceFriendlyName property: Gets or sets the friendly name of the source which has raised this + * health event. + * + * @return the eventSourceFriendlyName value. + */ + public String eventSourceFriendlyName() { + return this.eventSourceFriendlyName; + } + + /** + * Get the protectedItemFriendlyName property: Gets or sets the protected item friendly name. + * + * @return the protectedItemFriendlyName value. + */ + public String protectedItemFriendlyName() { + return this.protectedItemFriendlyName; + } + + /** + * Get the sourceApplianceName property: Gets or sets the source appliance name. + * + * @return the sourceApplianceName value. + */ + public String sourceApplianceName() { + return this.sourceApplianceName; + } + + /** + * Get the targetApplianceName property: Gets or sets the source target name. + * + * @return the targetApplianceName value. + */ + public String targetApplianceName() { + return this.targetApplianceName; + } + + /** + * Get the serverType property: Gets or sets the server type. + * + * @return the serverType value. + */ + public String serverType() { + return this.serverType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciNicInput.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciNicInput.java new file mode 100644 index 000000000000..4c7fb47c1535 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciNicInput.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** HyperVToAzStackHCI NIC properties. */ +@Fluent +public final class HyperVToAzStackHciNicInput { + /* + * Gets or sets the NIC Id. + */ + @JsonProperty(value = "nicId", required = true) + private String nicId; + + /* + * Gets or sets the network name. + */ + @JsonProperty(value = "networkName", access = JsonProperty.Access.WRITE_ONLY) + private String networkName; + + /* + * Gets or sets the target network Id within AzStackHCI Cluster. + */ + @JsonProperty(value = "targetNetworkId", required = true) + private String targetNetworkId; + + /* + * Gets or sets the target test network Id within AzStackHCI Cluster. + */ + @JsonProperty(value = "testNetworkId", required = true) + private String testNetworkId; + + /* + * Gets or sets the selection type of the NIC. + */ + @JsonProperty(value = "selectionTypeForFailover", required = true) + private VMNicSelection selectionTypeForFailover; + + /** Creates an instance of HyperVToAzStackHciNicInput class. */ + public HyperVToAzStackHciNicInput() { + } + + /** + * Get the nicId property: Gets or sets the NIC Id. + * + * @return the nicId value. + */ + public String nicId() { + return this.nicId; + } + + /** + * Set the nicId property: Gets or sets the NIC Id. + * + * @param nicId the nicId value to set. + * @return the HyperVToAzStackHciNicInput object itself. + */ + public HyperVToAzStackHciNicInput withNicId(String nicId) { + this.nicId = nicId; + return this; + } + + /** + * Get the networkName property: Gets or sets the network name. + * + * @return the networkName value. + */ + public String networkName() { + return this.networkName; + } + + /** + * Get the targetNetworkId property: Gets or sets the target network Id within AzStackHCI Cluster. + * + * @return the targetNetworkId value. + */ + public String targetNetworkId() { + return this.targetNetworkId; + } + + /** + * Set the targetNetworkId property: Gets or sets the target network Id within AzStackHCI Cluster. + * + * @param targetNetworkId the targetNetworkId value to set. + * @return the HyperVToAzStackHciNicInput object itself. + */ + public HyperVToAzStackHciNicInput withTargetNetworkId(String targetNetworkId) { + this.targetNetworkId = targetNetworkId; + return this; + } + + /** + * Get the testNetworkId property: Gets or sets the target test network Id within AzStackHCI Cluster. + * + * @return the testNetworkId value. + */ + public String testNetworkId() { + return this.testNetworkId; + } + + /** + * Set the testNetworkId property: Gets or sets the target test network Id within AzStackHCI Cluster. + * + * @param testNetworkId the testNetworkId value to set. + * @return the HyperVToAzStackHciNicInput object itself. + */ + public HyperVToAzStackHciNicInput withTestNetworkId(String testNetworkId) { + this.testNetworkId = testNetworkId; + return this; + } + + /** + * Get the selectionTypeForFailover property: Gets or sets the selection type of the NIC. + * + * @return the selectionTypeForFailover value. + */ + public VMNicSelection selectionTypeForFailover() { + return this.selectionTypeForFailover; + } + + /** + * Set the selectionTypeForFailover property: Gets or sets the selection type of the NIC. + * + * @param selectionTypeForFailover the selectionTypeForFailover value to set. + * @return the HyperVToAzStackHciNicInput object itself. + */ + public HyperVToAzStackHciNicInput withSelectionTypeForFailover(VMNicSelection selectionTypeForFailover) { + this.selectionTypeForFailover = selectionTypeForFailover; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (nicId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property nicId in model HyperVToAzStackHciNicInput")); + } + if (targetNetworkId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetNetworkId in model HyperVToAzStackHciNicInput")); + } + if (testNetworkId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property testNetworkId in model HyperVToAzStackHciNicInput")); + } + if (selectionTypeForFailover() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectionTypeForFailover in model HyperVToAzStackHciNicInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HyperVToAzStackHciNicInput.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciPlannedFailoverCustomProps.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciPlannedFailoverCustomProps.java new file mode 100644 index 000000000000..3de28db94f3a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciPlannedFailoverCustomProps.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** HyperV to AzStackHCI planned failover model custom properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVToAzStackHCI") +@Fluent +public final class HyperVToAzStackHciPlannedFailoverCustomProps extends PlannedFailoverModelCustomProperties { + /* + * Gets or sets a value indicating whether VM needs to be shut down. + */ + @JsonProperty(value = "shutdownSourceVM", required = true) + private boolean shutdownSourceVM; + + /** Creates an instance of HyperVToAzStackHciPlannedFailoverCustomProps class. */ + public HyperVToAzStackHciPlannedFailoverCustomProps() { + } + + /** + * Get the shutdownSourceVM property: Gets or sets a value indicating whether VM needs to be shut down. + * + * @return the shutdownSourceVM value. + */ + public boolean shutdownSourceVM() { + return this.shutdownSourceVM; + } + + /** + * Set the shutdownSourceVM property: Gets or sets a value indicating whether VM needs to be shut down. + * + * @param shutdownSourceVM the shutdownSourceVM value to set. + * @return the HyperVToAzStackHciPlannedFailoverCustomProps object itself. + */ + public HyperVToAzStackHciPlannedFailoverCustomProps withShutdownSourceVM(boolean shutdownSourceVM) { + this.shutdownSourceVM = shutdownSourceVM; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciPolicyModelCustomProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciPolicyModelCustomProperties.java new file mode 100644 index 000000000000..e5bbcb9e3430 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciPolicyModelCustomProperties.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** HyperV To AzStackHCI Policy model custom properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVToAzStackHCI") +@Fluent +public final class HyperVToAzStackHciPolicyModelCustomProperties extends PolicyModelCustomProperties { + /* + * Gets or sets the duration in minutes until which the recovery points need to be + * stored. + */ + @JsonProperty(value = "recoveryPointHistoryInMinutes", required = true) + private int recoveryPointHistoryInMinutes; + + /* + * Gets or sets the crash consistent snapshot frequency (in minutes). + */ + @JsonProperty(value = "crashConsistentFrequencyInMinutes", required = true) + private int crashConsistentFrequencyInMinutes; + + /* + * Gets or sets the app consistent snapshot frequency (in minutes). + */ + @JsonProperty(value = "appConsistentFrequencyInMinutes", required = true) + private int appConsistentFrequencyInMinutes; + + /** Creates an instance of HyperVToAzStackHciPolicyModelCustomProperties class. */ + public HyperVToAzStackHciPolicyModelCustomProperties() { + } + + /** + * Get the recoveryPointHistoryInMinutes property: Gets or sets the duration in minutes until which the recovery + * points need to be stored. + * + * @return the recoveryPointHistoryInMinutes value. + */ + public int recoveryPointHistoryInMinutes() { + return this.recoveryPointHistoryInMinutes; + } + + /** + * Set the recoveryPointHistoryInMinutes property: Gets or sets the duration in minutes until which the recovery + * points need to be stored. + * + * @param recoveryPointHistoryInMinutes the recoveryPointHistoryInMinutes value to set. + * @return the HyperVToAzStackHciPolicyModelCustomProperties object itself. + */ + public HyperVToAzStackHciPolicyModelCustomProperties withRecoveryPointHistoryInMinutes( + int recoveryPointHistoryInMinutes) { + this.recoveryPointHistoryInMinutes = recoveryPointHistoryInMinutes; + return this; + } + + /** + * Get the crashConsistentFrequencyInMinutes property: Gets or sets the crash consistent snapshot frequency (in + * minutes). + * + * @return the crashConsistentFrequencyInMinutes value. + */ + public int crashConsistentFrequencyInMinutes() { + return this.crashConsistentFrequencyInMinutes; + } + + /** + * Set the crashConsistentFrequencyInMinutes property: Gets or sets the crash consistent snapshot frequency (in + * minutes). + * + * @param crashConsistentFrequencyInMinutes the crashConsistentFrequencyInMinutes value to set. + * @return the HyperVToAzStackHciPolicyModelCustomProperties object itself. + */ + public HyperVToAzStackHciPolicyModelCustomProperties withCrashConsistentFrequencyInMinutes( + int crashConsistentFrequencyInMinutes) { + this.crashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + return this; + } + + /** + * Get the appConsistentFrequencyInMinutes property: Gets or sets the app consistent snapshot frequency (in + * minutes). + * + * @return the appConsistentFrequencyInMinutes value. + */ + public int appConsistentFrequencyInMinutes() { + return this.appConsistentFrequencyInMinutes; + } + + /** + * Set the appConsistentFrequencyInMinutes property: Gets or sets the app consistent snapshot frequency (in + * minutes). + * + * @param appConsistentFrequencyInMinutes the appConsistentFrequencyInMinutes value to set. + * @return the HyperVToAzStackHciPolicyModelCustomProperties object itself. + */ + public HyperVToAzStackHciPolicyModelCustomProperties withAppConsistentFrequencyInMinutes( + int appConsistentFrequencyInMinutes) { + this.appConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciProtectedDiskProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciProtectedDiskProperties.java new file mode 100644 index 000000000000..39036e157710 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciProtectedDiskProperties.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** HyperVToAzStackHCI protected disk properties. */ +@Immutable +public final class HyperVToAzStackHciProtectedDiskProperties { + /* + * Gets or sets the ARM Id of the storage container. + */ + @JsonProperty(value = "storageContainerId", access = JsonProperty.Access.WRITE_ONLY) + private String storageContainerId; + + /* + * Gets or sets the local path of the storage container. + */ + @JsonProperty(value = "storageContainerLocalPath", access = JsonProperty.Access.WRITE_ONLY) + private String storageContainerLocalPath; + + /* + * Gets or sets the source disk Id. + */ + @JsonProperty(value = "sourceDiskId", access = JsonProperty.Access.WRITE_ONLY) + private String sourceDiskId; + + /* + * Gets or sets the source disk Name. + */ + @JsonProperty(value = "sourceDiskName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceDiskName; + + /* + * Gets or sets the seed disk name. + */ + @JsonProperty(value = "seedDiskName", access = JsonProperty.Access.WRITE_ONLY) + private String seedDiskName; + + /* + * Gets or sets the test failover clone disk. + */ + @JsonProperty(value = "testMigrateDiskName", access = JsonProperty.Access.WRITE_ONLY) + private String testMigrateDiskName; + + /* + * Gets or sets the failover clone disk. + */ + @JsonProperty(value = "migrateDiskName", access = JsonProperty.Access.WRITE_ONLY) + private String migrateDiskName; + + /* + * Gets or sets a value indicating whether the disk is the OS disk. + */ + @JsonProperty(value = "isOsDisk", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isOsDisk; + + /* + * Gets or sets the disk capacity in bytes. + */ + @JsonProperty(value = "capacityInBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long capacityInBytes; + + /* + * Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard + * disk. + */ + @JsonProperty(value = "isDynamic", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDynamic; + + /* + * Gets or sets the disk type. + */ + @JsonProperty(value = "diskType", access = JsonProperty.Access.WRITE_ONLY) + private String diskType; + + /** Creates an instance of HyperVToAzStackHciProtectedDiskProperties class. */ + public HyperVToAzStackHciProtectedDiskProperties() { + } + + /** + * Get the storageContainerId property: Gets or sets the ARM Id of the storage container. + * + * @return the storageContainerId value. + */ + public String storageContainerId() { + return this.storageContainerId; + } + + /** + * Get the storageContainerLocalPath property: Gets or sets the local path of the storage container. + * + * @return the storageContainerLocalPath value. + */ + public String storageContainerLocalPath() { + return this.storageContainerLocalPath; + } + + /** + * Get the sourceDiskId property: Gets or sets the source disk Id. + * + * @return the sourceDiskId value. + */ + public String sourceDiskId() { + return this.sourceDiskId; + } + + /** + * Get the sourceDiskName property: Gets or sets the source disk Name. + * + * @return the sourceDiskName value. + */ + public String sourceDiskName() { + return this.sourceDiskName; + } + + /** + * Get the seedDiskName property: Gets or sets the seed disk name. + * + * @return the seedDiskName value. + */ + public String seedDiskName() { + return this.seedDiskName; + } + + /** + * Get the testMigrateDiskName property: Gets or sets the test failover clone disk. + * + * @return the testMigrateDiskName value. + */ + public String testMigrateDiskName() { + return this.testMigrateDiskName; + } + + /** + * Get the migrateDiskName property: Gets or sets the failover clone disk. + * + * @return the migrateDiskName value. + */ + public String migrateDiskName() { + return this.migrateDiskName; + } + + /** + * Get the isOsDisk property: Gets or sets a value indicating whether the disk is the OS disk. + * + * @return the isOsDisk value. + */ + public Boolean isOsDisk() { + return this.isOsDisk; + } + + /** + * Get the capacityInBytes property: Gets or sets the disk capacity in bytes. + * + * @return the capacityInBytes value. + */ + public Long capacityInBytes() { + return this.capacityInBytes; + } + + /** + * Get the isDynamic property: Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard + * disk. + * + * @return the isDynamic value. + */ + public Boolean isDynamic() { + return this.isDynamic; + } + + /** + * Get the diskType property: Gets or sets the disk type. + * + * @return the diskType value. + */ + public String diskType() { + return this.diskType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciProtectedItemCustomProps.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciProtectedItemCustomProps.java new file mode 100644 index 000000000000..3b3287d217c9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciProtectedItemCustomProps.java @@ -0,0 +1,931 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** HyperV to AzStackHCI Protected item model custom properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVToAzStackHCI") +@Fluent +public final class HyperVToAzStackHciProtectedItemCustomProps extends ProtectedItemModelCustomProperties { + /* + * Gets or sets the location of the protected item. + */ + @JsonProperty(value = "activeLocation", access = JsonProperty.Access.WRITE_ONLY) + private ProtectedItemActiveLocation activeLocation; + + /* + * Gets or sets the Target HCI Cluster ARM Id. + */ + @JsonProperty(value = "targetHciClusterId", required = true) + private String targetHciClusterId; + + /* + * Gets or sets the Target Arc Cluster Custom Location ARM Id. + */ + @JsonProperty(value = "targetArcClusterCustomLocationId", required = true) + private String targetArcClusterCustomLocationId; + + /* + * Gets or sets the Target AzStackHCI cluster name. + */ + @JsonProperty(value = "targetAzStackHciClusterName", access = JsonProperty.Access.WRITE_ONLY) + private String targetAzStackHciClusterName; + + /* + * Gets or sets the ARM Id of the discovered machine. + */ + @JsonProperty(value = "fabricDiscoveryMachineId", required = true) + private String fabricDiscoveryMachineId; + + /* + * Gets or sets the list of disks to replicate. + */ + @JsonProperty(value = "disksToInclude", required = true) + private List disksToInclude; + + /* + * Gets or sets the list of VM NIC to replicate. + */ + @JsonProperty(value = "nicsToInclude", required = true) + private List nicsToInclude; + + /* + * Gets or sets the source VM display name. + */ + @JsonProperty(value = "sourceVmName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceVmName; + + /* + * Gets or sets the source VM CPU cores. + */ + @JsonProperty(value = "sourceCpuCores", access = JsonProperty.Access.WRITE_ONLY) + private Integer sourceCpuCores; + + /* + * Gets or sets the source VM ram memory size in megabytes. + */ + @JsonProperty(value = "sourceMemoryInMegaBytes", access = JsonProperty.Access.WRITE_ONLY) + private Double sourceMemoryInMegaBytes; + + /* + * Gets or sets the target VM display name. + */ + @JsonProperty(value = "targetVmName") + private String targetVmName; + + /* + * Gets or sets the target resource group ARM Id. + */ + @JsonProperty(value = "targetResourceGroupId", required = true) + private String targetResourceGroupId; + + /* + * Gets or sets the target storage container ARM Id. + */ + @JsonProperty(value = "storageContainerId", required = true) + private String storageContainerId; + + /* + * Gets or sets the hypervisor generation of the virtual machine. + */ + @JsonProperty(value = "hyperVGeneration", required = true) + private String hyperVGeneration; + + /* + * Gets or sets the target network Id within AzStackHCI Cluster. + */ + @JsonProperty(value = "targetNetworkId") + private String targetNetworkId; + + /* + * Gets or sets the target test network Id within AzStackHCI Cluster. + */ + @JsonProperty(value = "testNetworkId") + private String testNetworkId; + + /* + * Gets or sets the target CPU cores. + */ + @JsonProperty(value = "targetCpuCores") + private Integer targetCpuCores; + + /* + * Gets or sets a value indicating whether memory is dynamical. + */ + @JsonProperty(value = "isDynamicRam") + private Boolean isDynamicRam; + + /* + * Protected item dynamic memory config. + */ + @JsonProperty(value = "dynamicMemoryConfig") + private ProtectedItemDynamicMemoryConfig dynamicMemoryConfig; + + /* + * Gets or sets the target memory in mega-bytes. + */ + @JsonProperty(value = "targetMemoryInMegaBytes") + private Integer targetMemoryInMegaBytes; + + /* + * Gets or sets the Run As account Id. + */ + @JsonProperty(value = "runAsAccountId", required = true) + private String runAsAccountId; + + /* + * Gets or sets the source DRA name. + */ + @JsonProperty(value = "sourceDraName", required = true) + private String sourceDraName; + + /* + * Gets or sets the target DRA name. + */ + @JsonProperty(value = "targetDraName", required = true) + private String targetDraName; + + /* + * Gets or sets the source appliance name. + */ + @JsonProperty(value = "sourceApplianceName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceApplianceName; + + /* + * Gets or sets the target appliance name. + */ + @JsonProperty(value = "targetApplianceName", access = JsonProperty.Access.WRITE_ONLY) + private String targetApplianceName; + + /* + * Gets or sets the type of the OS. + */ + @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY) + private String osType; + + /* + * Gets or sets the name of the OS. + */ + @JsonProperty(value = "osName", access = JsonProperty.Access.WRITE_ONLY) + private String osName; + + /* + * Gets or sets the firmware type. + */ + @JsonProperty(value = "firmwareType", access = JsonProperty.Access.WRITE_ONLY) + private String firmwareType; + + /* + * Gets or sets the target location. + */ + @JsonProperty(value = "targetLocation", access = JsonProperty.Access.WRITE_ONLY) + private String targetLocation; + + /* + * Gets or sets the location of Azure Arc HCI custom location resource. + */ + @JsonProperty(value = "customLocationRegion", required = true) + private String customLocationRegion; + + /* + * Gets or sets the recovery point Id to which the VM was failed over. + */ + @JsonProperty(value = "failoverRecoveryPointId", access = JsonProperty.Access.WRITE_ONLY) + private String failoverRecoveryPointId; + + /* + * Gets or sets the last recovery point received time. + */ + @JsonProperty(value = "lastRecoveryPointReceived", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastRecoveryPointReceived; + + /* + * Gets or sets the last recovery point Id. + */ + @JsonProperty(value = "lastRecoveryPointId", access = JsonProperty.Access.WRITE_ONLY) + private String lastRecoveryPointId; + + /* + * Gets or sets the initial replication progress percentage. This is calculated based on + * total bytes processed for all disks in the source VM. + */ + @JsonProperty(value = "initialReplicationProgressPercentage", access = JsonProperty.Access.WRITE_ONLY) + private Integer initialReplicationProgressPercentage; + + /* + * Gets or sets the resync progress percentage. This is calculated based on total bytes + * processed for all disks in the source VM. + */ + @JsonProperty(value = "resyncProgressPercentage", access = JsonProperty.Access.WRITE_ONLY) + private Integer resyncProgressPercentage; + + /* + * Gets or sets the list of protected disks. + */ + @JsonProperty(value = "protectedDisks", access = JsonProperty.Access.WRITE_ONLY) + private List protectedDisks; + + /* + * Gets or sets the VM NIC details. + */ + @JsonProperty(value = "protectedNics", access = JsonProperty.Access.WRITE_ONLY) + private List protectedNics; + + /* + * Gets or sets the BIOS Id of the target AzStackHCI VM. + */ + @JsonProperty(value = "targetVmBiosId", access = JsonProperty.Access.WRITE_ONLY) + private String targetVmBiosId; + + /* + * Gets or sets the latest timestamp that replication status is updated. + */ + @JsonProperty(value = "lastReplicationUpdateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastReplicationUpdateTime; + + /** Creates an instance of HyperVToAzStackHciProtectedItemCustomProps class. */ + public HyperVToAzStackHciProtectedItemCustomProps() { + } + + /** + * Get the activeLocation property: Gets or sets the location of the protected item. + * + * @return the activeLocation value. + */ + public ProtectedItemActiveLocation activeLocation() { + return this.activeLocation; + } + + /** + * Get the targetHciClusterId property: Gets or sets the Target HCI Cluster ARM Id. + * + * @return the targetHciClusterId value. + */ + public String targetHciClusterId() { + return this.targetHciClusterId; + } + + /** + * Set the targetHciClusterId property: Gets or sets the Target HCI Cluster ARM Id. + * + * @param targetHciClusterId the targetHciClusterId value to set. + * @return the HyperVToAzStackHciProtectedItemCustomProps object itself. + */ + public HyperVToAzStackHciProtectedItemCustomProps withTargetHciClusterId(String targetHciClusterId) { + this.targetHciClusterId = targetHciClusterId; + return this; + } + + /** + * Get the targetArcClusterCustomLocationId property: Gets or sets the Target Arc Cluster Custom Location ARM Id. + * + * @return the targetArcClusterCustomLocationId value. + */ + public String targetArcClusterCustomLocationId() { + return this.targetArcClusterCustomLocationId; + } + + /** + * Set the targetArcClusterCustomLocationId property: Gets or sets the Target Arc Cluster Custom Location ARM Id. + * + * @param targetArcClusterCustomLocationId the targetArcClusterCustomLocationId value to set. + * @return the HyperVToAzStackHciProtectedItemCustomProps object itself. + */ + public HyperVToAzStackHciProtectedItemCustomProps withTargetArcClusterCustomLocationId( + String targetArcClusterCustomLocationId) { + this.targetArcClusterCustomLocationId = targetArcClusterCustomLocationId; + return this; + } + + /** + * Get the targetAzStackHciClusterName property: Gets or sets the Target AzStackHCI cluster name. + * + * @return the targetAzStackHciClusterName value. + */ + public String targetAzStackHciClusterName() { + return this.targetAzStackHciClusterName; + } + + /** + * Get the fabricDiscoveryMachineId property: Gets or sets the ARM Id of the discovered machine. + * + * @return the fabricDiscoveryMachineId value. + */ + public String fabricDiscoveryMachineId() { + return this.fabricDiscoveryMachineId; + } + + /** + * Set the fabricDiscoveryMachineId property: Gets or sets the ARM Id of the discovered machine. + * + * @param fabricDiscoveryMachineId the fabricDiscoveryMachineId value to set. + * @return the HyperVToAzStackHciProtectedItemCustomProps object itself. + */ + public HyperVToAzStackHciProtectedItemCustomProps withFabricDiscoveryMachineId(String fabricDiscoveryMachineId) { + this.fabricDiscoveryMachineId = fabricDiscoveryMachineId; + return this; + } + + /** + * Get the disksToInclude property: Gets or sets the list of disks to replicate. + * + * @return the disksToInclude value. + */ + public List disksToInclude() { + return this.disksToInclude; + } + + /** + * Set the disksToInclude property: Gets or sets the list of disks to replicate. + * + * @param disksToInclude the disksToInclude value to set. + * @return the HyperVToAzStackHciProtectedItemCustomProps object itself. + */ + public HyperVToAzStackHciProtectedItemCustomProps withDisksToInclude( + List disksToInclude) { + this.disksToInclude = disksToInclude; + return this; + } + + /** + * Get the nicsToInclude property: Gets or sets the list of VM NIC to replicate. + * + * @return the nicsToInclude value. + */ + public List nicsToInclude() { + return this.nicsToInclude; + } + + /** + * Set the nicsToInclude property: Gets or sets the list of VM NIC to replicate. + * + * @param nicsToInclude the nicsToInclude value to set. + * @return the HyperVToAzStackHciProtectedItemCustomProps object itself. + */ + public HyperVToAzStackHciProtectedItemCustomProps withNicsToInclude( + List nicsToInclude) { + this.nicsToInclude = nicsToInclude; + return this; + } + + /** + * Get the sourceVmName property: Gets or sets the source VM display name. + * + * @return the sourceVmName value. + */ + public String sourceVmName() { + return this.sourceVmName; + } + + /** + * Get the sourceCpuCores property: Gets or sets the source VM CPU cores. + * + * @return the sourceCpuCores value. + */ + public Integer sourceCpuCores() { + return this.sourceCpuCores; + } + + /** + * Get the sourceMemoryInMegaBytes property: Gets or sets the source VM ram memory size in megabytes. + * + * @return the sourceMemoryInMegaBytes value. + */ + public Double sourceMemoryInMegaBytes() { + return this.sourceMemoryInMegaBytes; + } + + /** + * Get the targetVmName property: Gets or sets the target VM display name. + * + * @return the targetVmName value. + */ + public String targetVmName() { + return this.targetVmName; + } + + /** + * Set the targetVmName property: Gets or sets the target VM display name. + * + * @param targetVmName the targetVmName value to set. + * @return the HyperVToAzStackHciProtectedItemCustomProps object itself. + */ + public HyperVToAzStackHciProtectedItemCustomProps withTargetVmName(String targetVmName) { + this.targetVmName = targetVmName; + return this; + } + + /** + * Get the targetResourceGroupId property: Gets or sets the target resource group ARM Id. + * + * @return the targetResourceGroupId value. + */ + public String targetResourceGroupId() { + return this.targetResourceGroupId; + } + + /** + * Set the targetResourceGroupId property: Gets or sets the target resource group ARM Id. + * + * @param targetResourceGroupId the targetResourceGroupId value to set. + * @return the HyperVToAzStackHciProtectedItemCustomProps object itself. + */ + public HyperVToAzStackHciProtectedItemCustomProps withTargetResourceGroupId(String targetResourceGroupId) { + this.targetResourceGroupId = targetResourceGroupId; + return this; + } + + /** + * Get the storageContainerId property: Gets or sets the target storage container ARM Id. + * + * @return the storageContainerId value. + */ + public String storageContainerId() { + return this.storageContainerId; + } + + /** + * Set the storageContainerId property: Gets or sets the target storage container ARM Id. + * + * @param storageContainerId the storageContainerId value to set. + * @return the HyperVToAzStackHciProtectedItemCustomProps object itself. + */ + public HyperVToAzStackHciProtectedItemCustomProps withStorageContainerId(String storageContainerId) { + this.storageContainerId = storageContainerId; + return this; + } + + /** + * Get the hyperVGeneration property: Gets or sets the hypervisor generation of the virtual machine. + * + * @return the hyperVGeneration value. + */ + public String hyperVGeneration() { + return this.hyperVGeneration; + } + + /** + * Set the hyperVGeneration property: Gets or sets the hypervisor generation of the virtual machine. + * + * @param hyperVGeneration the hyperVGeneration value to set. + * @return the HyperVToAzStackHciProtectedItemCustomProps object itself. + */ + public HyperVToAzStackHciProtectedItemCustomProps withHyperVGeneration(String hyperVGeneration) { + this.hyperVGeneration = hyperVGeneration; + return this; + } + + /** + * Get the targetNetworkId property: Gets or sets the target network Id within AzStackHCI Cluster. + * + * @return the targetNetworkId value. + */ + public String targetNetworkId() { + return this.targetNetworkId; + } + + /** + * Set the targetNetworkId property: Gets or sets the target network Id within AzStackHCI Cluster. + * + * @param targetNetworkId the targetNetworkId value to set. + * @return the HyperVToAzStackHciProtectedItemCustomProps object itself. + */ + public HyperVToAzStackHciProtectedItemCustomProps withTargetNetworkId(String targetNetworkId) { + this.targetNetworkId = targetNetworkId; + return this; + } + + /** + * Get the testNetworkId property: Gets or sets the target test network Id within AzStackHCI Cluster. + * + * @return the testNetworkId value. + */ + public String testNetworkId() { + return this.testNetworkId; + } + + /** + * Set the testNetworkId property: Gets or sets the target test network Id within AzStackHCI Cluster. + * + * @param testNetworkId the testNetworkId value to set. + * @return the HyperVToAzStackHciProtectedItemCustomProps object itself. + */ + public HyperVToAzStackHciProtectedItemCustomProps withTestNetworkId(String testNetworkId) { + this.testNetworkId = testNetworkId; + return this; + } + + /** + * Get the targetCpuCores property: Gets or sets the target CPU cores. + * + * @return the targetCpuCores value. + */ + public Integer targetCpuCores() { + return this.targetCpuCores; + } + + /** + * Set the targetCpuCores property: Gets or sets the target CPU cores. + * + * @param targetCpuCores the targetCpuCores value to set. + * @return the HyperVToAzStackHciProtectedItemCustomProps object itself. + */ + public HyperVToAzStackHciProtectedItemCustomProps withTargetCpuCores(Integer targetCpuCores) { + this.targetCpuCores = targetCpuCores; + return this; + } + + /** + * Get the isDynamicRam property: Gets or sets a value indicating whether memory is dynamical. + * + * @return the isDynamicRam value. + */ + public Boolean isDynamicRam() { + return this.isDynamicRam; + } + + /** + * Set the isDynamicRam property: Gets or sets a value indicating whether memory is dynamical. + * + * @param isDynamicRam the isDynamicRam value to set. + * @return the HyperVToAzStackHciProtectedItemCustomProps object itself. + */ + public HyperVToAzStackHciProtectedItemCustomProps withIsDynamicRam(Boolean isDynamicRam) { + this.isDynamicRam = isDynamicRam; + return this; + } + + /** + * Get the dynamicMemoryConfig property: Protected item dynamic memory config. + * + * @return the dynamicMemoryConfig value. + */ + public ProtectedItemDynamicMemoryConfig dynamicMemoryConfig() { + return this.dynamicMemoryConfig; + } + + /** + * Set the dynamicMemoryConfig property: Protected item dynamic memory config. + * + * @param dynamicMemoryConfig the dynamicMemoryConfig value to set. + * @return the HyperVToAzStackHciProtectedItemCustomProps object itself. + */ + public HyperVToAzStackHciProtectedItemCustomProps withDynamicMemoryConfig( + ProtectedItemDynamicMemoryConfig dynamicMemoryConfig) { + this.dynamicMemoryConfig = dynamicMemoryConfig; + return this; + } + + /** + * Get the targetMemoryInMegaBytes property: Gets or sets the target memory in mega-bytes. + * + * @return the targetMemoryInMegaBytes value. + */ + public Integer targetMemoryInMegaBytes() { + return this.targetMemoryInMegaBytes; + } + + /** + * Set the targetMemoryInMegaBytes property: Gets or sets the target memory in mega-bytes. + * + * @param targetMemoryInMegaBytes the targetMemoryInMegaBytes value to set. + * @return the HyperVToAzStackHciProtectedItemCustomProps object itself. + */ + public HyperVToAzStackHciProtectedItemCustomProps withTargetMemoryInMegaBytes(Integer targetMemoryInMegaBytes) { + this.targetMemoryInMegaBytes = targetMemoryInMegaBytes; + return this; + } + + /** + * Get the runAsAccountId property: Gets or sets the Run As account Id. + * + * @return the runAsAccountId value. + */ + public String runAsAccountId() { + return this.runAsAccountId; + } + + /** + * Set the runAsAccountId property: Gets or sets the Run As account Id. + * + * @param runAsAccountId the runAsAccountId value to set. + * @return the HyperVToAzStackHciProtectedItemCustomProps object itself. + */ + public HyperVToAzStackHciProtectedItemCustomProps withRunAsAccountId(String runAsAccountId) { + this.runAsAccountId = runAsAccountId; + return this; + } + + /** + * Get the sourceDraName property: Gets or sets the source DRA name. + * + * @return the sourceDraName value. + */ + public String sourceDraName() { + return this.sourceDraName; + } + + /** + * Set the sourceDraName property: Gets or sets the source DRA name. + * + * @param sourceDraName the sourceDraName value to set. + * @return the HyperVToAzStackHciProtectedItemCustomProps object itself. + */ + public HyperVToAzStackHciProtectedItemCustomProps withSourceDraName(String sourceDraName) { + this.sourceDraName = sourceDraName; + return this; + } + + /** + * Get the targetDraName property: Gets or sets the target DRA name. + * + * @return the targetDraName value. + */ + public String targetDraName() { + return this.targetDraName; + } + + /** + * Set the targetDraName property: Gets or sets the target DRA name. + * + * @param targetDraName the targetDraName value to set. + * @return the HyperVToAzStackHciProtectedItemCustomProps object itself. + */ + public HyperVToAzStackHciProtectedItemCustomProps withTargetDraName(String targetDraName) { + this.targetDraName = targetDraName; + return this; + } + + /** + * Get the sourceApplianceName property: Gets or sets the source appliance name. + * + * @return the sourceApplianceName value. + */ + public String sourceApplianceName() { + return this.sourceApplianceName; + } + + /** + * Get the targetApplianceName property: Gets or sets the target appliance name. + * + * @return the targetApplianceName value. + */ + public String targetApplianceName() { + return this.targetApplianceName; + } + + /** + * Get the osType property: Gets or sets the type of the OS. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Get the osName property: Gets or sets the name of the OS. + * + * @return the osName value. + */ + public String osName() { + return this.osName; + } + + /** + * Get the firmwareType property: Gets or sets the firmware type. + * + * @return the firmwareType value. + */ + public String firmwareType() { + return this.firmwareType; + } + + /** + * Get the targetLocation property: Gets or sets the target location. + * + * @return the targetLocation value. + */ + public String targetLocation() { + return this.targetLocation; + } + + /** + * Get the customLocationRegion property: Gets or sets the location of Azure Arc HCI custom location resource. + * + * @return the customLocationRegion value. + */ + public String customLocationRegion() { + return this.customLocationRegion; + } + + /** + * Set the customLocationRegion property: Gets or sets the location of Azure Arc HCI custom location resource. + * + * @param customLocationRegion the customLocationRegion value to set. + * @return the HyperVToAzStackHciProtectedItemCustomProps object itself. + */ + public HyperVToAzStackHciProtectedItemCustomProps withCustomLocationRegion(String customLocationRegion) { + this.customLocationRegion = customLocationRegion; + return this; + } + + /** + * Get the failoverRecoveryPointId property: Gets or sets the recovery point Id to which the VM was failed over. + * + * @return the failoverRecoveryPointId value. + */ + public String failoverRecoveryPointId() { + return this.failoverRecoveryPointId; + } + + /** + * Get the lastRecoveryPointReceived property: Gets or sets the last recovery point received time. + * + * @return the lastRecoveryPointReceived value. + */ + public OffsetDateTime lastRecoveryPointReceived() { + return this.lastRecoveryPointReceived; + } + + /** + * Get the lastRecoveryPointId property: Gets or sets the last recovery point Id. + * + * @return the lastRecoveryPointId value. + */ + public String lastRecoveryPointId() { + return this.lastRecoveryPointId; + } + + /** + * Get the initialReplicationProgressPercentage property: Gets or sets the initial replication progress percentage. + * This is calculated based on total bytes processed for all disks in the source VM. + * + * @return the initialReplicationProgressPercentage value. + */ + public Integer initialReplicationProgressPercentage() { + return this.initialReplicationProgressPercentage; + } + + /** + * Get the resyncProgressPercentage property: Gets or sets the resync progress percentage. This is calculated based + * on total bytes processed for all disks in the source VM. + * + * @return the resyncProgressPercentage value. + */ + public Integer resyncProgressPercentage() { + return this.resyncProgressPercentage; + } + + /** + * Get the protectedDisks property: Gets or sets the list of protected disks. + * + * @return the protectedDisks value. + */ + public List protectedDisks() { + return this.protectedDisks; + } + + /** + * Get the protectedNics property: Gets or sets the VM NIC details. + * + * @return the protectedNics value. + */ + public List protectedNics() { + return this.protectedNics; + } + + /** + * Get the targetVmBiosId property: Gets or sets the BIOS Id of the target AzStackHCI VM. + * + * @return the targetVmBiosId value. + */ + public String targetVmBiosId() { + return this.targetVmBiosId; + } + + /** + * Get the lastReplicationUpdateTime property: Gets or sets the latest timestamp that replication status is updated. + * + * @return the lastReplicationUpdateTime value. + */ + public OffsetDateTime lastReplicationUpdateTime() { + return this.lastReplicationUpdateTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (targetHciClusterId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetHciClusterId in model" + + " HyperVToAzStackHciProtectedItemCustomProps")); + } + if (targetArcClusterCustomLocationId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetArcClusterCustomLocationId in model" + + " HyperVToAzStackHciProtectedItemCustomProps")); + } + if (fabricDiscoveryMachineId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property fabricDiscoveryMachineId in model" + + " HyperVToAzStackHciProtectedItemCustomProps")); + } + if (disksToInclude() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property disksToInclude in model" + + " HyperVToAzStackHciProtectedItemCustomProps")); + } else { + disksToInclude().forEach(e -> e.validate()); + } + if (nicsToInclude() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property nicsToInclude in model HyperVToAzStackHciProtectedItemCustomProps")); + } else { + nicsToInclude().forEach(e -> e.validate()); + } + if (targetResourceGroupId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetResourceGroupId in model" + + " HyperVToAzStackHciProtectedItemCustomProps")); + } + if (storageContainerId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property storageContainerId in model" + + " HyperVToAzStackHciProtectedItemCustomProps")); + } + if (hyperVGeneration() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property hyperVGeneration in model" + + " HyperVToAzStackHciProtectedItemCustomProps")); + } + if (dynamicMemoryConfig() != null) { + dynamicMemoryConfig().validate(); + } + if (runAsAccountId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property runAsAccountId in model" + + " HyperVToAzStackHciProtectedItemCustomProps")); + } + if (sourceDraName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceDraName in model HyperVToAzStackHciProtectedItemCustomProps")); + } + if (targetDraName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetDraName in model HyperVToAzStackHciProtectedItemCustomProps")); + } + if (customLocationRegion() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property customLocationRegion in model" + + " HyperVToAzStackHciProtectedItemCustomProps")); + } + if (protectedDisks() != null) { + protectedDisks().forEach(e -> e.validate()); + } + if (protectedNics() != null) { + protectedNics().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HyperVToAzStackHciProtectedItemCustomProps.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciProtectedNicProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciProtectedNicProperties.java new file mode 100644 index 000000000000..b1edaa61d064 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciProtectedNicProperties.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** HyperVToAzStackHCI NIC properties. */ +@Immutable +public final class HyperVToAzStackHciProtectedNicProperties { + /* + * Gets or sets the NIC Id. + */ + @JsonProperty(value = "nicId", access = JsonProperty.Access.WRITE_ONLY) + private String nicId; + + /* + * Gets or sets the NIC mac address. + */ + @JsonProperty(value = "macAddress", access = JsonProperty.Access.WRITE_ONLY) + private String macAddress; + + /* + * Gets or sets the network name. + */ + @JsonProperty(value = "networkName", access = JsonProperty.Access.WRITE_ONLY) + private String networkName; + + /* + * Gets or sets the target network Id within AzStackHCI Cluster. + */ + @JsonProperty(value = "targetNetworkId", access = JsonProperty.Access.WRITE_ONLY) + private String targetNetworkId; + + /* + * Gets or sets the target test network Id within AzStackHCI Cluster. + */ + @JsonProperty(value = "testNetworkId", access = JsonProperty.Access.WRITE_ONLY) + private String testNetworkId; + + /* + * Gets or sets the selection type of the NIC. + */ + @JsonProperty(value = "selectionTypeForFailover", access = JsonProperty.Access.WRITE_ONLY) + private VMNicSelection selectionTypeForFailover; + + /** Creates an instance of HyperVToAzStackHciProtectedNicProperties class. */ + public HyperVToAzStackHciProtectedNicProperties() { + } + + /** + * Get the nicId property: Gets or sets the NIC Id. + * + * @return the nicId value. + */ + public String nicId() { + return this.nicId; + } + + /** + * Get the macAddress property: Gets or sets the NIC mac address. + * + * @return the macAddress value. + */ + public String macAddress() { + return this.macAddress; + } + + /** + * Get the networkName property: Gets or sets the network name. + * + * @return the networkName value. + */ + public String networkName() { + return this.networkName; + } + + /** + * Get the targetNetworkId property: Gets or sets the target network Id within AzStackHCI Cluster. + * + * @return the targetNetworkId value. + */ + public String targetNetworkId() { + return this.targetNetworkId; + } + + /** + * Get the testNetworkId property: Gets or sets the target test network Id within AzStackHCI Cluster. + * + * @return the testNetworkId value. + */ + public String testNetworkId() { + return this.testNetworkId; + } + + /** + * Get the selectionTypeForFailover property: Gets or sets the selection type of the NIC. + * + * @return the selectionTypeForFailover value. + */ + public VMNicSelection selectionTypeForFailover() { + return this.selectionTypeForFailover; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciRecoveryPointCustomProps.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciRecoveryPointCustomProps.java new file mode 100644 index 000000000000..5cfcb0c8d124 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciRecoveryPointCustomProps.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** HyperV to AzStackHCI recovery point model custom properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVToAzStackHCI") +@Immutable +public final class HyperVToAzStackHciRecoveryPointCustomProps extends RecoveryPointModelCustomProperties { + /* + * Gets or sets the list of the disk Ids. + */ + @JsonProperty(value = "diskIds", access = JsonProperty.Access.WRITE_ONLY) + private List diskIds; + + /** Creates an instance of HyperVToAzStackHciRecoveryPointCustomProps class. */ + public HyperVToAzStackHciRecoveryPointCustomProps() { + } + + /** + * Get the diskIds property: Gets or sets the list of the disk Ids. + * + * @return the diskIds value. + */ + public List diskIds() { + return this.diskIds; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciRepExtnCustomProps.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciRepExtnCustomProps.java new file mode 100644 index 000000000000..a7230a17b3fd --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/HyperVToAzStackHciRepExtnCustomProps.java @@ -0,0 +1,330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** HyperV to AzStackHCI Replication extension model custom properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("HyperVToAzStackHCI") +@Fluent +public final class HyperVToAzStackHciRepExtnCustomProps extends ReplicationExtensionModelCustomProperties { + /* + * Gets or sets the ARM Id of the source HyperV fabric. + */ + @JsonProperty(value = "hyperVFabricArmId", required = true) + private String hyperVFabricArmId; + + /* + * Gets or sets the ARM Id of the HyperV site. + */ + @JsonProperty(value = "hyperVSiteId", access = JsonProperty.Access.WRITE_ONLY) + private String hyperVSiteId; + + /* + * Gets or sets the ARM Id of the target AzStackHCI fabric. + */ + @JsonProperty(value = "azStackHciFabricArmId", required = true) + private String azStackHciFabricArmId; + + /* + * Gets or sets the ARM Id of the AzStackHCI site. + */ + @JsonProperty(value = "azStackHciSiteId", access = JsonProperty.Access.WRITE_ONLY) + private String azStackHciSiteId; + + /* + * Gets or sets the storage account Id. + */ + @JsonProperty(value = "storageAccountId") + private String storageAccountId; + + /* + * Gets or sets the Sas Secret of storage account. + */ + @JsonProperty(value = "storageAccountSasSecretName") + private String storageAccountSasSecretName; + + /* + * Gets or sets the Uri of ASR. + */ + @JsonProperty(value = "asrServiceUri", access = JsonProperty.Access.WRITE_ONLY) + private String asrServiceUri; + + /* + * Gets or sets the Uri of Rcm. + */ + @JsonProperty(value = "rcmServiceUri", access = JsonProperty.Access.WRITE_ONLY) + private String rcmServiceUri; + + /* + * Gets or sets the Uri of Gateway. + */ + @JsonProperty(value = "gatewayServiceUri", access = JsonProperty.Access.WRITE_ONLY) + private String gatewayServiceUri; + + /* + * Gets or sets the gateway service Id of source. + */ + @JsonProperty(value = "sourceGatewayServiceId", access = JsonProperty.Access.WRITE_ONLY) + private String sourceGatewayServiceId; + + /* + * Gets or sets the gateway service Id of target. + */ + @JsonProperty(value = "targetGatewayServiceId", access = JsonProperty.Access.WRITE_ONLY) + private String targetGatewayServiceId; + + /* + * Gets or sets the source storage container name. + */ + @JsonProperty(value = "sourceStorageContainerName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceStorageContainerName; + + /* + * Gets or sets the target storage container name. + */ + @JsonProperty(value = "targetStorageContainerName", access = JsonProperty.Access.WRITE_ONLY) + private String targetStorageContainerName; + + /* + * Gets or sets the resource location. + */ + @JsonProperty(value = "resourceLocation", access = JsonProperty.Access.WRITE_ONLY) + private String resourceLocation; + + /* + * Gets or sets the subscription. + */ + @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) + private String subscriptionId; + + /* + * Gets or sets the resource group. + */ + @JsonProperty(value = "resourceGroup", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGroup; + + /** Creates an instance of HyperVToAzStackHciRepExtnCustomProps class. */ + public HyperVToAzStackHciRepExtnCustomProps() { + } + + /** + * Get the hyperVFabricArmId property: Gets or sets the ARM Id of the source HyperV fabric. + * + * @return the hyperVFabricArmId value. + */ + public String hyperVFabricArmId() { + return this.hyperVFabricArmId; + } + + /** + * Set the hyperVFabricArmId property: Gets or sets the ARM Id of the source HyperV fabric. + * + * @param hyperVFabricArmId the hyperVFabricArmId value to set. + * @return the HyperVToAzStackHciRepExtnCustomProps object itself. + */ + public HyperVToAzStackHciRepExtnCustomProps withHyperVFabricArmId(String hyperVFabricArmId) { + this.hyperVFabricArmId = hyperVFabricArmId; + return this; + } + + /** + * Get the hyperVSiteId property: Gets or sets the ARM Id of the HyperV site. + * + * @return the hyperVSiteId value. + */ + public String hyperVSiteId() { + return this.hyperVSiteId; + } + + /** + * Get the azStackHciFabricArmId property: Gets or sets the ARM Id of the target AzStackHCI fabric. + * + * @return the azStackHciFabricArmId value. + */ + public String azStackHciFabricArmId() { + return this.azStackHciFabricArmId; + } + + /** + * Set the azStackHciFabricArmId property: Gets or sets the ARM Id of the target AzStackHCI fabric. + * + * @param azStackHciFabricArmId the azStackHciFabricArmId value to set. + * @return the HyperVToAzStackHciRepExtnCustomProps object itself. + */ + public HyperVToAzStackHciRepExtnCustomProps withAzStackHciFabricArmId(String azStackHciFabricArmId) { + this.azStackHciFabricArmId = azStackHciFabricArmId; + return this; + } + + /** + * Get the azStackHciSiteId property: Gets or sets the ARM Id of the AzStackHCI site. + * + * @return the azStackHciSiteId value. + */ + public String azStackHciSiteId() { + return this.azStackHciSiteId; + } + + /** + * Get the storageAccountId property: Gets or sets the storage account Id. + * + * @return the storageAccountId value. + */ + public String storageAccountId() { + return this.storageAccountId; + } + + /** + * Set the storageAccountId property: Gets or sets the storage account Id. + * + * @param storageAccountId the storageAccountId value to set. + * @return the HyperVToAzStackHciRepExtnCustomProps object itself. + */ + public HyperVToAzStackHciRepExtnCustomProps withStorageAccountId(String storageAccountId) { + this.storageAccountId = storageAccountId; + return this; + } + + /** + * Get the storageAccountSasSecretName property: Gets or sets the Sas Secret of storage account. + * + * @return the storageAccountSasSecretName value. + */ + public String storageAccountSasSecretName() { + return this.storageAccountSasSecretName; + } + + /** + * Set the storageAccountSasSecretName property: Gets or sets the Sas Secret of storage account. + * + * @param storageAccountSasSecretName the storageAccountSasSecretName value to set. + * @return the HyperVToAzStackHciRepExtnCustomProps object itself. + */ + public HyperVToAzStackHciRepExtnCustomProps withStorageAccountSasSecretName(String storageAccountSasSecretName) { + this.storageAccountSasSecretName = storageAccountSasSecretName; + return this; + } + + /** + * Get the asrServiceUri property: Gets or sets the Uri of ASR. + * + * @return the asrServiceUri value. + */ + public String asrServiceUri() { + return this.asrServiceUri; + } + + /** + * Get the rcmServiceUri property: Gets or sets the Uri of Rcm. + * + * @return the rcmServiceUri value. + */ + public String rcmServiceUri() { + return this.rcmServiceUri; + } + + /** + * Get the gatewayServiceUri property: Gets or sets the Uri of Gateway. + * + * @return the gatewayServiceUri value. + */ + public String gatewayServiceUri() { + return this.gatewayServiceUri; + } + + /** + * Get the sourceGatewayServiceId property: Gets or sets the gateway service Id of source. + * + * @return the sourceGatewayServiceId value. + */ + public String sourceGatewayServiceId() { + return this.sourceGatewayServiceId; + } + + /** + * Get the targetGatewayServiceId property: Gets or sets the gateway service Id of target. + * + * @return the targetGatewayServiceId value. + */ + public String targetGatewayServiceId() { + return this.targetGatewayServiceId; + } + + /** + * Get the sourceStorageContainerName property: Gets or sets the source storage container name. + * + * @return the sourceStorageContainerName value. + */ + public String sourceStorageContainerName() { + return this.sourceStorageContainerName; + } + + /** + * Get the targetStorageContainerName property: Gets or sets the target storage container name. + * + * @return the targetStorageContainerName value. + */ + public String targetStorageContainerName() { + return this.targetStorageContainerName; + } + + /** + * Get the resourceLocation property: Gets or sets the resource location. + * + * @return the resourceLocation value. + */ + public String resourceLocation() { + return this.resourceLocation; + } + + /** + * Get the subscriptionId property: Gets or sets the subscription. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Get the resourceGroup property: Gets or sets the resource group. + * + * @return the resourceGroup value. + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (hyperVFabricArmId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property hyperVFabricArmId in model HyperVToAzStackHciRepExtnCustomProps")); + } + if (azStackHciFabricArmId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property azStackHciFabricArmId in model" + + " HyperVToAzStackHciRepExtnCustomProps")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HyperVToAzStackHciRepExtnCustomProps.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/IdentityModel.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/IdentityModel.java new file mode 100644 index 000000000000..747591bae770 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/IdentityModel.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Identity model. */ +@Fluent +public final class IdentityModel { + /* + * Gets or sets the tenant Id of the SPN with which Dra communicates to service. + */ + @JsonProperty(value = "tenantId", required = true) + private String tenantId; + + /* + * Gets or sets the client/application Id of the SPN with which Dra communicates to + * service. + */ + @JsonProperty(value = "applicationId", required = true) + private String applicationId; + + /* + * Gets or sets the object Id of the SPN with which Dra communicates to service. + */ + @JsonProperty(value = "objectId", required = true) + private String objectId; + + /* + * Gets or sets the audience of the SPN with which Dra communicates to service. + */ + @JsonProperty(value = "audience", required = true) + private String audience; + + /* + * Gets or sets the authority of the SPN with which Dra communicates to service. + */ + @JsonProperty(value = "aadAuthority", required = true) + private String aadAuthority; + + /** Creates an instance of IdentityModel class. */ + public IdentityModel() { + } + + /** + * Get the tenantId property: Gets or sets the tenant Id of the SPN with which Dra communicates to service. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: Gets or sets the tenant Id of the SPN with which Dra communicates to service. + * + * @param tenantId the tenantId value to set. + * @return the IdentityModel object itself. + */ + public IdentityModel withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the applicationId property: Gets or sets the client/application Id of the SPN with which Dra communicates to + * service. + * + * @return the applicationId value. + */ + public String applicationId() { + return this.applicationId; + } + + /** + * Set the applicationId property: Gets or sets the client/application Id of the SPN with which Dra communicates to + * service. + * + * @param applicationId the applicationId value to set. + * @return the IdentityModel object itself. + */ + public IdentityModel withApplicationId(String applicationId) { + this.applicationId = applicationId; + return this; + } + + /** + * Get the objectId property: Gets or sets the object Id of the SPN with which Dra communicates to service. + * + * @return the objectId value. + */ + public String objectId() { + return this.objectId; + } + + /** + * Set the objectId property: Gets or sets the object Id of the SPN with which Dra communicates to service. + * + * @param objectId the objectId value to set. + * @return the IdentityModel object itself. + */ + public IdentityModel withObjectId(String objectId) { + this.objectId = objectId; + return this; + } + + /** + * Get the audience property: Gets or sets the audience of the SPN with which Dra communicates to service. + * + * @return the audience value. + */ + public String audience() { + return this.audience; + } + + /** + * Set the audience property: Gets or sets the audience of the SPN with which Dra communicates to service. + * + * @param audience the audience value to set. + * @return the IdentityModel object itself. + */ + public IdentityModel withAudience(String audience) { + this.audience = audience; + return this; + } + + /** + * Get the aadAuthority property: Gets or sets the authority of the SPN with which Dra communicates to service. + * + * @return the aadAuthority value. + */ + public String aadAuthority() { + return this.aadAuthority; + } + + /** + * Set the aadAuthority property: Gets or sets the authority of the SPN with which Dra communicates to service. + * + * @param aadAuthority the aadAuthority value to set. + * @return the IdentityModel object itself. + */ + public IdentityModel withAadAuthority(String aadAuthority) { + this.aadAuthority = aadAuthority; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tenantId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property tenantId in model IdentityModel")); + } + if (applicationId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property applicationId in model IdentityModel")); + } + if (objectId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property objectId in model IdentityModel")); + } + if (audience() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property audience in model IdentityModel")); + } + if (aadAuthority() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property aadAuthority in model IdentityModel")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IdentityModel.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/InnerHealthErrorModel.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/InnerHealthErrorModel.java new file mode 100644 index 000000000000..a6f1ff73bf5b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/InnerHealthErrorModel.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Inner health error model. */ +@Immutable +public final class InnerHealthErrorModel { + /* + * Gets or sets the error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * Gets or sets the health category. + */ + @JsonProperty(value = "healthCategory", access = JsonProperty.Access.WRITE_ONLY) + private String healthCategory; + + /* + * Gets or sets the error category. + */ + @JsonProperty(value = "category", access = JsonProperty.Access.WRITE_ONLY) + private String category; + + /* + * Gets or sets the error severity. + */ + @JsonProperty(value = "severity", access = JsonProperty.Access.WRITE_ONLY) + private String severity; + + /* + * Gets or sets the error source. + */ + @JsonProperty(value = "source", access = JsonProperty.Access.WRITE_ONLY) + private String source; + + /* + * Gets or sets the error creation time. + */ + @JsonProperty(value = "creationTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationTime; + + /* + * Gets or sets a value indicating whether the error is customer resolvable. + */ + @JsonProperty(value = "isCustomerResolvable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isCustomerResolvable; + + /* + * Gets or sets the error summary. + */ + @JsonProperty(value = "summary", access = JsonProperty.Access.WRITE_ONLY) + private String summary; + + /* + * Gets or sets the error message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * Gets or sets possible causes of the error. + */ + @JsonProperty(value = "causes", access = JsonProperty.Access.WRITE_ONLY) + private String causes; + + /* + * Gets or sets recommended action to resolve the error. + */ + @JsonProperty(value = "recommendation", access = JsonProperty.Access.WRITE_ONLY) + private String recommendation; + + /** Creates an instance of InnerHealthErrorModel class. */ + public InnerHealthErrorModel() { + } + + /** + * Get the code property: Gets or sets the error code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the healthCategory property: Gets or sets the health category. + * + * @return the healthCategory value. + */ + public String healthCategory() { + return this.healthCategory; + } + + /** + * Get the category property: Gets or sets the error category. + * + * @return the category value. + */ + public String category() { + return this.category; + } + + /** + * Get the severity property: Gets or sets the error severity. + * + * @return the severity value. + */ + public String severity() { + return this.severity; + } + + /** + * Get the source property: Gets or sets the error source. + * + * @return the source value. + */ + public String source() { + return this.source; + } + + /** + * Get the creationTime property: Gets or sets the error creation time. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.creationTime; + } + + /** + * Get the isCustomerResolvable property: Gets or sets a value indicating whether the error is customer resolvable. + * + * @return the isCustomerResolvable value. + */ + public Boolean isCustomerResolvable() { + return this.isCustomerResolvable; + } + + /** + * Get the summary property: Gets or sets the error summary. + * + * @return the summary value. + */ + public String summary() { + return this.summary; + } + + /** + * Get the message property: Gets or sets the error message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the causes property: Gets or sets possible causes of the error. + * + * @return the causes value. + */ + public String causes() { + return this.causes; + } + + /** + * Get the recommendation property: Gets or sets recommended action to resolve the error. + * + * @return the recommendation value. + */ + public String recommendation() { + return this.recommendation; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/LastFailedEnableProtectionJob.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/LastFailedEnableProtectionJob.java new file mode 100644 index 000000000000..57c2b5c30c01 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/LastFailedEnableProtectionJob.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Immutable; + +/** The LastFailedEnableProtectionJob model. */ +@Immutable +public final class LastFailedEnableProtectionJob extends ProtectedItemJobProperties { + /** Creates an instance of LastFailedEnableProtectionJob class. */ + public LastFailedEnableProtectionJob() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/LastFailedPlannedFailoverJob.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/LastFailedPlannedFailoverJob.java new file mode 100644 index 000000000000..acb6425e0246 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/LastFailedPlannedFailoverJob.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Immutable; + +/** The LastFailedPlannedFailoverJob model. */ +@Immutable +public final class LastFailedPlannedFailoverJob extends ProtectedItemJobProperties { + /** Creates an instance of LastFailedPlannedFailoverJob class. */ + public LastFailedPlannedFailoverJob() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Operation.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Operation.java new file mode 100644 index 000000000000..e66e751996ba --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Operation.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + Origin origin(); + + /** + * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/OperationDisplay.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/OperationDisplay.java new file mode 100644 index 000000000000..d49a75641ed9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/OperationDisplay.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Localized display information for this particular operation. */ +@Immutable +public final class OperationDisplay { + /* + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft + * Compute". + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /* + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job + * Schedule Collections". + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual + * Machine", "Restart Virtual Machine". + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + + /** + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/OperationListResult.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/OperationListResult.java new file mode 100644 index 000000000000..960fdfa9c4ed --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/OperationListResult.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult { + /* + * List of operations supported by the resource provider + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of OperationListResult class. */ + public OperationListResult() { + } + + /** + * Get the value property: List of operations supported by the resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * 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/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/OperationStatus.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/OperationStatus.java new file mode 100644 index 000000000000..6b1ee3ed1bbe --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/OperationStatus.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.OperationStatusInner; + +/** An immutable client-side representation of OperationStatus. */ +public interface OperationStatus { + /** + * Gets the id property: Gets or sets the Id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Gets or sets the operation name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the status property: Gets or sets the status of the operation. ARM expects the terminal status to be one of + * Succeeded/ Failed/ Canceled. All other values imply that the operation is still running. + * + * @return the status value. + */ + String status(); + + /** + * Gets the startTime property: Gets or sets the start time. + * + * @return the startTime value. + */ + String startTime(); + + /** + * Gets the endTime property: Gets or sets the end time. + * + * @return the endTime value. + */ + String endTime(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.OperationStatusInner + * object. + * + * @return the inner object. + */ + OperationStatusInner innerModel(); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Operations.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Operations.java new file mode 100644 index 000000000000..76d047895037 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Operations.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Get a list of REST API operations supported by Microsoft.DataReplication. + * + *

Gets the operations. + * + * @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 operations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Get a list of REST API operations supported by Microsoft.DataReplication. + * + *

Gets the operations. + * + * @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 operations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Origin.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Origin.java new file mode 100644 index 000000000000..3b5277243d37 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Origin.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.recoveryservicesdatareplication.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** Static value user for Origin. */ + public static final Origin USER = fromString("user"); + + /** Static value system for Origin. */ + public static final Origin SYSTEM = fromString("system"); + + /** Static value user,system for Origin. */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + @JsonCreator + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PlannedFailoverModel.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PlannedFailoverModel.java new file mode 100644 index 000000000000..162b51450ff2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PlannedFailoverModel.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.PlannedFailoverModelInner; + +/** An immutable client-side representation of PlannedFailoverModel. */ +public interface PlannedFailoverModel { + /** + * Gets the properties property: Planned failover model properties. + * + * @return the properties value. + */ + PlannedFailoverModelProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.PlannedFailoverModelInner + * object. + * + * @return the inner object. + */ + PlannedFailoverModelInner innerModel(); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PlannedFailoverModelCustomProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PlannedFailoverModelCustomProperties.java new file mode 100644 index 000000000000..ca851df447b7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PlannedFailoverModelCustomProperties.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Planned failover model custom properties. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = PlannedFailoverModelCustomProperties.class) +@JsonTypeName("PlannedFailoverModelCustomProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "HyperVToAzStackHCI", value = HyperVToAzStackHciPlannedFailoverCustomProps.class), + @JsonSubTypes.Type(name = "VMwareToAzStackHCI", value = VMwareToAzStackHciPlannedFailoverCustomProps.class) +}) +@Immutable +public class PlannedFailoverModelCustomProperties { + /** Creates an instance of PlannedFailoverModelCustomProperties class. */ + public PlannedFailoverModelCustomProperties() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PlannedFailoverModelProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PlannedFailoverModelProperties.java new file mode 100644 index 000000000000..f6ad76413320 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PlannedFailoverModelProperties.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Planned failover model properties. */ +@Fluent +public final class PlannedFailoverModelProperties { + /* + * Planned failover model custom properties. + */ + @JsonProperty(value = "customProperties", required = true) + private PlannedFailoverModelCustomProperties customProperties; + + /** Creates an instance of PlannedFailoverModelProperties class. */ + public PlannedFailoverModelProperties() { + } + + /** + * Get the customProperties property: Planned failover model custom properties. + * + * @return the customProperties value. + */ + public PlannedFailoverModelCustomProperties customProperties() { + return this.customProperties; + } + + /** + * Set the customProperties property: Planned failover model custom properties. + * + * @param customProperties the customProperties value to set. + * @return the PlannedFailoverModelProperties object itself. + */ + public PlannedFailoverModelProperties withCustomProperties(PlannedFailoverModelCustomProperties customProperties) { + this.customProperties = customProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (customProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property customProperties in model PlannedFailoverModelProperties")); + } else { + customProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PlannedFailoverModelProperties.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Policies.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Policies.java new file mode 100644 index 000000000000..8359fb94ca04 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Policies.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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 Policies. */ +public interface Policies { + /** + * Gets the policy. + * + *

Gets the details of the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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 the details of the policy along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String vaultName, String policyName, Context context); + + /** + * Gets the policy. + * + *

Gets the details of the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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 the details of the policy. + */ + PolicyModel get(String resourceGroupName, String vaultName, String policyName); + + /** + * Deletes the policy. + * + *

Removes the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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. + */ + void delete(String resourceGroupName, String vaultName, String policyName); + + /** + * Deletes the policy. + * + *

Removes the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy 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. + */ + void delete(String resourceGroupName, String vaultName, String policyName, Context context); + + /** + * Lists the policies. + * + *

Gets the list of policies in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of policies in the given vault as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String vaultName); + + /** + * Lists the policies. + * + *

Gets the list of policies in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of policies in the given vault as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String vaultName, Context context); + + /** + * Gets the policy. + * + *

Gets the details of the policy. + * + * @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 the details of the policy along with {@link Response}. + */ + PolicyModel getById(String id); + + /** + * Gets the policy. + * + *

Gets the details of the policy. + * + * @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 the details of the policy along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the policy. + * + *

Removes the policy. + * + * @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 the policy. + * + *

Removes the policy. + * + * @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 PolicyModel resource. + * + * @param name resource name. + * @return the first stage of the new PolicyModel definition. + */ + PolicyModel.DefinitionStages.Blank define(String name); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PolicyModel.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PolicyModel.java new file mode 100644 index 000000000000..615780e69e56 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PolicyModel.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.PolicyModelInner; + +/** An immutable client-side representation of PolicyModel. */ +public interface PolicyModel { + /** + * 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 properties property: Policy model properties. + * + * @return the properties value. + */ + PolicyModelProperties properties(); + + /** + * Gets the systemData property: The systemData property. + * + * @return the systemData value. + */ + PolicyModelSystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.PolicyModelInner object. + * + * @return the inner object. + */ + PolicyModelInner innerModel(); + + /** The entirety of the PolicyModel definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + + /** The PolicyModel definition stages. */ + interface DefinitionStages { + /** The first stage of the PolicyModel definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the PolicyModel definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, vaultName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @return the next definition stage. + */ + WithProperties withExistingReplicationVault(String resourceGroupName, String vaultName); + } + + /** The stage of the PolicyModel definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Policy model properties.. + * + * @param properties Policy model properties. + * @return the next definition stage. + */ + WithCreate withProperties(PolicyModelProperties properties); + } + + /** + * The stage of the PolicyModel 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + PolicyModel create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PolicyModel create(Context context); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PolicyModel refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PolicyModel refresh(Context context); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PolicyModelCollection.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PolicyModelCollection.java new file mode 100644 index 000000000000..bef317b80366 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PolicyModelCollection.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.PolicyModelInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Policy model collection. */ +@Fluent +public final class PolicyModelCollection { + /* + * Gets or sets the list of policies. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets or sets the value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of PolicyModelCollection class. */ + public PolicyModelCollection() { + } + + /** + * Get the value property: Gets or sets the list of policies. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets the list of policies. + * + * @param value the value value to set. + * @return the PolicyModelCollection object itself. + */ + public PolicyModelCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets or sets the value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets or sets the value of next link. + * + * @param nextLink the nextLink value to set. + * @return the PolicyModelCollection object itself. + */ + public PolicyModelCollection 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/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PolicyModelCustomProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PolicyModelCustomProperties.java new file mode 100644 index 000000000000..bd0f89a43f3a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PolicyModelCustomProperties.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Policy model custom properties. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = PolicyModelCustomProperties.class) +@JsonTypeName("PolicyModelCustomProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "HyperVToAzStackHCI", value = HyperVToAzStackHciPolicyModelCustomProperties.class), + @JsonSubTypes.Type(name = "VMwareToAzStackHCI", value = VMwareToAzStackHciPolicyModelCustomProperties.class) +}) +@Immutable +public class PolicyModelCustomProperties { + /** Creates an instance of PolicyModelCustomProperties class. */ + public PolicyModelCustomProperties() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PolicyModelProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PolicyModelProperties.java new file mode 100644 index 000000000000..594d250e78a9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PolicyModelProperties.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Policy model properties. */ +@Fluent +public final class PolicyModelProperties { + /* + * Gets or sets the provisioning state of the policy. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Policy model custom properties. + */ + @JsonProperty(value = "customProperties", required = true) + private PolicyModelCustomProperties customProperties; + + /** Creates an instance of PolicyModelProperties class. */ + public PolicyModelProperties() { + } + + /** + * Get the provisioningState property: Gets or sets the provisioning state of the policy. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the customProperties property: Policy model custom properties. + * + * @return the customProperties value. + */ + public PolicyModelCustomProperties customProperties() { + return this.customProperties; + } + + /** + * Set the customProperties property: Policy model custom properties. + * + * @param customProperties the customProperties value to set. + * @return the PolicyModelProperties object itself. + */ + public PolicyModelProperties withCustomProperties(PolicyModelCustomProperties customProperties) { + this.customProperties = customProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (customProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property customProperties in model PolicyModelProperties")); + } else { + customProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PolicyModelProperties.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PolicyModelSystemData.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PolicyModelSystemData.java new file mode 100644 index 000000000000..e9cca79610e2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PolicyModelSystemData.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import java.time.OffsetDateTime; + +/** The PolicyModelSystemData model. */ +@Fluent +public final class PolicyModelSystemData extends SystemDataModel { + /** Creates an instance of PolicyModelSystemData class. */ + public PolicyModelSystemData() { + } + + /** {@inheritDoc} */ + @Override + public PolicyModelSystemData withCreatedBy(String createdBy) { + super.withCreatedBy(createdBy); + return this; + } + + /** {@inheritDoc} */ + @Override + public PolicyModelSystemData withCreatedByType(String createdByType) { + super.withCreatedByType(createdByType); + return this; + } + + /** {@inheritDoc} */ + @Override + public PolicyModelSystemData withCreatedAt(OffsetDateTime createdAt) { + super.withCreatedAt(createdAt); + return this; + } + + /** {@inheritDoc} */ + @Override + public PolicyModelSystemData withLastModifiedBy(String lastModifiedBy) { + super.withLastModifiedBy(lastModifiedBy); + return this; + } + + /** {@inheritDoc} */ + @Override + public PolicyModelSystemData withLastModifiedByType(String lastModifiedByType) { + super.withLastModifiedByType(lastModifiedByType); + return this; + } + + /** {@inheritDoc} */ + @Override + public PolicyModelSystemData withLastModifiedAt(OffsetDateTime lastModifiedAt) { + super.withLastModifiedAt(lastModifiedAt); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PolicyOperationStatus.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PolicyOperationStatus.java new file mode 100644 index 000000000000..2ca75e87b222 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/PolicyOperationStatus.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PolicyOperationStatus. */ +public interface PolicyOperationStatus { + /** + * Gets the policy operation status. + * + *

Tracks the results of an asynchronous operation on the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy name. + * @param operationId The ID of an ongoing async operation. + * @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 defines the operation status along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String vaultName, String policyName, String operationId, Context context); + + /** + * Gets the policy operation status. + * + *

Tracks the results of an asynchronous operation on the policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param policyName The policy name. + * @param operationId The ID of an ongoing async 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 defines the operation status. + */ + OperationStatus get(String resourceGroupName, String vaultName, String policyName, String operationId); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemActiveLocation.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemActiveLocation.java new file mode 100644 index 000000000000..71217ade9fea --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemActiveLocation.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.recoveryservicesdatareplication.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Gets or sets the location of the protected item. */ +public final class ProtectedItemActiveLocation extends ExpandableStringEnum { + /** Static value Primary for ProtectedItemActiveLocation. */ + public static final ProtectedItemActiveLocation PRIMARY = fromString("Primary"); + + /** Static value Recovery for ProtectedItemActiveLocation. */ + public static final ProtectedItemActiveLocation RECOVERY = fromString("Recovery"); + + /** + * Creates a new instance of ProtectedItemActiveLocation value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProtectedItemActiveLocation() { + } + + /** + * Creates or finds a ProtectedItemActiveLocation from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProtectedItemActiveLocation. + */ + @JsonCreator + public static ProtectedItemActiveLocation fromString(String name) { + return fromString(name, ProtectedItemActiveLocation.class); + } + + /** + * Gets known ProtectedItemActiveLocation values. + * + * @return known ProtectedItemActiveLocation values. + */ + public static Collection values() { + return values(ProtectedItemActiveLocation.class); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemDynamicMemoryConfig.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemDynamicMemoryConfig.java new file mode 100644 index 000000000000..c47183c24ce7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemDynamicMemoryConfig.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Protected item dynamic memory config. */ +@Fluent +public final class ProtectedItemDynamicMemoryConfig { + /* + * Gets or sets maximum memory in MB. + */ + @JsonProperty(value = "maximumMemoryInMegaBytes", required = true) + private long maximumMemoryInMegaBytes; + + /* + * Gets or sets minimum memory in MB. + */ + @JsonProperty(value = "minimumMemoryInMegaBytes", required = true) + private long minimumMemoryInMegaBytes; + + /* + * Gets or sets target memory buffer in %. + */ + @JsonProperty(value = "targetMemoryBufferPercentage", required = true) + private int targetMemoryBufferPercentage; + + /** Creates an instance of ProtectedItemDynamicMemoryConfig class. */ + public ProtectedItemDynamicMemoryConfig() { + } + + /** + * Get the maximumMemoryInMegaBytes property: Gets or sets maximum memory in MB. + * + * @return the maximumMemoryInMegaBytes value. + */ + public long maximumMemoryInMegaBytes() { + return this.maximumMemoryInMegaBytes; + } + + /** + * Set the maximumMemoryInMegaBytes property: Gets or sets maximum memory in MB. + * + * @param maximumMemoryInMegaBytes the maximumMemoryInMegaBytes value to set. + * @return the ProtectedItemDynamicMemoryConfig object itself. + */ + public ProtectedItemDynamicMemoryConfig withMaximumMemoryInMegaBytes(long maximumMemoryInMegaBytes) { + this.maximumMemoryInMegaBytes = maximumMemoryInMegaBytes; + return this; + } + + /** + * Get the minimumMemoryInMegaBytes property: Gets or sets minimum memory in MB. + * + * @return the minimumMemoryInMegaBytes value. + */ + public long minimumMemoryInMegaBytes() { + return this.minimumMemoryInMegaBytes; + } + + /** + * Set the minimumMemoryInMegaBytes property: Gets or sets minimum memory in MB. + * + * @param minimumMemoryInMegaBytes the minimumMemoryInMegaBytes value to set. + * @return the ProtectedItemDynamicMemoryConfig object itself. + */ + public ProtectedItemDynamicMemoryConfig withMinimumMemoryInMegaBytes(long minimumMemoryInMegaBytes) { + this.minimumMemoryInMegaBytes = minimumMemoryInMegaBytes; + return this; + } + + /** + * Get the targetMemoryBufferPercentage property: Gets or sets target memory buffer in %. + * + * @return the targetMemoryBufferPercentage value. + */ + public int targetMemoryBufferPercentage() { + return this.targetMemoryBufferPercentage; + } + + /** + * Set the targetMemoryBufferPercentage property: Gets or sets target memory buffer in %. + * + * @param targetMemoryBufferPercentage the targetMemoryBufferPercentage value to set. + * @return the ProtectedItemDynamicMemoryConfig object itself. + */ + public ProtectedItemDynamicMemoryConfig withTargetMemoryBufferPercentage(int targetMemoryBufferPercentage) { + this.targetMemoryBufferPercentage = targetMemoryBufferPercentage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemJobProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemJobProperties.java new file mode 100644 index 000000000000..d76912c5df8a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemJobProperties.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Protected item job properties. */ +@Immutable +public class ProtectedItemJobProperties { + /* + * Gets or sets protection scenario name. + */ + @JsonProperty(value = "scenarioName", access = JsonProperty.Access.WRITE_ONLY) + private String scenarioName; + + /* + * Gets or sets workflow Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Gets or sets workflow name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Gets or sets the workflow friendly display name. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /* + * Gets or sets workflow state. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private String state; + + /* + * Gets or sets start time of the workflow. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTime; + + /* + * Gets or sets end time of the workflow. + */ + @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endTime; + + /** Creates an instance of ProtectedItemJobProperties class. */ + public ProtectedItemJobProperties() { + } + + /** + * Get the scenarioName property: Gets or sets protection scenario name. + * + * @return the scenarioName value. + */ + public String scenarioName() { + return this.scenarioName; + } + + /** + * Get the id property: Gets or sets workflow Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Gets or sets workflow name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the displayName property: Gets or sets the workflow friendly display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the state property: Gets or sets workflow state. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Get the startTime property: Gets or sets start time of the workflow. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: Gets or sets end time of the workflow. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModel.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModel.java new file mode 100644 index 000000000000..c299cc4508fc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModel.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.PlannedFailoverModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.ProtectedItemModelInner; + +/** An immutable client-side representation of ProtectedItemModel. */ +public interface ProtectedItemModel { + /** + * 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 properties property: Protected item model properties. + * + * @return the properties value. + */ + ProtectedItemModelProperties properties(); + + /** + * Gets the systemData property: The systemData property. + * + * @return the systemData value. + */ + ProtectedItemModelSystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.ProtectedItemModelInner + * object. + * + * @return the inner object. + */ + ProtectedItemModelInner innerModel(); + + /** The entirety of the ProtectedItemModel definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + + /** The ProtectedItemModel definition stages. */ + interface DefinitionStages { + /** The first stage of the ProtectedItemModel definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the ProtectedItemModel definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, vaultName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @return the next definition stage. + */ + WithProperties withExistingReplicationVault(String resourceGroupName, String vaultName); + } + + /** The stage of the ProtectedItemModel definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Protected item model properties.. + * + * @param properties Protected item model properties. + * @return the next definition stage. + */ + WithCreate withProperties(ProtectedItemModelProperties properties); + } + + /** + * The stage of the ProtectedItemModel 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + ProtectedItemModel create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ProtectedItemModel create(Context context); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ProtectedItemModel refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ProtectedItemModel refresh(Context context); + + /** + * Performs planned failover. + * + *

Performs the planned failover on the protected item. + * + * @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 planned failover model. + */ + PlannedFailoverModel plannedFailover(); + + /** + * Performs planned failover. + * + *

Performs the planned failover on the protected item. + * + * @param body Planned failover model. + * @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 planned failover model. + */ + PlannedFailoverModel plannedFailover(PlannedFailoverModelInner body, Context context); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelCollection.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelCollection.java new file mode 100644 index 000000000000..84b116a9a04c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelCollection.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.ProtectedItemModelInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Protected item model collection. */ +@Fluent +public final class ProtectedItemModelCollection { + /* + * Gets or sets the list of protected items. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets or sets the value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ProtectedItemModelCollection class. */ + public ProtectedItemModelCollection() { + } + + /** + * Get the value property: Gets or sets the list of protected items. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets the list of protected items. + * + * @param value the value value to set. + * @return the ProtectedItemModelCollection object itself. + */ + public ProtectedItemModelCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets or sets the value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets or sets the value of next link. + * + * @param nextLink the nextLink value to set. + * @return the ProtectedItemModelCollection object itself. + */ + public ProtectedItemModelCollection 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/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelCustomProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelCustomProperties.java new file mode 100644 index 000000000000..012d1054e986 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelCustomProperties.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Protected item model custom properties. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = ProtectedItemModelCustomProperties.class) +@JsonTypeName("ProtectedItemModelCustomProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "HyperVToAzStackHCI", value = HyperVToAzStackHciProtectedItemCustomProps.class), + @JsonSubTypes.Type(name = "VMwareToAzStackHCI", value = VMwareToAzStackHciProtectedItemCustomProps.class) +}) +@Immutable +public class ProtectedItemModelCustomProperties { + /** Creates an instance of ProtectedItemModelCustomProperties class. */ + public ProtectedItemModelCustomProperties() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelProperties.java new file mode 100644 index 000000000000..63ca315996e3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelProperties.java @@ -0,0 +1,532 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Protected item model properties. */ +@Fluent +public final class ProtectedItemModelProperties { + /* + * Gets or sets the policy name. + */ + @JsonProperty(value = "policyName", required = true) + private String policyName; + + /* + * Gets or sets the replication extension name. + */ + @JsonProperty(value = "replicationExtensionName", required = true) + private String replicationExtensionName; + + /* + * Gets or sets the protected item correlation Id. + */ + @JsonProperty(value = "correlationId", access = JsonProperty.Access.WRITE_ONLY) + private String correlationId; + + /* + * Gets or sets the provisioning state of the Dra. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Gets or sets the protection state. + */ + @JsonProperty(value = "protectionState", access = JsonProperty.Access.WRITE_ONLY) + private ProtectionState protectionState; + + /* + * Gets or sets the protection state description. + */ + @JsonProperty(value = "protectionStateDescription", access = JsonProperty.Access.WRITE_ONLY) + private String protectionStateDescription; + + /* + * Gets or sets the test failover state. + */ + @JsonProperty(value = "testFailoverState", access = JsonProperty.Access.WRITE_ONLY) + private TestFailoverState testFailoverState; + + /* + * Gets or sets the Test failover state description. + */ + @JsonProperty(value = "testFailoverStateDescription", access = JsonProperty.Access.WRITE_ONLY) + private String testFailoverStateDescription; + + /* + * Gets or sets the resynchronization state. + */ + @JsonProperty(value = "resynchronizationState", access = JsonProperty.Access.WRITE_ONLY) + private ResynchronizationState resynchronizationState; + + /* + * Gets or sets the fabric object Id. + */ + @JsonProperty(value = "fabricObjectId", access = JsonProperty.Access.WRITE_ONLY) + private String fabricObjectId; + + /* + * Gets or sets the fabric object name. + */ + @JsonProperty(value = "fabricObjectName", access = JsonProperty.Access.WRITE_ONLY) + private String fabricObjectName; + + /* + * Gets or sets the source fabric provider Id. + */ + @JsonProperty(value = "sourceFabricProviderId", access = JsonProperty.Access.WRITE_ONLY) + private String sourceFabricProviderId; + + /* + * Gets or sets the target fabric provider Id. + */ + @JsonProperty(value = "targetFabricProviderId", access = JsonProperty.Access.WRITE_ONLY) + private String targetFabricProviderId; + + /* + * Gets or sets the fabric Id. + */ + @JsonProperty(value = "fabricId", access = JsonProperty.Access.WRITE_ONLY) + private String fabricId; + + /* + * Gets or sets the target fabric Id. + */ + @JsonProperty(value = "targetFabricId", access = JsonProperty.Access.WRITE_ONLY) + private String targetFabricId; + + /* + * Gets or sets the DRA Id. + */ + @JsonProperty(value = "draId", access = JsonProperty.Access.WRITE_ONLY) + private String draId; + + /* + * Gets or sets the target DRA Id. + */ + @JsonProperty(value = "targetDraId", access = JsonProperty.Access.WRITE_ONLY) + private String targetDraId; + + /* + * Gets or sets a value indicating whether resynchronization is required or not. + */ + @JsonProperty(value = "resyncRequired", access = JsonProperty.Access.WRITE_ONLY) + private Boolean resyncRequired; + + /* + * Gets or sets the Last successful planned failover time. + */ + @JsonProperty(value = "lastSuccessfulPlannedFailoverTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastSuccessfulPlannedFailoverTime; + + /* + * Gets or sets the Last successful unplanned failover time. + */ + @JsonProperty(value = "lastSuccessfulUnplannedFailoverTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastSuccessfulUnplannedFailoverTime; + + /* + * Gets or sets the Last successful test failover time. + */ + @JsonProperty(value = "lastSuccessfulTestFailoverTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastSuccessfulTestFailoverTime; + + /* + * The currentJob property. + */ + @JsonProperty(value = "currentJob", access = JsonProperty.Access.WRITE_ONLY) + private ProtectedItemModelPropertiesCurrentJob currentJob; + + /* + * Gets or sets the allowed scenarios on the protected item. + */ + @JsonProperty(value = "allowedJobs", access = JsonProperty.Access.WRITE_ONLY) + private List allowedJobs; + + /* + * The lastFailedEnableProtectionJob property. + */ + @JsonProperty(value = "lastFailedEnableProtectionJob", access = JsonProperty.Access.WRITE_ONLY) + private LastFailedEnableProtectionJob lastFailedEnableProtectionJob; + + /* + * The lastFailedPlannedFailoverJob property. + */ + @JsonProperty(value = "lastFailedPlannedFailoverJob", access = JsonProperty.Access.WRITE_ONLY) + private LastFailedPlannedFailoverJob lastFailedPlannedFailoverJob; + + /* + * The lastTestFailoverJob property. + */ + @JsonProperty(value = "lastTestFailoverJob", access = JsonProperty.Access.WRITE_ONLY) + private ProtectedItemModelPropertiesLastTestFailoverJob lastTestFailoverJob; + + /* + * Gets or sets protected item replication health. + */ + @JsonProperty(value = "replicationHealth", access = JsonProperty.Access.WRITE_ONLY) + private HealthStatus replicationHealth; + + /* + * Gets or sets the list of health errors. + */ + @JsonProperty(value = "healthErrors", access = JsonProperty.Access.WRITE_ONLY) + private List healthErrors; + + /* + * Protected item model custom properties. + */ + @JsonProperty(value = "customProperties", required = true) + private ProtectedItemModelCustomProperties customProperties; + + /** Creates an instance of ProtectedItemModelProperties class. */ + public ProtectedItemModelProperties() { + } + + /** + * Get the policyName property: Gets or sets the policy name. + * + * @return the policyName value. + */ + public String policyName() { + return this.policyName; + } + + /** + * Set the policyName property: Gets or sets the policy name. + * + * @param policyName the policyName value to set. + * @return the ProtectedItemModelProperties object itself. + */ + public ProtectedItemModelProperties withPolicyName(String policyName) { + this.policyName = policyName; + return this; + } + + /** + * Get the replicationExtensionName property: Gets or sets the replication extension name. + * + * @return the replicationExtensionName value. + */ + public String replicationExtensionName() { + return this.replicationExtensionName; + } + + /** + * Set the replicationExtensionName property: Gets or sets the replication extension name. + * + * @param replicationExtensionName the replicationExtensionName value to set. + * @return the ProtectedItemModelProperties object itself. + */ + public ProtectedItemModelProperties withReplicationExtensionName(String replicationExtensionName) { + this.replicationExtensionName = replicationExtensionName; + return this; + } + + /** + * Get the correlationId property: Gets or sets the protected item correlation Id. + * + * @return the correlationId value. + */ + public String correlationId() { + return this.correlationId; + } + + /** + * Get the provisioningState property: Gets or sets the provisioning state of the Dra. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the protectionState property: Gets or sets the protection state. + * + * @return the protectionState value. + */ + public ProtectionState protectionState() { + return this.protectionState; + } + + /** + * Get the protectionStateDescription property: Gets or sets the protection state description. + * + * @return the protectionStateDescription value. + */ + public String protectionStateDescription() { + return this.protectionStateDescription; + } + + /** + * Get the testFailoverState property: Gets or sets the test failover state. + * + * @return the testFailoverState value. + */ + public TestFailoverState testFailoverState() { + return this.testFailoverState; + } + + /** + * Get the testFailoverStateDescription property: Gets or sets the Test failover state description. + * + * @return the testFailoverStateDescription value. + */ + public String testFailoverStateDescription() { + return this.testFailoverStateDescription; + } + + /** + * Get the resynchronizationState property: Gets or sets the resynchronization state. + * + * @return the resynchronizationState value. + */ + public ResynchronizationState resynchronizationState() { + return this.resynchronizationState; + } + + /** + * Get the fabricObjectId property: Gets or sets the fabric object Id. + * + * @return the fabricObjectId value. + */ + public String fabricObjectId() { + return this.fabricObjectId; + } + + /** + * Get the fabricObjectName property: Gets or sets the fabric object name. + * + * @return the fabricObjectName value. + */ + public String fabricObjectName() { + return this.fabricObjectName; + } + + /** + * Get the sourceFabricProviderId property: Gets or sets the source fabric provider Id. + * + * @return the sourceFabricProviderId value. + */ + public String sourceFabricProviderId() { + return this.sourceFabricProviderId; + } + + /** + * Get the targetFabricProviderId property: Gets or sets the target fabric provider Id. + * + * @return the targetFabricProviderId value. + */ + public String targetFabricProviderId() { + return this.targetFabricProviderId; + } + + /** + * Get the fabricId property: Gets or sets the fabric Id. + * + * @return the fabricId value. + */ + public String fabricId() { + return this.fabricId; + } + + /** + * Get the targetFabricId property: Gets or sets the target fabric Id. + * + * @return the targetFabricId value. + */ + public String targetFabricId() { + return this.targetFabricId; + } + + /** + * Get the draId property: Gets or sets the DRA Id. + * + * @return the draId value. + */ + public String draId() { + return this.draId; + } + + /** + * Get the targetDraId property: Gets or sets the target DRA Id. + * + * @return the targetDraId value. + */ + public String targetDraId() { + return this.targetDraId; + } + + /** + * Get the resyncRequired property: Gets or sets a value indicating whether resynchronization is required or not. + * + * @return the resyncRequired value. + */ + public Boolean resyncRequired() { + return this.resyncRequired; + } + + /** + * Get the lastSuccessfulPlannedFailoverTime property: Gets or sets the Last successful planned failover time. + * + * @return the lastSuccessfulPlannedFailoverTime value. + */ + public OffsetDateTime lastSuccessfulPlannedFailoverTime() { + return this.lastSuccessfulPlannedFailoverTime; + } + + /** + * Get the lastSuccessfulUnplannedFailoverTime property: Gets or sets the Last successful unplanned failover time. + * + * @return the lastSuccessfulUnplannedFailoverTime value. + */ + public OffsetDateTime lastSuccessfulUnplannedFailoverTime() { + return this.lastSuccessfulUnplannedFailoverTime; + } + + /** + * Get the lastSuccessfulTestFailoverTime property: Gets or sets the Last successful test failover time. + * + * @return the lastSuccessfulTestFailoverTime value. + */ + public OffsetDateTime lastSuccessfulTestFailoverTime() { + return this.lastSuccessfulTestFailoverTime; + } + + /** + * Get the currentJob property: The currentJob property. + * + * @return the currentJob value. + */ + public ProtectedItemModelPropertiesCurrentJob currentJob() { + return this.currentJob; + } + + /** + * Get the allowedJobs property: Gets or sets the allowed scenarios on the protected item. + * + * @return the allowedJobs value. + */ + public List allowedJobs() { + return this.allowedJobs; + } + + /** + * Get the lastFailedEnableProtectionJob property: The lastFailedEnableProtectionJob property. + * + * @return the lastFailedEnableProtectionJob value. + */ + public LastFailedEnableProtectionJob lastFailedEnableProtectionJob() { + return this.lastFailedEnableProtectionJob; + } + + /** + * Get the lastFailedPlannedFailoverJob property: The lastFailedPlannedFailoverJob property. + * + * @return the lastFailedPlannedFailoverJob value. + */ + public LastFailedPlannedFailoverJob lastFailedPlannedFailoverJob() { + return this.lastFailedPlannedFailoverJob; + } + + /** + * Get the lastTestFailoverJob property: The lastTestFailoverJob property. + * + * @return the lastTestFailoverJob value. + */ + public ProtectedItemModelPropertiesLastTestFailoverJob lastTestFailoverJob() { + return this.lastTestFailoverJob; + } + + /** + * Get the replicationHealth property: Gets or sets protected item replication health. + * + * @return the replicationHealth value. + */ + public HealthStatus replicationHealth() { + return this.replicationHealth; + } + + /** + * Get the healthErrors property: Gets or sets the list of health errors. + * + * @return the healthErrors value. + */ + public List healthErrors() { + return this.healthErrors; + } + + /** + * Get the customProperties property: Protected item model custom properties. + * + * @return the customProperties value. + */ + public ProtectedItemModelCustomProperties customProperties() { + return this.customProperties; + } + + /** + * Set the customProperties property: Protected item model custom properties. + * + * @param customProperties the customProperties value to set. + * @return the ProtectedItemModelProperties object itself. + */ + public ProtectedItemModelProperties withCustomProperties(ProtectedItemModelCustomProperties customProperties) { + this.customProperties = customProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (policyName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property policyName in model ProtectedItemModelProperties")); + } + if (replicationExtensionName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property replicationExtensionName in model ProtectedItemModelProperties")); + } + if (currentJob() != null) { + currentJob().validate(); + } + if (lastFailedEnableProtectionJob() != null) { + lastFailedEnableProtectionJob().validate(); + } + if (lastFailedPlannedFailoverJob() != null) { + lastFailedPlannedFailoverJob().validate(); + } + if (lastTestFailoverJob() != null) { + lastTestFailoverJob().validate(); + } + if (healthErrors() != null) { + healthErrors().forEach(e -> e.validate()); + } + if (customProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property customProperties in model ProtectedItemModelProperties")); + } else { + customProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ProtectedItemModelProperties.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelPropertiesCurrentJob.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelPropertiesCurrentJob.java new file mode 100644 index 000000000000..a50ece978ff3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelPropertiesCurrentJob.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Immutable; + +/** The ProtectedItemModelPropertiesCurrentJob model. */ +@Immutable +public final class ProtectedItemModelPropertiesCurrentJob extends ProtectedItemJobProperties { + /** Creates an instance of ProtectedItemModelPropertiesCurrentJob class. */ + public ProtectedItemModelPropertiesCurrentJob() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelPropertiesLastTestFailoverJob.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelPropertiesLastTestFailoverJob.java new file mode 100644 index 000000000000..8d5fedc7179d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelPropertiesLastTestFailoverJob.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Immutable; + +/** The ProtectedItemModelPropertiesLastTestFailoverJob model. */ +@Immutable +public final class ProtectedItemModelPropertiesLastTestFailoverJob extends ProtectedItemJobProperties { + /** Creates an instance of ProtectedItemModelPropertiesLastTestFailoverJob class. */ + public ProtectedItemModelPropertiesLastTestFailoverJob() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelSystemData.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelSystemData.java new file mode 100644 index 000000000000..e5d3536379e3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemModelSystemData.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import java.time.OffsetDateTime; + +/** The ProtectedItemModelSystemData model. */ +@Fluent +public final class ProtectedItemModelSystemData extends SystemDataModel { + /** Creates an instance of ProtectedItemModelSystemData class. */ + public ProtectedItemModelSystemData() { + } + + /** {@inheritDoc} */ + @Override + public ProtectedItemModelSystemData withCreatedBy(String createdBy) { + super.withCreatedBy(createdBy); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProtectedItemModelSystemData withCreatedByType(String createdByType) { + super.withCreatedByType(createdByType); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProtectedItemModelSystemData withCreatedAt(OffsetDateTime createdAt) { + super.withCreatedAt(createdAt); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProtectedItemModelSystemData withLastModifiedBy(String lastModifiedBy) { + super.withLastModifiedBy(lastModifiedBy); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProtectedItemModelSystemData withLastModifiedByType(String lastModifiedByType) { + super.withLastModifiedByType(lastModifiedByType); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProtectedItemModelSystemData withLastModifiedAt(OffsetDateTime lastModifiedAt) { + super.withLastModifiedAt(lastModifiedAt); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemOperationStatus.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemOperationStatus.java new file mode 100644 index 000000000000..0f2c84381059 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItemOperationStatus.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ProtectedItemOperationStatus. */ +public interface ProtectedItemOperationStatus { + /** + * Gets the protected item operation status. + * + *

Tracks the results of an asynchronous operation on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param operationId The ID of an ongoing async operation. + * @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 defines the operation status along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String vaultName, String protectedItemName, String operationId, Context context); + + /** + * Gets the protected item operation status. + * + *

Tracks the results of an asynchronous operation on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param operationId The ID of an ongoing async 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 defines the operation status. + */ + OperationStatus get(String resourceGroupName, String vaultName, String protectedItemName, String operationId); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItems.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItems.java new file mode 100644 index 000000000000..41bc12fb1cd6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectedItems.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.recoveryservicesdatareplication.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.PlannedFailoverModelInner; + +/** Resource collection API of ProtectedItems. */ +public interface ProtectedItems { + /** + * Gets the protected item. + * + *

Gets the details of the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 the details of the protected item along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String vaultName, String protectedItemName, Context context); + + /** + * Gets the protected item. + * + *

Gets the details of the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 the details of the protected item. + */ + ProtectedItemModel get(String resourceGroupName, String vaultName, String protectedItemName); + + /** + * Deletes the protected item. + * + *

Removes the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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. + */ + void delete(String resourceGroupName, String vaultName, String protectedItemName); + + /** + * Deletes the protected item. + * + *

Removes the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param forceDelete A flag indicating whether to do force delete or not. + * @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 vaultName, String protectedItemName, Boolean forceDelete, Context context); + + /** + * Lists the protected items. + * + *

Gets the list of protected items in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of protected items in the given vault as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String vaultName); + + /** + * Lists the protected items. + * + *

Gets the list of protected items in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of protected items in the given vault as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String vaultName, Context context); + + /** + * Performs planned failover. + * + *

Performs the planned failover on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 planned failover model. + */ + PlannedFailoverModel plannedFailover(String resourceGroupName, String vaultName, String protectedItemName); + + /** + * Performs planned failover. + * + *

Performs the planned failover on the protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param body Planned failover model. + * @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 planned failover model. + */ + PlannedFailoverModel plannedFailover( + String resourceGroupName, + String vaultName, + String protectedItemName, + PlannedFailoverModelInner body, + Context context); + + /** + * Gets the protected item. + * + *

Gets the details of the protected item. + * + * @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 the details of the protected item along with {@link Response}. + */ + ProtectedItemModel getById(String id); + + /** + * Gets the protected item. + * + *

Gets the details of the protected item. + * + * @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 the details of the protected item along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the protected item. + * + *

Removes the protected item. + * + * @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 the protected item. + * + *

Removes the protected item. + * + * @param id the resource ID. + * @param forceDelete A flag indicating whether to do force delete or not. + * @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, Boolean forceDelete, Context context); + + /** + * Begins definition for a new ProtectedItemModel resource. + * + * @param name resource name. + * @return the first stage of the new ProtectedItemModel definition. + */ + ProtectedItemModel.DefinitionStages.Blank define(String name); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectionState.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectionState.java new file mode 100644 index 000000000000..5cc0e50bcbb0 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProtectionState.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Gets or sets the protection state. */ +public final class ProtectionState extends ExpandableStringEnum { + /** Static value UnprotectedStatesBegin for ProtectionState. */ + public static final ProtectionState UNPROTECTED_STATES_BEGIN = fromString("UnprotectedStatesBegin"); + + /** Static value EnablingProtection for ProtectionState. */ + public static final ProtectionState ENABLING_PROTECTION = fromString("EnablingProtection"); + + /** Static value EnablingFailed for ProtectionState. */ + public static final ProtectionState ENABLING_FAILED = fromString("EnablingFailed"); + + /** Static value DisablingProtection for ProtectionState. */ + public static final ProtectionState DISABLING_PROTECTION = fromString("DisablingProtection"); + + /** Static value MarkedForDeletion for ProtectionState. */ + public static final ProtectionState MARKED_FOR_DELETION = fromString("MarkedForDeletion"); + + /** Static value DisablingFailed for ProtectionState. */ + public static final ProtectionState DISABLING_FAILED = fromString("DisablingFailed"); + + /** Static value UnprotectedStatesEnd for ProtectionState. */ + public static final ProtectionState UNPROTECTED_STATES_END = fromString("UnprotectedStatesEnd"); + + /** Static value InitialReplicationStatesBegin for ProtectionState. */ + public static final ProtectionState INITIAL_REPLICATION_STATES_BEGIN = fromString("InitialReplicationStatesBegin"); + + /** Static value InitialReplicationInProgress for ProtectionState. */ + public static final ProtectionState INITIAL_REPLICATION_IN_PROGRESS = fromString("InitialReplicationInProgress"); + + /** Static value InitialReplicationCompletedOnPrimary for ProtectionState. */ + public static final ProtectionState INITIAL_REPLICATION_COMPLETED_ON_PRIMARY = + fromString("InitialReplicationCompletedOnPrimary"); + + /** Static value InitialReplicationCompletedOnRecovery for ProtectionState. */ + public static final ProtectionState INITIAL_REPLICATION_COMPLETED_ON_RECOVERY = + fromString("InitialReplicationCompletedOnRecovery"); + + /** Static value InitialReplicationFailed for ProtectionState. */ + public static final ProtectionState INITIAL_REPLICATION_FAILED = fromString("InitialReplicationFailed"); + + /** Static value InitialReplicationStatesEnd for ProtectionState. */ + public static final ProtectionState INITIAL_REPLICATION_STATES_END = fromString("InitialReplicationStatesEnd"); + + /** Static value ProtectedStatesBegin for ProtectionState. */ + public static final ProtectionState PROTECTED_STATES_BEGIN = fromString("ProtectedStatesBegin"); + + /** Static value Protected for ProtectionState. */ + public static final ProtectionState PROTECTED = fromString("Protected"); + + /** Static value ProtectedStatesEnd for ProtectionState. */ + public static final ProtectionState PROTECTED_STATES_END = fromString("ProtectedStatesEnd"); + + /** Static value PlannedFailoverTransitionStatesBegin for ProtectionState. */ + public static final ProtectionState PLANNED_FAILOVER_TRANSITION_STATES_BEGIN = + fromString("PlannedFailoverTransitionStatesBegin"); + + /** Static value PlannedFailoverInitiated for ProtectionState. */ + public static final ProtectionState PLANNED_FAILOVER_INITIATED = fromString("PlannedFailoverInitiated"); + + /** Static value PlannedFailoverCompleting for ProtectionState. */ + public static final ProtectionState PLANNED_FAILOVER_COMPLETING = fromString("PlannedFailoverCompleting"); + + /** Static value PlannedFailoverCompleted for ProtectionState. */ + public static final ProtectionState PLANNED_FAILOVER_COMPLETED = fromString("PlannedFailoverCompleted"); + + /** Static value PlannedFailoverFailed for ProtectionState. */ + public static final ProtectionState PLANNED_FAILOVER_FAILED = fromString("PlannedFailoverFailed"); + + /** Static value PlannedFailoverCompletionFailed for ProtectionState. */ + public static final ProtectionState PLANNED_FAILOVER_COMPLETION_FAILED = + fromString("PlannedFailoverCompletionFailed"); + + /** Static value PlannedFailoverTransitionStatesEnd for ProtectionState. */ + public static final ProtectionState PLANNED_FAILOVER_TRANSITION_STATES_END = + fromString("PlannedFailoverTransitionStatesEnd"); + + /** Static value UnplannedFailoverTransitionStatesBegin for ProtectionState. */ + public static final ProtectionState UNPLANNED_FAILOVER_TRANSITION_STATES_BEGIN = + fromString("UnplannedFailoverTransitionStatesBegin"); + + /** Static value UnplannedFailoverInitiated for ProtectionState. */ + public static final ProtectionState UNPLANNED_FAILOVER_INITIATED = fromString("UnplannedFailoverInitiated"); + + /** Static value UnplannedFailoverCompleting for ProtectionState. */ + public static final ProtectionState UNPLANNED_FAILOVER_COMPLETING = fromString("UnplannedFailoverCompleting"); + + /** Static value UnplannedFailoverCompleted for ProtectionState. */ + public static final ProtectionState UNPLANNED_FAILOVER_COMPLETED = fromString("UnplannedFailoverCompleted"); + + /** Static value UnplannedFailoverFailed for ProtectionState. */ + public static final ProtectionState UNPLANNED_FAILOVER_FAILED = fromString("UnplannedFailoverFailed"); + + /** Static value UnplannedFailoverCompletionFailed for ProtectionState. */ + public static final ProtectionState UNPLANNED_FAILOVER_COMPLETION_FAILED = + fromString("UnplannedFailoverCompletionFailed"); + + /** Static value UnplannedFailoverTransitionStatesEnd for ProtectionState. */ + public static final ProtectionState UNPLANNED_FAILOVER_TRANSITION_STATES_END = + fromString("UnplannedFailoverTransitionStatesEnd"); + + /** Static value CommitFailoverStatesBegin for ProtectionState. */ + public static final ProtectionState COMMIT_FAILOVER_STATES_BEGIN = fromString("CommitFailoverStatesBegin"); + + /** Static value CommitFailoverInProgressOnPrimary for ProtectionState. */ + public static final ProtectionState COMMIT_FAILOVER_IN_PROGRESS_ON_PRIMARY = + fromString("CommitFailoverInProgressOnPrimary"); + + /** Static value CommitFailoverInProgressOnRecovery for ProtectionState. */ + public static final ProtectionState COMMIT_FAILOVER_IN_PROGRESS_ON_RECOVERY = + fromString("CommitFailoverInProgressOnRecovery"); + + /** Static value CommitFailoverCompleted for ProtectionState. */ + public static final ProtectionState COMMIT_FAILOVER_COMPLETED = fromString("CommitFailoverCompleted"); + + /** Static value CommitFailoverFailedOnPrimary for ProtectionState. */ + public static final ProtectionState COMMIT_FAILOVER_FAILED_ON_PRIMARY = fromString("CommitFailoverFailedOnPrimary"); + + /** Static value CommitFailoverFailedOnRecovery for ProtectionState. */ + public static final ProtectionState COMMIT_FAILOVER_FAILED_ON_RECOVERY = + fromString("CommitFailoverFailedOnRecovery"); + + /** Static value CommitFailoverStatesEnd for ProtectionState. */ + public static final ProtectionState COMMIT_FAILOVER_STATES_END = fromString("CommitFailoverStatesEnd"); + + /** Static value CancelFailoverStatesBegin for ProtectionState. */ + public static final ProtectionState CANCEL_FAILOVER_STATES_BEGIN = fromString("CancelFailoverStatesBegin"); + + /** Static value CancelFailoverInProgressOnPrimary for ProtectionState. */ + public static final ProtectionState CANCEL_FAILOVER_IN_PROGRESS_ON_PRIMARY = + fromString("CancelFailoverInProgressOnPrimary"); + + /** Static value CancelFailoverInProgressOnRecovery for ProtectionState. */ + public static final ProtectionState CANCEL_FAILOVER_IN_PROGRESS_ON_RECOVERY = + fromString("CancelFailoverInProgressOnRecovery"); + + /** Static value CancelFailoverFailedOnPrimary for ProtectionState. */ + public static final ProtectionState CANCEL_FAILOVER_FAILED_ON_PRIMARY = fromString("CancelFailoverFailedOnPrimary"); + + /** Static value CancelFailoverFailedOnRecovery for ProtectionState. */ + public static final ProtectionState CANCEL_FAILOVER_FAILED_ON_RECOVERY = + fromString("CancelFailoverFailedOnRecovery"); + + /** Static value CancelFailoverStatesEnd for ProtectionState. */ + public static final ProtectionState CANCEL_FAILOVER_STATES_END = fromString("CancelFailoverStatesEnd"); + + /** Static value ChangeRecoveryPointStatesBegin for ProtectionState. */ + public static final ProtectionState CHANGE_RECOVERY_POINT_STATES_BEGIN = + fromString("ChangeRecoveryPointStatesBegin"); + + /** Static value ChangeRecoveryPointInitiated for ProtectionState. */ + public static final ProtectionState CHANGE_RECOVERY_POINT_INITIATED = fromString("ChangeRecoveryPointInitiated"); + + /** Static value ChangeRecoveryPointCompleted for ProtectionState. */ + public static final ProtectionState CHANGE_RECOVERY_POINT_COMPLETED = fromString("ChangeRecoveryPointCompleted"); + + /** Static value ChangeRecoveryPointFailed for ProtectionState. */ + public static final ProtectionState CHANGE_RECOVERY_POINT_FAILED = fromString("ChangeRecoveryPointFailed"); + + /** Static value ChangeRecoveryPointStatesEnd for ProtectionState. */ + public static final ProtectionState CHANGE_RECOVERY_POINT_STATES_END = fromString("ChangeRecoveryPointStatesEnd"); + + /** Static value ReprotectStatesBegin for ProtectionState. */ + public static final ProtectionState REPROTECT_STATES_BEGIN = fromString("ReprotectStatesBegin"); + + /** Static value ReprotectInitiated for ProtectionState. */ + public static final ProtectionState REPROTECT_INITIATED = fromString("ReprotectInitiated"); + + /** Static value ReprotectFailed for ProtectionState. */ + public static final ProtectionState REPROTECT_FAILED = fromString("ReprotectFailed"); + + /** Static value ReprotectStatesEnd for ProtectionState. */ + public static final ProtectionState REPROTECT_STATES_END = fromString("ReprotectStatesEnd"); + + /** + * Creates a new instance of ProtectionState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProtectionState() { + } + + /** + * Creates or finds a ProtectionState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProtectionState. + */ + @JsonCreator + public static ProtectionState fromString(String name) { + return fromString(name, ProtectionState.class); + } + + /** + * Gets known ProtectionState values. + * + * @return known ProtectionState values. + */ + public static Collection values() { + return values(ProtectionState.class); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProvisioningState.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProvisioningState.java new file mode 100644 index 000000000000..9242eebe93e4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ProvisioningState.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Gets or sets the provisioning state of the Dra. */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Deleted for ProvisioningState. */ + public static final ProvisioningState DELETED = fromString("Deleted"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/RecoveryPointModel.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/RecoveryPointModel.java new file mode 100644 index 000000000000..fd4afca00657 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/RecoveryPointModel.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.recoveryservicesdatareplication.models; + +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.RecoveryPointModelInner; + +/** An immutable client-side representation of RecoveryPointModel. */ +public interface RecoveryPointModel { + /** + * Gets the properties property: Recovery point model properties. + * + * @return the properties value. + */ + RecoveryPointModelProperties properties(); + + /** + * Gets the id property: Gets or sets the Id of the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Gets or sets the name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Gets or sets the type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The systemData property. + * + * @return the systemData value. + */ + RecoveryPointModelSystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.RecoveryPointModelInner + * object. + * + * @return the inner object. + */ + RecoveryPointModelInner innerModel(); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/RecoveryPointModelCollection.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/RecoveryPointModelCollection.java new file mode 100644 index 000000000000..b03823e7257f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/RecoveryPointModelCollection.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.RecoveryPointModelInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Recovery point model collection. */ +@Fluent +public final class RecoveryPointModelCollection { + /* + * Gets or sets the list of recovery points. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets or sets the value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of RecoveryPointModelCollection class. */ + public RecoveryPointModelCollection() { + } + + /** + * Get the value property: Gets or sets the list of recovery points. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets the list of recovery points. + * + * @param value the value value to set. + * @return the RecoveryPointModelCollection object itself. + */ + public RecoveryPointModelCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets or sets the value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets or sets the value of next link. + * + * @param nextLink the nextLink value to set. + * @return the RecoveryPointModelCollection object itself. + */ + public RecoveryPointModelCollection 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/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/RecoveryPointModelCustomProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/RecoveryPointModelCustomProperties.java new file mode 100644 index 000000000000..e53261e194d6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/RecoveryPointModelCustomProperties.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Recovery point model custom properties. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = RecoveryPointModelCustomProperties.class) +@JsonTypeName("RecoveryPointModelCustomProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "HyperVToAzStackHCI", value = HyperVToAzStackHciRecoveryPointCustomProps.class) +}) +@Immutable +public class RecoveryPointModelCustomProperties { + /** Creates an instance of RecoveryPointModelCustomProperties class. */ + public RecoveryPointModelCustomProperties() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/RecoveryPointModelProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/RecoveryPointModelProperties.java new file mode 100644 index 000000000000..ced2fc3cad76 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/RecoveryPointModelProperties.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Recovery point model properties. */ +@Fluent +public final class RecoveryPointModelProperties { + /* + * Gets or sets the recovery point time. + */ + @JsonProperty(value = "recoveryPointTime", required = true) + private OffsetDateTime recoveryPointTime; + + /* + * Gets or sets the recovery point type. + */ + @JsonProperty(value = "recoveryPointType", required = true) + private RecoveryPointType recoveryPointType; + + /* + * Recovery point model custom properties. + */ + @JsonProperty(value = "customProperties", required = true) + private RecoveryPointModelCustomProperties customProperties; + + /** Creates an instance of RecoveryPointModelProperties class. */ + public RecoveryPointModelProperties() { + } + + /** + * Get the recoveryPointTime property: Gets or sets the recovery point time. + * + * @return the recoveryPointTime value. + */ + public OffsetDateTime recoveryPointTime() { + return this.recoveryPointTime; + } + + /** + * Set the recoveryPointTime property: Gets or sets the recovery point time. + * + * @param recoveryPointTime the recoveryPointTime value to set. + * @return the RecoveryPointModelProperties object itself. + */ + public RecoveryPointModelProperties withRecoveryPointTime(OffsetDateTime recoveryPointTime) { + this.recoveryPointTime = recoveryPointTime; + return this; + } + + /** + * Get the recoveryPointType property: Gets or sets the recovery point type. + * + * @return the recoveryPointType value. + */ + public RecoveryPointType recoveryPointType() { + return this.recoveryPointType; + } + + /** + * Set the recoveryPointType property: Gets or sets the recovery point type. + * + * @param recoveryPointType the recoveryPointType value to set. + * @return the RecoveryPointModelProperties object itself. + */ + public RecoveryPointModelProperties withRecoveryPointType(RecoveryPointType recoveryPointType) { + this.recoveryPointType = recoveryPointType; + return this; + } + + /** + * Get the customProperties property: Recovery point model custom properties. + * + * @return the customProperties value. + */ + public RecoveryPointModelCustomProperties customProperties() { + return this.customProperties; + } + + /** + * Set the customProperties property: Recovery point model custom properties. + * + * @param customProperties the customProperties value to set. + * @return the RecoveryPointModelProperties object itself. + */ + public RecoveryPointModelProperties withCustomProperties(RecoveryPointModelCustomProperties customProperties) { + this.customProperties = customProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (recoveryPointTime() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property recoveryPointTime in model RecoveryPointModelProperties")); + } + if (recoveryPointType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property recoveryPointType in model RecoveryPointModelProperties")); + } + if (customProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property customProperties in model RecoveryPointModelProperties")); + } else { + customProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RecoveryPointModelProperties.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/RecoveryPointModelSystemData.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/RecoveryPointModelSystemData.java new file mode 100644 index 000000000000..8291f8e70081 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/RecoveryPointModelSystemData.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import java.time.OffsetDateTime; + +/** The RecoveryPointModelSystemData model. */ +@Fluent +public final class RecoveryPointModelSystemData extends SystemDataModel { + /** Creates an instance of RecoveryPointModelSystemData class. */ + public RecoveryPointModelSystemData() { + } + + /** {@inheritDoc} */ + @Override + public RecoveryPointModelSystemData withCreatedBy(String createdBy) { + super.withCreatedBy(createdBy); + return this; + } + + /** {@inheritDoc} */ + @Override + public RecoveryPointModelSystemData withCreatedByType(String createdByType) { + super.withCreatedByType(createdByType); + return this; + } + + /** {@inheritDoc} */ + @Override + public RecoveryPointModelSystemData withCreatedAt(OffsetDateTime createdAt) { + super.withCreatedAt(createdAt); + return this; + } + + /** {@inheritDoc} */ + @Override + public RecoveryPointModelSystemData withLastModifiedBy(String lastModifiedBy) { + super.withLastModifiedBy(lastModifiedBy); + return this; + } + + /** {@inheritDoc} */ + @Override + public RecoveryPointModelSystemData withLastModifiedByType(String lastModifiedByType) { + super.withLastModifiedByType(lastModifiedByType); + return this; + } + + /** {@inheritDoc} */ + @Override + public RecoveryPointModelSystemData withLastModifiedAt(OffsetDateTime lastModifiedAt) { + super.withLastModifiedAt(lastModifiedAt); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/RecoveryPointType.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/RecoveryPointType.java new file mode 100644 index 000000000000..10c7b1b656a3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/RecoveryPointType.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.recoveryservicesdatareplication.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Gets or sets the recovery point type. */ +public final class RecoveryPointType extends ExpandableStringEnum { + /** Static value ApplicationConsistent for RecoveryPointType. */ + public static final RecoveryPointType APPLICATION_CONSISTENT = fromString("ApplicationConsistent"); + + /** Static value CrashConsistent for RecoveryPointType. */ + public static final RecoveryPointType CRASH_CONSISTENT = fromString("CrashConsistent"); + + /** + * Creates a new instance of RecoveryPointType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RecoveryPointType() { + } + + /** + * Creates or finds a RecoveryPointType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RecoveryPointType. + */ + @JsonCreator + public static RecoveryPointType fromString(String name) { + return fromString(name, RecoveryPointType.class); + } + + /** + * Gets known RecoveryPointType values. + * + * @return known RecoveryPointType values. + */ + public static Collection values() { + return values(RecoveryPointType.class); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/RecoveryPoints.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/RecoveryPoints.java new file mode 100644 index 000000000000..6f7e03898cc4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/RecoveryPoints.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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 RecoveryPoints. */ +public interface RecoveryPoints { + /** + * Gets the recovery point. + * + *

Gets the details of the recovery point of a protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param recoveryPointName The recovery point 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 the details of the recovery point of a protected item along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String vaultName, + String protectedItemName, + String recoveryPointName, + Context context); + + /** + * Gets the recovery point. + * + *

Gets the details of the recovery point of a protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item name. + * @param recoveryPointName The recovery point 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 the details of the recovery point of a protected item. + */ + RecoveryPointModel get( + String resourceGroupName, String vaultName, String protectedItemName, String recoveryPointName); + + /** + * Lists the recovery points. + * + *

Gets the list of recovery points of the given protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 the list of recovery points of the given protected item as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String vaultName, String protectedItemName); + + /** + * Lists the recovery points. + * + *

Gets the list of recovery points of the given protected item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param protectedItemName The protected item 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 the list of recovery points of the given protected item as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String vaultName, String protectedItemName, Context context); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ReplicationExtensionModel.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ReplicationExtensionModel.java new file mode 100644 index 000000000000..239389935509 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ReplicationExtensionModel.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.recoveryservicesdatareplication.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.ReplicationExtensionModelInner; + +/** An immutable client-side representation of ReplicationExtensionModel. */ +public interface ReplicationExtensionModel { + /** + * 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 properties property: Replication extension model properties. + * + * @return the properties value. + */ + ReplicationExtensionModelProperties properties(); + + /** + * Gets the systemData property: The systemData property. + * + * @return the systemData value. + */ + ReplicationExtensionModelSystemData systemData(); + + /** + * Gets the inner + * com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.ReplicationExtensionModelInner object. + * + * @return the inner object. + */ + ReplicationExtensionModelInner innerModel(); + + /** The entirety of the ReplicationExtensionModel definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + + /** The ReplicationExtensionModel definition stages. */ + interface DefinitionStages { + /** The first stage of the ReplicationExtensionModel definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the ReplicationExtensionModel definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, vaultName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @return the next definition stage. + */ + WithProperties withExistingReplicationVault(String resourceGroupName, String vaultName); + } + + /** The stage of the ReplicationExtensionModel definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Replication extension model properties.. + * + * @param properties Replication extension model properties. + * @return the next definition stage. + */ + WithCreate withProperties(ReplicationExtensionModelProperties properties); + } + + /** + * The stage of the ReplicationExtensionModel 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + ReplicationExtensionModel create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ReplicationExtensionModel create(Context context); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ReplicationExtensionModel refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ReplicationExtensionModel refresh(Context context); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ReplicationExtensionModelCollection.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ReplicationExtensionModelCollection.java new file mode 100644 index 000000000000..0a8a9dfe9769 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ReplicationExtensionModelCollection.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.ReplicationExtensionModelInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Replication extension model collection. */ +@Fluent +public final class ReplicationExtensionModelCollection { + /* + * Gets or sets the list of replication extensions. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets or sets the value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ReplicationExtensionModelCollection class. */ + public ReplicationExtensionModelCollection() { + } + + /** + * Get the value property: Gets or sets the list of replication extensions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets the list of replication extensions. + * + * @param value the value value to set. + * @return the ReplicationExtensionModelCollection object itself. + */ + public ReplicationExtensionModelCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets or sets the value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets or sets the value of next link. + * + * @param nextLink the nextLink value to set. + * @return the ReplicationExtensionModelCollection object itself. + */ + public ReplicationExtensionModelCollection 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/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ReplicationExtensionModelCustomProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ReplicationExtensionModelCustomProperties.java new file mode 100644 index 000000000000..9ef70c0fdb33 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ReplicationExtensionModelCustomProperties.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Replication extension model custom properties. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = ReplicationExtensionModelCustomProperties.class) +@JsonTypeName("ReplicationExtensionModelCustomProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "HyperVToAzStackHCI", value = HyperVToAzStackHciRepExtnCustomProps.class), + @JsonSubTypes.Type(name = "VMwareToAzStackHCI", value = VMwareToAzStackHciRepExtnCustomProps.class) +}) +@Immutable +public class ReplicationExtensionModelCustomProperties { + /** Creates an instance of ReplicationExtensionModelCustomProperties class. */ + public ReplicationExtensionModelCustomProperties() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ReplicationExtensionModelProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ReplicationExtensionModelProperties.java new file mode 100644 index 000000000000..03afa4f8d37d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ReplicationExtensionModelProperties.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Replication extension model properties. */ +@Fluent +public final class ReplicationExtensionModelProperties { + /* + * Gets or sets the provisioning state of the replication extension. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Replication extension model custom properties. + */ + @JsonProperty(value = "customProperties", required = true) + private ReplicationExtensionModelCustomProperties customProperties; + + /** Creates an instance of ReplicationExtensionModelProperties class. */ + public ReplicationExtensionModelProperties() { + } + + /** + * Get the provisioningState property: Gets or sets the provisioning state of the replication extension. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the customProperties property: Replication extension model custom properties. + * + * @return the customProperties value. + */ + public ReplicationExtensionModelCustomProperties customProperties() { + return this.customProperties; + } + + /** + * Set the customProperties property: Replication extension model custom properties. + * + * @param customProperties the customProperties value to set. + * @return the ReplicationExtensionModelProperties object itself. + */ + public ReplicationExtensionModelProperties withCustomProperties( + ReplicationExtensionModelCustomProperties customProperties) { + this.customProperties = customProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (customProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property customProperties in model ReplicationExtensionModelProperties")); + } else { + customProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ReplicationExtensionModelProperties.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ReplicationExtensionModelSystemData.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ReplicationExtensionModelSystemData.java new file mode 100644 index 000000000000..183520540f97 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ReplicationExtensionModelSystemData.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import java.time.OffsetDateTime; + +/** The ReplicationExtensionModelSystemData model. */ +@Fluent +public final class ReplicationExtensionModelSystemData extends SystemDataModel { + /** Creates an instance of ReplicationExtensionModelSystemData class. */ + public ReplicationExtensionModelSystemData() { + } + + /** {@inheritDoc} */ + @Override + public ReplicationExtensionModelSystemData withCreatedBy(String createdBy) { + super.withCreatedBy(createdBy); + return this; + } + + /** {@inheritDoc} */ + @Override + public ReplicationExtensionModelSystemData withCreatedByType(String createdByType) { + super.withCreatedByType(createdByType); + return this; + } + + /** {@inheritDoc} */ + @Override + public ReplicationExtensionModelSystemData withCreatedAt(OffsetDateTime createdAt) { + super.withCreatedAt(createdAt); + return this; + } + + /** {@inheritDoc} */ + @Override + public ReplicationExtensionModelSystemData withLastModifiedBy(String lastModifiedBy) { + super.withLastModifiedBy(lastModifiedBy); + return this; + } + + /** {@inheritDoc} */ + @Override + public ReplicationExtensionModelSystemData withLastModifiedByType(String lastModifiedByType) { + super.withLastModifiedByType(lastModifiedByType); + return this; + } + + /** {@inheritDoc} */ + @Override + public ReplicationExtensionModelSystemData withLastModifiedAt(OffsetDateTime lastModifiedAt) { + super.withLastModifiedAt(lastModifiedAt); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ReplicationExtensions.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ReplicationExtensions.java new file mode 100644 index 000000000000..e2471f896081 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ReplicationExtensions.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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 ReplicationExtensions. */ +public interface ReplicationExtensions { + /** + * Gets the replication extension. + * + *

Gets the details of the replication extension. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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 the details of the replication extension along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String vaultName, String replicationExtensionName, Context context); + + /** + * Gets the replication extension. + * + *

Gets the details of the replication extension. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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 the details of the replication extension. + */ + ReplicationExtensionModel get(String resourceGroupName, String vaultName, String replicationExtensionName); + + /** + * Deletes the replication extension. + * + *

Deletes the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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. + */ + void delete(String resourceGroupName, String vaultName, String replicationExtensionName); + + /** + * Deletes the replication extension. + * + *

Deletes the replication extension in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param replicationExtensionName The replication extension 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. + */ + void delete(String resourceGroupName, String vaultName, String replicationExtensionName, Context context); + + /** + * Lists the replication extensions. + * + *

Gets the list of replication extensions in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of replication extensions in the given vault as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String vaultName); + + /** + * Lists the replication extensions. + * + *

Gets the list of replication extensions in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of replication extensions in the given vault as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String vaultName, Context context); + + /** + * Gets the replication extension. + * + *

Gets the details of the replication extension. + * + * @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 the details of the replication extension along with {@link Response}. + */ + ReplicationExtensionModel getById(String id); + + /** + * Gets the replication extension. + * + *

Gets the details of the replication extension. + * + * @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 the details of the replication extension along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the replication extension. + * + *

Deletes the replication extension in the given vault. + * + * @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 the replication extension. + * + *

Deletes the replication extension in the given vault. + * + * @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 ReplicationExtensionModel resource. + * + * @param name resource name. + * @return the first stage of the new ReplicationExtensionModel definition. + */ + ReplicationExtensionModel.DefinitionStages.Blank define(String name); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ReplicationVaultType.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ReplicationVaultType.java new file mode 100644 index 000000000000..2e7ea70cf6bb --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ReplicationVaultType.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.recoveryservicesdatareplication.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Gets or sets the type of vault. */ +public final class ReplicationVaultType extends ExpandableStringEnum { + /** Static value DisasterRecovery for ReplicationVaultType. */ + public static final ReplicationVaultType DISASTER_RECOVERY = fromString("DisasterRecovery"); + + /** Static value Migrate for ReplicationVaultType. */ + public static final ReplicationVaultType MIGRATE = fromString("Migrate"); + + /** + * Creates a new instance of ReplicationVaultType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ReplicationVaultType() { + } + + /** + * Creates or finds a ReplicationVaultType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ReplicationVaultType. + */ + @JsonCreator + public static ReplicationVaultType fromString(String name) { + return fromString(name, ReplicationVaultType.class); + } + + /** + * Gets known ReplicationVaultType values. + * + * @return known ReplicationVaultType values. + */ + public static Collection values() { + return values(ReplicationVaultType.class); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ResourceProviders.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ResourceProviders.java new file mode 100644 index 000000000000..3a1ddf0669ac --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ResourceProviders.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.recoveryservicesdatareplication.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.DeploymentPreflightModelInner; + +/** Resource collection API of ResourceProviders. */ +public interface ResourceProviders { + /** + * Performs the resource name availability check. + * + *

Checks the resource name availability. + * + * @param location The name of the Azure region. + * @param body Resource details. + * @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 check name availability response model along with {@link Response}. + */ + Response checkNameAvailabilityWithResponse( + String location, CheckNameAvailabilityModel body, Context context); + + /** + * Performs the resource name availability check. + * + *

Checks the resource name availability. + * + * @param location The name of the Azure region. + * @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 check name availability response model. + */ + CheckNameAvailabilityResponseModel checkNameAvailability(String location); + + /** + * Performs resource deployment validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentId Deployment Id. + * @param body Deployment preflight model. + * @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 deployment preflight model along with {@link Response}. + */ + Response deploymentPreflightWithResponse( + String resourceGroupName, String deploymentId, DeploymentPreflightModelInner body, Context context); + + /** + * Performs resource deployment validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentId Deployment 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 deployment preflight model. + */ + DeploymentPreflightModel deploymentPreflight(String resourceGroupName, String deploymentId); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ResynchronizationState.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ResynchronizationState.java new file mode 100644 index 000000000000..6e9456cf5d62 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/ResynchronizationState.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.recoveryservicesdatareplication.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Gets or sets the resynchronization state. */ +public final class ResynchronizationState extends ExpandableStringEnum { + /** Static value None for ResynchronizationState. */ + public static final ResynchronizationState NONE = fromString("None"); + + /** Static value ResynchronizationInitiated for ResynchronizationState. */ + public static final ResynchronizationState RESYNCHRONIZATION_INITIATED = fromString("ResynchronizationInitiated"); + + /** Static value ResynchronizationCompleted for ResynchronizationState. */ + public static final ResynchronizationState RESYNCHRONIZATION_COMPLETED = fromString("ResynchronizationCompleted"); + + /** Static value ResynchronizationFailed for ResynchronizationState. */ + public static final ResynchronizationState RESYNCHRONIZATION_FAILED = fromString("ResynchronizationFailed"); + + /** + * Creates a new instance of ResynchronizationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResynchronizationState() { + } + + /** + * Creates or finds a ResynchronizationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResynchronizationState. + */ + @JsonCreator + public static ResynchronizationState fromString(String name) { + return fromString(name, ResynchronizationState.class); + } + + /** + * Gets known ResynchronizationState values. + * + * @return known ResynchronizationState values. + */ + public static Collection values() { + return values(ResynchronizationState.class); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/StorageContainerProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/StorageContainerProperties.java new file mode 100644 index 000000000000..5e533fd603de --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/StorageContainerProperties.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Storage container properties. */ +@Fluent +public final class StorageContainerProperties { + /* + * Gets or sets the Name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Gets or sets the ClusterSharedVolumePath. + */ + @JsonProperty(value = "clusterSharedVolumePath", required = true) + private String clusterSharedVolumePath; + + /** Creates an instance of StorageContainerProperties class. */ + public StorageContainerProperties() { + } + + /** + * Get the name property: Gets or sets the Name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets or sets the Name. + * + * @param name the name value to set. + * @return the StorageContainerProperties object itself. + */ + public StorageContainerProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the clusterSharedVolumePath property: Gets or sets the ClusterSharedVolumePath. + * + * @return the clusterSharedVolumePath value. + */ + public String clusterSharedVolumePath() { + return this.clusterSharedVolumePath; + } + + /** + * Set the clusterSharedVolumePath property: Gets or sets the ClusterSharedVolumePath. + * + * @param clusterSharedVolumePath the clusterSharedVolumePath value to set. + * @return the StorageContainerProperties object itself. + */ + public StorageContainerProperties withClusterSharedVolumePath(String clusterSharedVolumePath) { + this.clusterSharedVolumePath = clusterSharedVolumePath; + 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 StorageContainerProperties")); + } + if (clusterSharedVolumePath() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property clusterSharedVolumePath in model StorageContainerProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageContainerProperties.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/SystemDataModel.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/SystemDataModel.java new file mode 100644 index 000000000000..3c6331cbdc9b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/SystemDataModel.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** System data required to be defined for Azure resources. */ +@Fluent +public class SystemDataModel { + /* + * Gets or sets identity that created the resource. + */ + @JsonProperty(value = "createdBy") + private String createdBy; + + /* + * Gets or sets the type of identity that created the resource: user, application, + * managedIdentity. + */ + @JsonProperty(value = "createdByType") + private String createdByType; + + /* + * Gets or sets the timestamp of resource creation (UTC). + */ + @JsonProperty(value = "createdAt") + private OffsetDateTime createdAt; + + /* + * Gets or sets the identity that last modified the resource. + */ + @JsonProperty(value = "lastModifiedBy") + private String lastModifiedBy; + + /* + * Gets or sets the type of identity that last modified the resource: user, application, + * managedIdentity. + */ + @JsonProperty(value = "lastModifiedByType") + private String lastModifiedByType; + + /* + * Gets or sets the timestamp of resource last modification (UTC). + */ + @JsonProperty(value = "lastModifiedAt") + private OffsetDateTime lastModifiedAt; + + /** Creates an instance of SystemDataModel class. */ + public SystemDataModel() { + } + + /** + * Get the createdBy property: Gets or sets identity that created the resource. + * + * @return the createdBy value. + */ + public String createdBy() { + return this.createdBy; + } + + /** + * Set the createdBy property: Gets or sets identity that created the resource. + * + * @param createdBy the createdBy value to set. + * @return the SystemDataModel object itself. + */ + public SystemDataModel withCreatedBy(String createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * Get the createdByType property: Gets or sets the type of identity that created the resource: user, application, + * managedIdentity. + * + * @return the createdByType value. + */ + public String createdByType() { + return this.createdByType; + } + + /** + * Set the createdByType property: Gets or sets the type of identity that created the resource: user, application, + * managedIdentity. + * + * @param createdByType the createdByType value to set. + * @return the SystemDataModel object itself. + */ + public SystemDataModel withCreatedByType(String createdByType) { + this.createdByType = createdByType; + return this; + } + + /** + * Get the createdAt property: Gets or sets the timestamp of resource creation (UTC). + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Set the createdAt property: Gets or sets the timestamp of resource creation (UTC). + * + * @param createdAt the createdAt value to set. + * @return the SystemDataModel object itself. + */ + public SystemDataModel withCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get the lastModifiedBy property: Gets or sets the identity that last modified the resource. + * + * @return the lastModifiedBy value. + */ + public String lastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * Set the lastModifiedBy property: Gets or sets the identity that last modified the resource. + * + * @param lastModifiedBy the lastModifiedBy value to set. + * @return the SystemDataModel object itself. + */ + public SystemDataModel withLastModifiedBy(String lastModifiedBy) { + this.lastModifiedBy = lastModifiedBy; + return this; + } + + /** + * Get the lastModifiedByType property: Gets or sets the type of identity that last modified the resource: user, + * application, managedIdentity. + * + * @return the lastModifiedByType value. + */ + public String lastModifiedByType() { + return this.lastModifiedByType; + } + + /** + * Set the lastModifiedByType property: Gets or sets the type of identity that last modified the resource: user, + * application, managedIdentity. + * + * @param lastModifiedByType the lastModifiedByType value to set. + * @return the SystemDataModel object itself. + */ + public SystemDataModel withLastModifiedByType(String lastModifiedByType) { + this.lastModifiedByType = lastModifiedByType; + return this; + } + + /** + * Get the lastModifiedAt property: Gets or sets the timestamp of resource last modification (UTC). + * + * @return the lastModifiedAt value. + */ + public OffsetDateTime lastModifiedAt() { + return this.lastModifiedAt; + } + + /** + * Set the lastModifiedAt property: Gets or sets the timestamp of resource last modification (UTC). + * + * @param lastModifiedAt the lastModifiedAt value to set. + * @return the SystemDataModel object itself. + */ + public SystemDataModel withLastModifiedAt(OffsetDateTime lastModifiedAt) { + this.lastModifiedAt = lastModifiedAt; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TaskModel.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TaskModel.java new file mode 100644 index 000000000000..61e7f1fcd112 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TaskModel.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.WorkflowModelInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Task model. */ +@Fluent +public final class TaskModel { + /* + * Gets or sets the task name. + */ + @JsonProperty(value = "taskName", access = JsonProperty.Access.WRITE_ONLY) + private String taskName; + + /* + * Gets or sets the task state. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private TaskState state; + + /* + * Gets or sets the start time. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTime; + + /* + * Gets or sets the end time. + */ + @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endTime; + + /* + * Task model custom properties. + */ + @JsonProperty(value = "customProperties") + private TaskModelCustomProperties customProperties; + + /* + * Gets or sets the list of children workflow models. + */ + @JsonProperty(value = "childrenWorkflows") + private List childrenWorkflows; + + /** Creates an instance of TaskModel class. */ + public TaskModel() { + } + + /** + * Get the taskName property: Gets or sets the task name. + * + * @return the taskName value. + */ + public String taskName() { + return this.taskName; + } + + /** + * Get the state property: Gets or sets the task state. + * + * @return the state value. + */ + public TaskState state() { + return this.state; + } + + /** + * Get the startTime property: Gets or sets the start time. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: Gets or sets the end time. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Get the customProperties property: Task model custom properties. + * + * @return the customProperties value. + */ + public TaskModelCustomProperties customProperties() { + return this.customProperties; + } + + /** + * Set the customProperties property: Task model custom properties. + * + * @param customProperties the customProperties value to set. + * @return the TaskModel object itself. + */ + public TaskModel withCustomProperties(TaskModelCustomProperties customProperties) { + this.customProperties = customProperties; + return this; + } + + /** + * Get the childrenWorkflows property: Gets or sets the list of children workflow models. + * + * @return the childrenWorkflows value. + */ + public List childrenWorkflows() { + return this.childrenWorkflows; + } + + /** + * Set the childrenWorkflows property: Gets or sets the list of children workflow models. + * + * @param childrenWorkflows the childrenWorkflows value to set. + * @return the TaskModel object itself. + */ + public TaskModel withChildrenWorkflows(List childrenWorkflows) { + this.childrenWorkflows = childrenWorkflows; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (customProperties() != null) { + customProperties().validate(); + } + if (childrenWorkflows() != null) { + childrenWorkflows().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TaskModelCustomProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TaskModelCustomProperties.java new file mode 100644 index 000000000000..d9ac5f5994ad --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TaskModelCustomProperties.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Task model custom properties. */ +@Fluent +public final class TaskModelCustomProperties { + /* + * Gets or sets the instance type. + */ + @JsonProperty(value = "instanceType", required = true) + private String instanceType; + + /** Creates an instance of TaskModelCustomProperties class. */ + public TaskModelCustomProperties() { + } + + /** + * Get the instanceType property: Gets or sets the instance type. + * + * @return the instanceType value. + */ + public String instanceType() { + return this.instanceType; + } + + /** + * Set the instanceType property: Gets or sets the instance type. + * + * @param instanceType the instanceType value to set. + * @return the TaskModelCustomProperties object itself. + */ + public TaskModelCustomProperties withInstanceType(String instanceType) { + this.instanceType = instanceType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (instanceType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property instanceType in model TaskModelCustomProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TaskModelCustomProperties.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TaskState.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TaskState.java new file mode 100644 index 000000000000..5b1552f11d29 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TaskState.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Gets or sets the task state. */ +public final class TaskState extends ExpandableStringEnum { + /** Static value Pending for TaskState. */ + public static final TaskState PENDING = fromString("Pending"); + + /** Static value Started for TaskState. */ + public static final TaskState STARTED = fromString("Started"); + + /** Static value Succeeded for TaskState. */ + public static final TaskState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for TaskState. */ + public static final TaskState FAILED = fromString("Failed"); + + /** Static value Cancelled for TaskState. */ + public static final TaskState CANCELLED = fromString("Cancelled"); + + /** Static value Skipped for TaskState. */ + public static final TaskState SKIPPED = fromString("Skipped"); + + /** + * Creates a new instance of TaskState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TaskState() { + } + + /** + * Creates or finds a TaskState from its string representation. + * + * @param name a name to look for. + * @return the corresponding TaskState. + */ + @JsonCreator + public static TaskState fromString(String name) { + return fromString(name, TaskState.class); + } + + /** + * Gets known TaskState values. + * + * @return known TaskState values. + */ + public static Collection values() { + return values(TaskState.class); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TestFailoverCleanupWorkflowModelCustomProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TestFailoverCleanupWorkflowModelCustomProperties.java new file mode 100644 index 000000000000..48b859e77c80 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TestFailoverCleanupWorkflowModelCustomProperties.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Test failover cleanup workflow model custom properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("TestFailoverCleanupWorkflowDetails") +@Immutable +public final class TestFailoverCleanupWorkflowModelCustomProperties extends WorkflowModelCustomProperties { + /* + * Gets or sets the test failover cleanup comments. + */ + @JsonProperty(value = "comments", access = JsonProperty.Access.WRITE_ONLY) + private String comments; + + /** Creates an instance of TestFailoverCleanupWorkflowModelCustomProperties class. */ + public TestFailoverCleanupWorkflowModelCustomProperties() { + } + + /** + * Get the comments property: Gets or sets the test failover cleanup comments. + * + * @return the comments value. + */ + public String comments() { + return this.comments; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TestFailoverState.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TestFailoverState.java new file mode 100644 index 000000000000..460aa9a39962 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TestFailoverState.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.recoveryservicesdatareplication.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Gets or sets the test failover state. */ +public final class TestFailoverState extends ExpandableStringEnum { + /** Static value None for TestFailoverState. */ + public static final TestFailoverState NONE = fromString("None"); + + /** Static value TestFailoverInitiated for TestFailoverState. */ + public static final TestFailoverState TEST_FAILOVER_INITIATED = fromString("TestFailoverInitiated"); + + /** Static value TestFailoverCompleting for TestFailoverState. */ + public static final TestFailoverState TEST_FAILOVER_COMPLETING = fromString("TestFailoverCompleting"); + + /** Static value TestFailoverCompleted for TestFailoverState. */ + public static final TestFailoverState TEST_FAILOVER_COMPLETED = fromString("TestFailoverCompleted"); + + /** Static value TestFailoverFailed for TestFailoverState. */ + public static final TestFailoverState TEST_FAILOVER_FAILED = fromString("TestFailoverFailed"); + + /** Static value TestFailoverCompletionFailed for TestFailoverState. */ + public static final TestFailoverState TEST_FAILOVER_COMPLETION_FAILED = fromString("TestFailoverCompletionFailed"); + + /** Static value TestFailoverCleanupInitiated for TestFailoverState. */ + public static final TestFailoverState TEST_FAILOVER_CLEANUP_INITIATED = fromString("TestFailoverCleanupInitiated"); + + /** Static value TestFailoverCleanupCompleting for TestFailoverState. */ + public static final TestFailoverState TEST_FAILOVER_CLEANUP_COMPLETING = + fromString("TestFailoverCleanupCompleting"); + + /** Static value MarkedForDeletion for TestFailoverState. */ + public static final TestFailoverState MARKED_FOR_DELETION = fromString("MarkedForDeletion"); + + /** + * Creates a new instance of TestFailoverState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TestFailoverState() { + } + + /** + * Creates or finds a TestFailoverState from its string representation. + * + * @param name a name to look for. + * @return the corresponding TestFailoverState. + */ + @JsonCreator + public static TestFailoverState fromString(String name) { + return fromString(name, TestFailoverState.class); + } + + /** + * Gets known TestFailoverState values. + * + * @return known TestFailoverState values. + */ + public static Collection values() { + return values(TestFailoverState.class); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TestFailoverWorkflowModelCustomProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TestFailoverWorkflowModelCustomProperties.java new file mode 100644 index 000000000000..cded655ef93c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/TestFailoverWorkflowModelCustomProperties.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Test failover workflow model custom properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("TestFailoverWorkflowDetails") +@Immutable +public final class TestFailoverWorkflowModelCustomProperties extends WorkflowModelCustomProperties { + /* + * Gets or sets the test VM details. + */ + @JsonProperty(value = "protectedItemDetails", access = JsonProperty.Access.WRITE_ONLY) + private List protectedItemDetails; + + /** Creates an instance of TestFailoverWorkflowModelCustomProperties class. */ + public TestFailoverWorkflowModelCustomProperties() { + } + + /** + * Get the protectedItemDetails property: Gets or sets the test VM details. + * + * @return the protectedItemDetails value. + */ + public List protectedItemDetails() { + return this.protectedItemDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (protectedItemDetails() != null) { + protectedItemDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMNicSelection.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMNicSelection.java new file mode 100644 index 000000000000..50ffa42656b4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMNicSelection.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.recoveryservicesdatareplication.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Gets or sets the selection type of the NIC. */ +public final class VMNicSelection extends ExpandableStringEnum { + /** Static value NotSelected for VMNicSelection. */ + public static final VMNicSelection NOT_SELECTED = fromString("NotSelected"); + + /** Static value SelectedByUser for VMNicSelection. */ + public static final VMNicSelection SELECTED_BY_USER = fromString("SelectedByUser"); + + /** Static value SelectedByDefault for VMNicSelection. */ + public static final VMNicSelection SELECTED_BY_DEFAULT = fromString("SelectedByDefault"); + + /** Static value SelectedByUserOverride for VMNicSelection. */ + public static final VMNicSelection SELECTED_BY_USER_OVERRIDE = fromString("SelectedByUserOverride"); + + /** + * Creates a new instance of VMNicSelection value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VMNicSelection() { + } + + /** + * Creates or finds a VMNicSelection from its string representation. + * + * @param name a name to look for. + * @return the corresponding VMNicSelection. + */ + @JsonCreator + public static VMNicSelection fromString(String name) { + return fromString(name, VMNicSelection.class); + } + + /** + * Gets known VMNicSelection values. + * + * @return known VMNicSelection values. + */ + public static Collection values() { + return values(VMNicSelection.class); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareDraModelCustomProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareDraModelCustomProperties.java new file mode 100644 index 000000000000..83118c1cbb96 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareDraModelCustomProperties.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** VMware DRA model custom properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VMware") +@Fluent +public final class VMwareDraModelCustomProperties extends DraModelCustomProperties { + /* + * Gets or sets the BIOS Id of the DRA machine. + */ + @JsonProperty(value = "biosId", required = true) + private String biosId; + + /* + * Identity model. + */ + @JsonProperty(value = "marsAuthenticationIdentity", required = true) + private IdentityModel marsAuthenticationIdentity; + + /** Creates an instance of VMwareDraModelCustomProperties class. */ + public VMwareDraModelCustomProperties() { + } + + /** + * Get the biosId property: Gets or sets the BIOS Id of the DRA machine. + * + * @return the biosId value. + */ + public String biosId() { + return this.biosId; + } + + /** + * Set the biosId property: Gets or sets the BIOS Id of the DRA machine. + * + * @param biosId the biosId value to set. + * @return the VMwareDraModelCustomProperties object itself. + */ + public VMwareDraModelCustomProperties withBiosId(String biosId) { + this.biosId = biosId; + return this; + } + + /** + * Get the marsAuthenticationIdentity property: Identity model. + * + * @return the marsAuthenticationIdentity value. + */ + public IdentityModel marsAuthenticationIdentity() { + return this.marsAuthenticationIdentity; + } + + /** + * Set the marsAuthenticationIdentity property: Identity model. + * + * @param marsAuthenticationIdentity the marsAuthenticationIdentity value to set. + * @return the VMwareDraModelCustomProperties object itself. + */ + public VMwareDraModelCustomProperties withMarsAuthenticationIdentity(IdentityModel marsAuthenticationIdentity) { + this.marsAuthenticationIdentity = marsAuthenticationIdentity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (biosId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property biosId in model VMwareDraModelCustomProperties")); + } + if (marsAuthenticationIdentity() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property marsAuthenticationIdentity in model" + + " VMwareDraModelCustomProperties")); + } else { + marsAuthenticationIdentity().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VMwareDraModelCustomProperties.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareMigrateFabricModelCustomProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareMigrateFabricModelCustomProperties.java new file mode 100644 index 000000000000..aadba03198d5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareMigrateFabricModelCustomProperties.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** VMware migrate fabric model custom properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VMwareMigrate") +@Fluent +public final class VMwareMigrateFabricModelCustomProperties extends FabricModelCustomProperties { + /* + * Gets or sets the ARM Id of the VMware site. + */ + @JsonProperty(value = "vmwareSiteId", required = true) + private String vmwareSiteId; + + /* + * Gets or sets the ARM Id of the migration solution. + */ + @JsonProperty(value = "migrationSolutionId", required = true) + private String migrationSolutionId; + + /** Creates an instance of VMwareMigrateFabricModelCustomProperties class. */ + public VMwareMigrateFabricModelCustomProperties() { + } + + /** + * Get the vmwareSiteId property: Gets or sets the ARM Id of the VMware site. + * + * @return the vmwareSiteId value. + */ + public String vmwareSiteId() { + return this.vmwareSiteId; + } + + /** + * Set the vmwareSiteId property: Gets or sets the ARM Id of the VMware site. + * + * @param vmwareSiteId the vmwareSiteId value to set. + * @return the VMwareMigrateFabricModelCustomProperties object itself. + */ + public VMwareMigrateFabricModelCustomProperties withVmwareSiteId(String vmwareSiteId) { + this.vmwareSiteId = vmwareSiteId; + return this; + } + + /** + * Get the migrationSolutionId property: Gets or sets the ARM Id of the migration solution. + * + * @return the migrationSolutionId value. + */ + public String migrationSolutionId() { + return this.migrationSolutionId; + } + + /** + * Set the migrationSolutionId property: Gets or sets the ARM Id of the migration solution. + * + * @param migrationSolutionId the migrationSolutionId value to set. + * @return the VMwareMigrateFabricModelCustomProperties object itself. + */ + public VMwareMigrateFabricModelCustomProperties withMigrationSolutionId(String migrationSolutionId) { + this.migrationSolutionId = migrationSolutionId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (vmwareSiteId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property vmwareSiteId in model VMwareMigrateFabricModelCustomProperties")); + } + if (migrationSolutionId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property migrationSolutionId in model" + + " VMwareMigrateFabricModelCustomProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VMwareMigrateFabricModelCustomProperties.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciDiskInput.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciDiskInput.java new file mode 100644 index 000000000000..23854d7d595c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciDiskInput.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VMwareToAzStack disk input. */ +@Fluent +public final class VMwareToAzStackHciDiskInput { + /* + * Gets or sets the disk Id. + */ + @JsonProperty(value = "diskId", required = true) + private String diskId; + + /* + * Gets or sets the target storage account ARM Id. + */ + @JsonProperty(value = "storageContainerId") + private String storageContainerId; + + /* + * Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard + * disk. + */ + @JsonProperty(value = "isDynamic") + private Boolean isDynamic; + + /* + * Gets or sets the disk size in GB. + */ + @JsonProperty(value = "diskSizeGB", required = true) + private long diskSizeGB; + + /* + * Gets or sets the type of the virtual hard disk, vhd or vhdx. + */ + @JsonProperty(value = "diskFileFormat", required = true) + private String diskFileFormat; + + /* + * Gets or sets a value indicating whether disk is os disk. + */ + @JsonProperty(value = "isOsDisk", required = true) + private boolean isOsDisk; + + /** Creates an instance of VMwareToAzStackHciDiskInput class. */ + public VMwareToAzStackHciDiskInput() { + } + + /** + * Get the diskId property: Gets or sets the disk Id. + * + * @return the diskId value. + */ + public String diskId() { + return this.diskId; + } + + /** + * Set the diskId property: Gets or sets the disk Id. + * + * @param diskId the diskId value to set. + * @return the VMwareToAzStackHciDiskInput object itself. + */ + public VMwareToAzStackHciDiskInput withDiskId(String diskId) { + this.diskId = diskId; + return this; + } + + /** + * Get the storageContainerId property: Gets or sets the target storage account ARM Id. + * + * @return the storageContainerId value. + */ + public String storageContainerId() { + return this.storageContainerId; + } + + /** + * Set the storageContainerId property: Gets or sets the target storage account ARM Id. + * + * @param storageContainerId the storageContainerId value to set. + * @return the VMwareToAzStackHciDiskInput object itself. + */ + public VMwareToAzStackHciDiskInput withStorageContainerId(String storageContainerId) { + this.storageContainerId = storageContainerId; + return this; + } + + /** + * Get the isDynamic property: Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard + * disk. + * + * @return the isDynamic value. + */ + public Boolean isDynamic() { + return this.isDynamic; + } + + /** + * Set the isDynamic property: Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard + * disk. + * + * @param isDynamic the isDynamic value to set. + * @return the VMwareToAzStackHciDiskInput object itself. + */ + public VMwareToAzStackHciDiskInput withIsDynamic(Boolean isDynamic) { + this.isDynamic = isDynamic; + return this; + } + + /** + * Get the diskSizeGB property: Gets or sets the disk size in GB. + * + * @return the diskSizeGB value. + */ + public long diskSizeGB() { + return this.diskSizeGB; + } + + /** + * Set the diskSizeGB property: Gets or sets the disk size in GB. + * + * @param diskSizeGB the diskSizeGB value to set. + * @return the VMwareToAzStackHciDiskInput object itself. + */ + public VMwareToAzStackHciDiskInput withDiskSizeGB(long diskSizeGB) { + this.diskSizeGB = diskSizeGB; + return this; + } + + /** + * Get the diskFileFormat property: Gets or sets the type of the virtual hard disk, vhd or vhdx. + * + * @return the diskFileFormat value. + */ + public String diskFileFormat() { + return this.diskFileFormat; + } + + /** + * Set the diskFileFormat property: Gets or sets the type of the virtual hard disk, vhd or vhdx. + * + * @param diskFileFormat the diskFileFormat value to set. + * @return the VMwareToAzStackHciDiskInput object itself. + */ + public VMwareToAzStackHciDiskInput withDiskFileFormat(String diskFileFormat) { + this.diskFileFormat = diskFileFormat; + return this; + } + + /** + * Get the isOsDisk property: Gets or sets a value indicating whether disk is os disk. + * + * @return the isOsDisk value. + */ + public boolean isOsDisk() { + return this.isOsDisk; + } + + /** + * Set the isOsDisk property: Gets or sets a value indicating whether disk is os disk. + * + * @param isOsDisk the isOsDisk value to set. + * @return the VMwareToAzStackHciDiskInput object itself. + */ + public VMwareToAzStackHciDiskInput withIsOsDisk(boolean isOsDisk) { + this.isOsDisk = isOsDisk; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (diskId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property diskId in model VMwareToAzStackHciDiskInput")); + } + if (diskFileFormat() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property diskFileFormat in model VMwareToAzStackHciDiskInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VMwareToAzStackHciDiskInput.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciNicInput.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciNicInput.java new file mode 100644 index 000000000000..0ac5cce0a094 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciNicInput.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VMwareToAzStackHCI NIC properties. */ +@Fluent +public final class VMwareToAzStackHciNicInput { + /* + * Gets or sets the NIC Id. + */ + @JsonProperty(value = "nicId", required = true) + private String nicId; + + /* + * Gets or sets the NIC label. + */ + @JsonProperty(value = "label", required = true) + private String label; + + /* + * Gets or sets the network name. + */ + @JsonProperty(value = "networkName", access = JsonProperty.Access.WRITE_ONLY) + private String networkName; + + /* + * Gets or sets the target network Id within AzStackHCI Cluster. + */ + @JsonProperty(value = "targetNetworkId", required = true) + private String targetNetworkId; + + /* + * Gets or sets the target test network Id within AzStackHCI Cluster. + */ + @JsonProperty(value = "testNetworkId", required = true) + private String testNetworkId; + + /* + * Gets or sets the selection type of the NIC. + */ + @JsonProperty(value = "selectionTypeForFailover", required = true) + private VMNicSelection selectionTypeForFailover; + + /** Creates an instance of VMwareToAzStackHciNicInput class. */ + public VMwareToAzStackHciNicInput() { + } + + /** + * Get the nicId property: Gets or sets the NIC Id. + * + * @return the nicId value. + */ + public String nicId() { + return this.nicId; + } + + /** + * Set the nicId property: Gets or sets the NIC Id. + * + * @param nicId the nicId value to set. + * @return the VMwareToAzStackHciNicInput object itself. + */ + public VMwareToAzStackHciNicInput withNicId(String nicId) { + this.nicId = nicId; + return this; + } + + /** + * Get the label property: Gets or sets the NIC label. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Set the label property: Gets or sets the NIC label. + * + * @param label the label value to set. + * @return the VMwareToAzStackHciNicInput object itself. + */ + public VMwareToAzStackHciNicInput withLabel(String label) { + this.label = label; + return this; + } + + /** + * Get the networkName property: Gets or sets the network name. + * + * @return the networkName value. + */ + public String networkName() { + return this.networkName; + } + + /** + * Get the targetNetworkId property: Gets or sets the target network Id within AzStackHCI Cluster. + * + * @return the targetNetworkId value. + */ + public String targetNetworkId() { + return this.targetNetworkId; + } + + /** + * Set the targetNetworkId property: Gets or sets the target network Id within AzStackHCI Cluster. + * + * @param targetNetworkId the targetNetworkId value to set. + * @return the VMwareToAzStackHciNicInput object itself. + */ + public VMwareToAzStackHciNicInput withTargetNetworkId(String targetNetworkId) { + this.targetNetworkId = targetNetworkId; + return this; + } + + /** + * Get the testNetworkId property: Gets or sets the target test network Id within AzStackHCI Cluster. + * + * @return the testNetworkId value. + */ + public String testNetworkId() { + return this.testNetworkId; + } + + /** + * Set the testNetworkId property: Gets or sets the target test network Id within AzStackHCI Cluster. + * + * @param testNetworkId the testNetworkId value to set. + * @return the VMwareToAzStackHciNicInput object itself. + */ + public VMwareToAzStackHciNicInput withTestNetworkId(String testNetworkId) { + this.testNetworkId = testNetworkId; + return this; + } + + /** + * Get the selectionTypeForFailover property: Gets or sets the selection type of the NIC. + * + * @return the selectionTypeForFailover value. + */ + public VMNicSelection selectionTypeForFailover() { + return this.selectionTypeForFailover; + } + + /** + * Set the selectionTypeForFailover property: Gets or sets the selection type of the NIC. + * + * @param selectionTypeForFailover the selectionTypeForFailover value to set. + * @return the VMwareToAzStackHciNicInput object itself. + */ + public VMwareToAzStackHciNicInput withSelectionTypeForFailover(VMNicSelection selectionTypeForFailover) { + this.selectionTypeForFailover = selectionTypeForFailover; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (nicId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property nicId in model VMwareToAzStackHciNicInput")); + } + if (label() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property label in model VMwareToAzStackHciNicInput")); + } + if (targetNetworkId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetNetworkId in model VMwareToAzStackHciNicInput")); + } + if (testNetworkId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property testNetworkId in model VMwareToAzStackHciNicInput")); + } + if (selectionTypeForFailover() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectionTypeForFailover in model VMwareToAzStackHciNicInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VMwareToAzStackHciNicInput.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciPlannedFailoverCustomProps.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciPlannedFailoverCustomProps.java new file mode 100644 index 000000000000..81d3bc78ba68 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciPlannedFailoverCustomProps.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** VMware to AzStackHCI planned failover model custom properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VMwareToAzStackHCI") +@Fluent +public final class VMwareToAzStackHciPlannedFailoverCustomProps extends PlannedFailoverModelCustomProperties { + /* + * Gets or sets a value indicating whether VM needs to be shut down. + */ + @JsonProperty(value = "shutdownSourceVM", required = true) + private boolean shutdownSourceVM; + + /** Creates an instance of VMwareToAzStackHciPlannedFailoverCustomProps class. */ + public VMwareToAzStackHciPlannedFailoverCustomProps() { + } + + /** + * Get the shutdownSourceVM property: Gets or sets a value indicating whether VM needs to be shut down. + * + * @return the shutdownSourceVM value. + */ + public boolean shutdownSourceVM() { + return this.shutdownSourceVM; + } + + /** + * Set the shutdownSourceVM property: Gets or sets a value indicating whether VM needs to be shut down. + * + * @param shutdownSourceVM the shutdownSourceVM value to set. + * @return the VMwareToAzStackHciPlannedFailoverCustomProps object itself. + */ + public VMwareToAzStackHciPlannedFailoverCustomProps withShutdownSourceVM(boolean shutdownSourceVM) { + this.shutdownSourceVM = shutdownSourceVM; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciPolicyModelCustomProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciPolicyModelCustomProperties.java new file mode 100644 index 000000000000..3e43cfb5aa57 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciPolicyModelCustomProperties.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** VMware To AzStackHCI Policy model custom properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VMwareToAzStackHCI") +@Fluent +public final class VMwareToAzStackHciPolicyModelCustomProperties extends PolicyModelCustomProperties { + /* + * Gets or sets the duration in minutes until which the recovery points need to be + * stored. + */ + @JsonProperty(value = "recoveryPointHistoryInMinutes", required = true) + private int recoveryPointHistoryInMinutes; + + /* + * Gets or sets the crash consistent snapshot frequency (in minutes). + */ + @JsonProperty(value = "crashConsistentFrequencyInMinutes", required = true) + private int crashConsistentFrequencyInMinutes; + + /* + * Gets or sets the app consistent snapshot frequency (in minutes). + */ + @JsonProperty(value = "appConsistentFrequencyInMinutes", required = true) + private int appConsistentFrequencyInMinutes; + + /** Creates an instance of VMwareToAzStackHciPolicyModelCustomProperties class. */ + public VMwareToAzStackHciPolicyModelCustomProperties() { + } + + /** + * Get the recoveryPointHistoryInMinutes property: Gets or sets the duration in minutes until which the recovery + * points need to be stored. + * + * @return the recoveryPointHistoryInMinutes value. + */ + public int recoveryPointHistoryInMinutes() { + return this.recoveryPointHistoryInMinutes; + } + + /** + * Set the recoveryPointHistoryInMinutes property: Gets or sets the duration in minutes until which the recovery + * points need to be stored. + * + * @param recoveryPointHistoryInMinutes the recoveryPointHistoryInMinutes value to set. + * @return the VMwareToAzStackHciPolicyModelCustomProperties object itself. + */ + public VMwareToAzStackHciPolicyModelCustomProperties withRecoveryPointHistoryInMinutes( + int recoveryPointHistoryInMinutes) { + this.recoveryPointHistoryInMinutes = recoveryPointHistoryInMinutes; + return this; + } + + /** + * Get the crashConsistentFrequencyInMinutes property: Gets or sets the crash consistent snapshot frequency (in + * minutes). + * + * @return the crashConsistentFrequencyInMinutes value. + */ + public int crashConsistentFrequencyInMinutes() { + return this.crashConsistentFrequencyInMinutes; + } + + /** + * Set the crashConsistentFrequencyInMinutes property: Gets or sets the crash consistent snapshot frequency (in + * minutes). + * + * @param crashConsistentFrequencyInMinutes the crashConsistentFrequencyInMinutes value to set. + * @return the VMwareToAzStackHciPolicyModelCustomProperties object itself. + */ + public VMwareToAzStackHciPolicyModelCustomProperties withCrashConsistentFrequencyInMinutes( + int crashConsistentFrequencyInMinutes) { + this.crashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + return this; + } + + /** + * Get the appConsistentFrequencyInMinutes property: Gets or sets the app consistent snapshot frequency (in + * minutes). + * + * @return the appConsistentFrequencyInMinutes value. + */ + public int appConsistentFrequencyInMinutes() { + return this.appConsistentFrequencyInMinutes; + } + + /** + * Set the appConsistentFrequencyInMinutes property: Gets or sets the app consistent snapshot frequency (in + * minutes). + * + * @param appConsistentFrequencyInMinutes the appConsistentFrequencyInMinutes value to set. + * @return the VMwareToAzStackHciPolicyModelCustomProperties object itself. + */ + public VMwareToAzStackHciPolicyModelCustomProperties withAppConsistentFrequencyInMinutes( + int appConsistentFrequencyInMinutes) { + this.appConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciProtectedDiskProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciProtectedDiskProperties.java new file mode 100644 index 000000000000..2ca9194cdf7a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciProtectedDiskProperties.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VMwareToAzStackHCI protected disk properties. */ +@Immutable +public final class VMwareToAzStackHciProtectedDiskProperties { + /* + * Gets or sets the ARM Id of the storage container. + */ + @JsonProperty(value = "storageContainerId", access = JsonProperty.Access.WRITE_ONLY) + private String storageContainerId; + + /* + * Gets or sets the local path of the storage container. + */ + @JsonProperty(value = "storageContainerLocalPath", access = JsonProperty.Access.WRITE_ONLY) + private String storageContainerLocalPath; + + /* + * Gets or sets the source disk Id. + */ + @JsonProperty(value = "sourceDiskId", access = JsonProperty.Access.WRITE_ONLY) + private String sourceDiskId; + + /* + * Gets or sets the source disk Name. + */ + @JsonProperty(value = "sourceDiskName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceDiskName; + + /* + * Gets or sets the seed disk name. + */ + @JsonProperty(value = "seedDiskName", access = JsonProperty.Access.WRITE_ONLY) + private String seedDiskName; + + /* + * Gets or sets the test failover clone disk. + */ + @JsonProperty(value = "testMigrateDiskName", access = JsonProperty.Access.WRITE_ONLY) + private String testMigrateDiskName; + + /* + * Gets or sets the failover clone disk. + */ + @JsonProperty(value = "migrateDiskName", access = JsonProperty.Access.WRITE_ONLY) + private String migrateDiskName; + + /* + * Gets or sets a value indicating whether the disk is the OS disk. + */ + @JsonProperty(value = "isOsDisk", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isOsDisk; + + /* + * Gets or sets the disk capacity in bytes. + */ + @JsonProperty(value = "capacityInBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long capacityInBytes; + + /* + * Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard + * disk. + */ + @JsonProperty(value = "isDynamic", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDynamic; + + /* + * Gets or sets the disk type. + */ + @JsonProperty(value = "diskType", access = JsonProperty.Access.WRITE_ONLY) + private String diskType; + + /** Creates an instance of VMwareToAzStackHciProtectedDiskProperties class. */ + public VMwareToAzStackHciProtectedDiskProperties() { + } + + /** + * Get the storageContainerId property: Gets or sets the ARM Id of the storage container. + * + * @return the storageContainerId value. + */ + public String storageContainerId() { + return this.storageContainerId; + } + + /** + * Get the storageContainerLocalPath property: Gets or sets the local path of the storage container. + * + * @return the storageContainerLocalPath value. + */ + public String storageContainerLocalPath() { + return this.storageContainerLocalPath; + } + + /** + * Get the sourceDiskId property: Gets or sets the source disk Id. + * + * @return the sourceDiskId value. + */ + public String sourceDiskId() { + return this.sourceDiskId; + } + + /** + * Get the sourceDiskName property: Gets or sets the source disk Name. + * + * @return the sourceDiskName value. + */ + public String sourceDiskName() { + return this.sourceDiskName; + } + + /** + * Get the seedDiskName property: Gets or sets the seed disk name. + * + * @return the seedDiskName value. + */ + public String seedDiskName() { + return this.seedDiskName; + } + + /** + * Get the testMigrateDiskName property: Gets or sets the test failover clone disk. + * + * @return the testMigrateDiskName value. + */ + public String testMigrateDiskName() { + return this.testMigrateDiskName; + } + + /** + * Get the migrateDiskName property: Gets or sets the failover clone disk. + * + * @return the migrateDiskName value. + */ + public String migrateDiskName() { + return this.migrateDiskName; + } + + /** + * Get the isOsDisk property: Gets or sets a value indicating whether the disk is the OS disk. + * + * @return the isOsDisk value. + */ + public Boolean isOsDisk() { + return this.isOsDisk; + } + + /** + * Get the capacityInBytes property: Gets or sets the disk capacity in bytes. + * + * @return the capacityInBytes value. + */ + public Long capacityInBytes() { + return this.capacityInBytes; + } + + /** + * Get the isDynamic property: Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard + * disk. + * + * @return the isDynamic value. + */ + public Boolean isDynamic() { + return this.isDynamic; + } + + /** + * Get the diskType property: Gets or sets the disk type. + * + * @return the diskType value. + */ + public String diskType() { + return this.diskType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciProtectedItemCustomProps.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciProtectedItemCustomProps.java new file mode 100644 index 000000000000..dbe3c23f1713 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciProtectedItemCustomProps.java @@ -0,0 +1,1049 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** VMware to AzStackHCI Protected item model custom properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VMwareToAzStackHCI") +@Fluent +public final class VMwareToAzStackHciProtectedItemCustomProps extends ProtectedItemModelCustomProperties { + /* + * Gets or sets the location of the protected item. + */ + @JsonProperty(value = "activeLocation", access = JsonProperty.Access.WRITE_ONLY) + private ProtectedItemActiveLocation activeLocation; + + /* + * Gets or sets the Target HCI Cluster ARM Id. + */ + @JsonProperty(value = "targetHciClusterId", required = true) + private String targetHciClusterId; + + /* + * Gets or sets the Target Arc Cluster Custom Location ARM Id. + */ + @JsonProperty(value = "targetArcClusterCustomLocationId", required = true) + private String targetArcClusterCustomLocationId; + + /* + * Gets or sets the Target AzStackHCI cluster name. + */ + @JsonProperty(value = "targetAzStackHciClusterName", access = JsonProperty.Access.WRITE_ONLY) + private String targetAzStackHciClusterName; + + /* + * Gets or sets the target storage container ARM Id. + */ + @JsonProperty(value = "storageContainerId", required = true) + private String storageContainerId; + + /* + * Gets or sets the target resource group ARM Id. + */ + @JsonProperty(value = "targetResourceGroupId", required = true) + private String targetResourceGroupId; + + /* + * Gets or sets the target location. + */ + @JsonProperty(value = "targetLocation", access = JsonProperty.Access.WRITE_ONLY) + private String targetLocation; + + /* + * Gets or sets the location of Azure Arc HCI custom location resource. + */ + @JsonProperty(value = "customLocationRegion", required = true) + private String customLocationRegion; + + /* + * Gets or sets the list of disks to replicate. + */ + @JsonProperty(value = "disksToInclude", required = true) + private List disksToInclude; + + /* + * Gets or sets the list of VM NIC to replicate. + */ + @JsonProperty(value = "nicsToInclude", required = true) + private List nicsToInclude; + + /* + * Gets or sets the list of protected disks. + */ + @JsonProperty(value = "protectedDisks", access = JsonProperty.Access.WRITE_ONLY) + private List protectedDisks; + + /* + * Gets or sets the VM NIC details. + */ + @JsonProperty(value = "protectedNics", access = JsonProperty.Access.WRITE_ONLY) + private List protectedNics; + + /* + * Gets or sets the BIOS Id of the target AzStackHCI VM. + */ + @JsonProperty(value = "targetVmBiosId", access = JsonProperty.Access.WRITE_ONLY) + private String targetVmBiosId; + + /* + * Gets or sets the target VM display name. + */ + @JsonProperty(value = "targetVmName") + private String targetVmName; + + /* + * Gets or sets the hypervisor generation of the virtual machine possible values are 1,2. + */ + @JsonProperty(value = "hyperVGeneration", required = true) + private String hyperVGeneration; + + /* + * Gets or sets the target network Id within AzStackHCI Cluster. + */ + @JsonProperty(value = "targetNetworkId") + private String targetNetworkId; + + /* + * Gets or sets the target test network Id within AzStackHCI Cluster. + */ + @JsonProperty(value = "testNetworkId") + private String testNetworkId; + + /* + * Gets or sets the target CPU cores. + */ + @JsonProperty(value = "targetCpuCores") + private Integer targetCpuCores; + + /* + * Gets or sets a value indicating whether memory is dynamical. + */ + @JsonProperty(value = "isDynamicRam") + private Boolean isDynamicRam; + + /* + * Protected item dynamic memory config. + */ + @JsonProperty(value = "dynamicMemoryConfig") + private ProtectedItemDynamicMemoryConfig dynamicMemoryConfig; + + /* + * Gets or sets the target memory in mega-bytes. + */ + @JsonProperty(value = "targetMemoryInMegaBytes") + private Integer targetMemoryInMegaBytes; + + /* + * Gets or sets the type of the OS. + */ + @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY) + private String osType; + + /* + * Gets or sets the name of the OS. + */ + @JsonProperty(value = "osName", access = JsonProperty.Access.WRITE_ONLY) + private String osName; + + /* + * Gets or sets the firmware type. + */ + @JsonProperty(value = "firmwareType", access = JsonProperty.Access.WRITE_ONLY) + private String firmwareType; + + /* + * Gets or sets the ARM Id of the discovered machine. + */ + @JsonProperty(value = "fabricDiscoveryMachineId", required = true) + private String fabricDiscoveryMachineId; + + /* + * Gets or sets the source VM display name. + */ + @JsonProperty(value = "sourceVmName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceVmName; + + /* + * Gets or sets the source VM CPU cores. + */ + @JsonProperty(value = "sourceCpuCores", access = JsonProperty.Access.WRITE_ONLY) + private Integer sourceCpuCores; + + /* + * Gets or sets the source VM ram memory size in megabytes. + */ + @JsonProperty(value = "sourceMemoryInMegaBytes", access = JsonProperty.Access.WRITE_ONLY) + private Double sourceMemoryInMegaBytes; + + /* + * Gets or sets the run as account Id. + */ + @JsonProperty(value = "runAsAccountId", required = true) + private String runAsAccountId; + + /* + * Gets or sets the source DRA name. + */ + @JsonProperty(value = "sourceDraName", required = true) + private String sourceDraName; + + /* + * Gets or sets the target DRA name. + */ + @JsonProperty(value = "targetDraName", required = true) + private String targetDraName; + + /* + * Gets or sets the source appliance name. + */ + @JsonProperty(value = "sourceApplianceName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceApplianceName; + + /* + * Gets or sets the target appliance name. + */ + @JsonProperty(value = "targetApplianceName", access = JsonProperty.Access.WRITE_ONLY) + private String targetApplianceName; + + /* + * Gets or sets the recovery point Id to which the VM was failed over. + */ + @JsonProperty(value = "failoverRecoveryPointId", access = JsonProperty.Access.WRITE_ONLY) + private String failoverRecoveryPointId; + + /* + * Gets or sets the last recovery point received time. + */ + @JsonProperty(value = "lastRecoveryPointReceived", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastRecoveryPointReceived; + + /* + * Gets or sets the last recovery point Id. + */ + @JsonProperty(value = "lastRecoveryPointId", access = JsonProperty.Access.WRITE_ONLY) + private String lastRecoveryPointId; + + /* + * Gets or sets the initial replication progress percentage. This is calculated based on + * total bytes processed for all disks in the source VM. + */ + @JsonProperty(value = "initialReplicationProgressPercentage", access = JsonProperty.Access.WRITE_ONLY) + private Integer initialReplicationProgressPercentage; + + /* + * Gets or sets the migration progress percentage. + */ + @JsonProperty(value = "migrationProgressPercentage", access = JsonProperty.Access.WRITE_ONLY) + private Integer migrationProgressPercentage; + + /* + * Gets or sets the resume progress percentage. + */ + @JsonProperty(value = "resumeProgressPercentage", access = JsonProperty.Access.WRITE_ONLY) + private Integer resumeProgressPercentage; + + /* + * Gets or sets the resync progress percentage. This is calculated based on total bytes + * processed for all disks in the source VM. + */ + @JsonProperty(value = "resyncProgressPercentage", access = JsonProperty.Access.WRITE_ONLY) + private Integer resyncProgressPercentage; + + /* + * Gets or sets the resync retry count. + */ + @JsonProperty(value = "resyncRetryCount", access = JsonProperty.Access.WRITE_ONLY) + private Long resyncRetryCount; + + /* + * Gets or sets a value indicating whether resync is required. + */ + @JsonProperty(value = "resyncRequired", access = JsonProperty.Access.WRITE_ONLY) + private Boolean resyncRequired; + + /* + * Gets or sets the resync state. + */ + @JsonProperty(value = "resyncState", access = JsonProperty.Access.WRITE_ONLY) + private VMwareToAzureMigrateResyncState resyncState; + + /* + * Gets or sets a value indicating whether auto resync is to be done. + */ + @JsonProperty(value = "performAutoResync") + private Boolean performAutoResync; + + /* + * Gets or sets the resume retry count. + */ + @JsonProperty(value = "resumeRetryCount", access = JsonProperty.Access.WRITE_ONLY) + private Long resumeRetryCount; + + /* + * Gets or sets the latest timestamp that replication status is updated. + */ + @JsonProperty(value = "lastReplicationUpdateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastReplicationUpdateTime; + + /** Creates an instance of VMwareToAzStackHciProtectedItemCustomProps class. */ + public VMwareToAzStackHciProtectedItemCustomProps() { + } + + /** + * Get the activeLocation property: Gets or sets the location of the protected item. + * + * @return the activeLocation value. + */ + public ProtectedItemActiveLocation activeLocation() { + return this.activeLocation; + } + + /** + * Get the targetHciClusterId property: Gets or sets the Target HCI Cluster ARM Id. + * + * @return the targetHciClusterId value. + */ + public String targetHciClusterId() { + return this.targetHciClusterId; + } + + /** + * Set the targetHciClusterId property: Gets or sets the Target HCI Cluster ARM Id. + * + * @param targetHciClusterId the targetHciClusterId value to set. + * @return the VMwareToAzStackHciProtectedItemCustomProps object itself. + */ + public VMwareToAzStackHciProtectedItemCustomProps withTargetHciClusterId(String targetHciClusterId) { + this.targetHciClusterId = targetHciClusterId; + return this; + } + + /** + * Get the targetArcClusterCustomLocationId property: Gets or sets the Target Arc Cluster Custom Location ARM Id. + * + * @return the targetArcClusterCustomLocationId value. + */ + public String targetArcClusterCustomLocationId() { + return this.targetArcClusterCustomLocationId; + } + + /** + * Set the targetArcClusterCustomLocationId property: Gets or sets the Target Arc Cluster Custom Location ARM Id. + * + * @param targetArcClusterCustomLocationId the targetArcClusterCustomLocationId value to set. + * @return the VMwareToAzStackHciProtectedItemCustomProps object itself. + */ + public VMwareToAzStackHciProtectedItemCustomProps withTargetArcClusterCustomLocationId( + String targetArcClusterCustomLocationId) { + this.targetArcClusterCustomLocationId = targetArcClusterCustomLocationId; + return this; + } + + /** + * Get the targetAzStackHciClusterName property: Gets or sets the Target AzStackHCI cluster name. + * + * @return the targetAzStackHciClusterName value. + */ + public String targetAzStackHciClusterName() { + return this.targetAzStackHciClusterName; + } + + /** + * Get the storageContainerId property: Gets or sets the target storage container ARM Id. + * + * @return the storageContainerId value. + */ + public String storageContainerId() { + return this.storageContainerId; + } + + /** + * Set the storageContainerId property: Gets or sets the target storage container ARM Id. + * + * @param storageContainerId the storageContainerId value to set. + * @return the VMwareToAzStackHciProtectedItemCustomProps object itself. + */ + public VMwareToAzStackHciProtectedItemCustomProps withStorageContainerId(String storageContainerId) { + this.storageContainerId = storageContainerId; + return this; + } + + /** + * Get the targetResourceGroupId property: Gets or sets the target resource group ARM Id. + * + * @return the targetResourceGroupId value. + */ + public String targetResourceGroupId() { + return this.targetResourceGroupId; + } + + /** + * Set the targetResourceGroupId property: Gets or sets the target resource group ARM Id. + * + * @param targetResourceGroupId the targetResourceGroupId value to set. + * @return the VMwareToAzStackHciProtectedItemCustomProps object itself. + */ + public VMwareToAzStackHciProtectedItemCustomProps withTargetResourceGroupId(String targetResourceGroupId) { + this.targetResourceGroupId = targetResourceGroupId; + return this; + } + + /** + * Get the targetLocation property: Gets or sets the target location. + * + * @return the targetLocation value. + */ + public String targetLocation() { + return this.targetLocation; + } + + /** + * Get the customLocationRegion property: Gets or sets the location of Azure Arc HCI custom location resource. + * + * @return the customLocationRegion value. + */ + public String customLocationRegion() { + return this.customLocationRegion; + } + + /** + * Set the customLocationRegion property: Gets or sets the location of Azure Arc HCI custom location resource. + * + * @param customLocationRegion the customLocationRegion value to set. + * @return the VMwareToAzStackHciProtectedItemCustomProps object itself. + */ + public VMwareToAzStackHciProtectedItemCustomProps withCustomLocationRegion(String customLocationRegion) { + this.customLocationRegion = customLocationRegion; + return this; + } + + /** + * Get the disksToInclude property: Gets or sets the list of disks to replicate. + * + * @return the disksToInclude value. + */ + public List disksToInclude() { + return this.disksToInclude; + } + + /** + * Set the disksToInclude property: Gets or sets the list of disks to replicate. + * + * @param disksToInclude the disksToInclude value to set. + * @return the VMwareToAzStackHciProtectedItemCustomProps object itself. + */ + public VMwareToAzStackHciProtectedItemCustomProps withDisksToInclude( + List disksToInclude) { + this.disksToInclude = disksToInclude; + return this; + } + + /** + * Get the nicsToInclude property: Gets or sets the list of VM NIC to replicate. + * + * @return the nicsToInclude value. + */ + public List nicsToInclude() { + return this.nicsToInclude; + } + + /** + * Set the nicsToInclude property: Gets or sets the list of VM NIC to replicate. + * + * @param nicsToInclude the nicsToInclude value to set. + * @return the VMwareToAzStackHciProtectedItemCustomProps object itself. + */ + public VMwareToAzStackHciProtectedItemCustomProps withNicsToInclude( + List nicsToInclude) { + this.nicsToInclude = nicsToInclude; + return this; + } + + /** + * Get the protectedDisks property: Gets or sets the list of protected disks. + * + * @return the protectedDisks value. + */ + public List protectedDisks() { + return this.protectedDisks; + } + + /** + * Get the protectedNics property: Gets or sets the VM NIC details. + * + * @return the protectedNics value. + */ + public List protectedNics() { + return this.protectedNics; + } + + /** + * Get the targetVmBiosId property: Gets or sets the BIOS Id of the target AzStackHCI VM. + * + * @return the targetVmBiosId value. + */ + public String targetVmBiosId() { + return this.targetVmBiosId; + } + + /** + * Get the targetVmName property: Gets or sets the target VM display name. + * + * @return the targetVmName value. + */ + public String targetVmName() { + return this.targetVmName; + } + + /** + * Set the targetVmName property: Gets or sets the target VM display name. + * + * @param targetVmName the targetVmName value to set. + * @return the VMwareToAzStackHciProtectedItemCustomProps object itself. + */ + public VMwareToAzStackHciProtectedItemCustomProps withTargetVmName(String targetVmName) { + this.targetVmName = targetVmName; + return this; + } + + /** + * Get the hyperVGeneration property: Gets or sets the hypervisor generation of the virtual machine possible values + * are 1,2. + * + * @return the hyperVGeneration value. + */ + public String hyperVGeneration() { + return this.hyperVGeneration; + } + + /** + * Set the hyperVGeneration property: Gets or sets the hypervisor generation of the virtual machine possible values + * are 1,2. + * + * @param hyperVGeneration the hyperVGeneration value to set. + * @return the VMwareToAzStackHciProtectedItemCustomProps object itself. + */ + public VMwareToAzStackHciProtectedItemCustomProps withHyperVGeneration(String hyperVGeneration) { + this.hyperVGeneration = hyperVGeneration; + return this; + } + + /** + * Get the targetNetworkId property: Gets or sets the target network Id within AzStackHCI Cluster. + * + * @return the targetNetworkId value. + */ + public String targetNetworkId() { + return this.targetNetworkId; + } + + /** + * Set the targetNetworkId property: Gets or sets the target network Id within AzStackHCI Cluster. + * + * @param targetNetworkId the targetNetworkId value to set. + * @return the VMwareToAzStackHciProtectedItemCustomProps object itself. + */ + public VMwareToAzStackHciProtectedItemCustomProps withTargetNetworkId(String targetNetworkId) { + this.targetNetworkId = targetNetworkId; + return this; + } + + /** + * Get the testNetworkId property: Gets or sets the target test network Id within AzStackHCI Cluster. + * + * @return the testNetworkId value. + */ + public String testNetworkId() { + return this.testNetworkId; + } + + /** + * Set the testNetworkId property: Gets or sets the target test network Id within AzStackHCI Cluster. + * + * @param testNetworkId the testNetworkId value to set. + * @return the VMwareToAzStackHciProtectedItemCustomProps object itself. + */ + public VMwareToAzStackHciProtectedItemCustomProps withTestNetworkId(String testNetworkId) { + this.testNetworkId = testNetworkId; + return this; + } + + /** + * Get the targetCpuCores property: Gets or sets the target CPU cores. + * + * @return the targetCpuCores value. + */ + public Integer targetCpuCores() { + return this.targetCpuCores; + } + + /** + * Set the targetCpuCores property: Gets or sets the target CPU cores. + * + * @param targetCpuCores the targetCpuCores value to set. + * @return the VMwareToAzStackHciProtectedItemCustomProps object itself. + */ + public VMwareToAzStackHciProtectedItemCustomProps withTargetCpuCores(Integer targetCpuCores) { + this.targetCpuCores = targetCpuCores; + return this; + } + + /** + * Get the isDynamicRam property: Gets or sets a value indicating whether memory is dynamical. + * + * @return the isDynamicRam value. + */ + public Boolean isDynamicRam() { + return this.isDynamicRam; + } + + /** + * Set the isDynamicRam property: Gets or sets a value indicating whether memory is dynamical. + * + * @param isDynamicRam the isDynamicRam value to set. + * @return the VMwareToAzStackHciProtectedItemCustomProps object itself. + */ + public VMwareToAzStackHciProtectedItemCustomProps withIsDynamicRam(Boolean isDynamicRam) { + this.isDynamicRam = isDynamicRam; + return this; + } + + /** + * Get the dynamicMemoryConfig property: Protected item dynamic memory config. + * + * @return the dynamicMemoryConfig value. + */ + public ProtectedItemDynamicMemoryConfig dynamicMemoryConfig() { + return this.dynamicMemoryConfig; + } + + /** + * Set the dynamicMemoryConfig property: Protected item dynamic memory config. + * + * @param dynamicMemoryConfig the dynamicMemoryConfig value to set. + * @return the VMwareToAzStackHciProtectedItemCustomProps object itself. + */ + public VMwareToAzStackHciProtectedItemCustomProps withDynamicMemoryConfig( + ProtectedItemDynamicMemoryConfig dynamicMemoryConfig) { + this.dynamicMemoryConfig = dynamicMemoryConfig; + return this; + } + + /** + * Get the targetMemoryInMegaBytes property: Gets or sets the target memory in mega-bytes. + * + * @return the targetMemoryInMegaBytes value. + */ + public Integer targetMemoryInMegaBytes() { + return this.targetMemoryInMegaBytes; + } + + /** + * Set the targetMemoryInMegaBytes property: Gets or sets the target memory in mega-bytes. + * + * @param targetMemoryInMegaBytes the targetMemoryInMegaBytes value to set. + * @return the VMwareToAzStackHciProtectedItemCustomProps object itself. + */ + public VMwareToAzStackHciProtectedItemCustomProps withTargetMemoryInMegaBytes(Integer targetMemoryInMegaBytes) { + this.targetMemoryInMegaBytes = targetMemoryInMegaBytes; + return this; + } + + /** + * Get the osType property: Gets or sets the type of the OS. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Get the osName property: Gets or sets the name of the OS. + * + * @return the osName value. + */ + public String osName() { + return this.osName; + } + + /** + * Get the firmwareType property: Gets or sets the firmware type. + * + * @return the firmwareType value. + */ + public String firmwareType() { + return this.firmwareType; + } + + /** + * Get the fabricDiscoveryMachineId property: Gets or sets the ARM Id of the discovered machine. + * + * @return the fabricDiscoveryMachineId value. + */ + public String fabricDiscoveryMachineId() { + return this.fabricDiscoveryMachineId; + } + + /** + * Set the fabricDiscoveryMachineId property: Gets or sets the ARM Id of the discovered machine. + * + * @param fabricDiscoveryMachineId the fabricDiscoveryMachineId value to set. + * @return the VMwareToAzStackHciProtectedItemCustomProps object itself. + */ + public VMwareToAzStackHciProtectedItemCustomProps withFabricDiscoveryMachineId(String fabricDiscoveryMachineId) { + this.fabricDiscoveryMachineId = fabricDiscoveryMachineId; + return this; + } + + /** + * Get the sourceVmName property: Gets or sets the source VM display name. + * + * @return the sourceVmName value. + */ + public String sourceVmName() { + return this.sourceVmName; + } + + /** + * Get the sourceCpuCores property: Gets or sets the source VM CPU cores. + * + * @return the sourceCpuCores value. + */ + public Integer sourceCpuCores() { + return this.sourceCpuCores; + } + + /** + * Get the sourceMemoryInMegaBytes property: Gets or sets the source VM ram memory size in megabytes. + * + * @return the sourceMemoryInMegaBytes value. + */ + public Double sourceMemoryInMegaBytes() { + return this.sourceMemoryInMegaBytes; + } + + /** + * Get the runAsAccountId property: Gets or sets the run as account Id. + * + * @return the runAsAccountId value. + */ + public String runAsAccountId() { + return this.runAsAccountId; + } + + /** + * Set the runAsAccountId property: Gets or sets the run as account Id. + * + * @param runAsAccountId the runAsAccountId value to set. + * @return the VMwareToAzStackHciProtectedItemCustomProps object itself. + */ + public VMwareToAzStackHciProtectedItemCustomProps withRunAsAccountId(String runAsAccountId) { + this.runAsAccountId = runAsAccountId; + return this; + } + + /** + * Get the sourceDraName property: Gets or sets the source DRA name. + * + * @return the sourceDraName value. + */ + public String sourceDraName() { + return this.sourceDraName; + } + + /** + * Set the sourceDraName property: Gets or sets the source DRA name. + * + * @param sourceDraName the sourceDraName value to set. + * @return the VMwareToAzStackHciProtectedItemCustomProps object itself. + */ + public VMwareToAzStackHciProtectedItemCustomProps withSourceDraName(String sourceDraName) { + this.sourceDraName = sourceDraName; + return this; + } + + /** + * Get the targetDraName property: Gets or sets the target DRA name. + * + * @return the targetDraName value. + */ + public String targetDraName() { + return this.targetDraName; + } + + /** + * Set the targetDraName property: Gets or sets the target DRA name. + * + * @param targetDraName the targetDraName value to set. + * @return the VMwareToAzStackHciProtectedItemCustomProps object itself. + */ + public VMwareToAzStackHciProtectedItemCustomProps withTargetDraName(String targetDraName) { + this.targetDraName = targetDraName; + return this; + } + + /** + * Get the sourceApplianceName property: Gets or sets the source appliance name. + * + * @return the sourceApplianceName value. + */ + public String sourceApplianceName() { + return this.sourceApplianceName; + } + + /** + * Get the targetApplianceName property: Gets or sets the target appliance name. + * + * @return the targetApplianceName value. + */ + public String targetApplianceName() { + return this.targetApplianceName; + } + + /** + * Get the failoverRecoveryPointId property: Gets or sets the recovery point Id to which the VM was failed over. + * + * @return the failoverRecoveryPointId value. + */ + public String failoverRecoveryPointId() { + return this.failoverRecoveryPointId; + } + + /** + * Get the lastRecoveryPointReceived property: Gets or sets the last recovery point received time. + * + * @return the lastRecoveryPointReceived value. + */ + public OffsetDateTime lastRecoveryPointReceived() { + return this.lastRecoveryPointReceived; + } + + /** + * Get the lastRecoveryPointId property: Gets or sets the last recovery point Id. + * + * @return the lastRecoveryPointId value. + */ + public String lastRecoveryPointId() { + return this.lastRecoveryPointId; + } + + /** + * Get the initialReplicationProgressPercentage property: Gets or sets the initial replication progress percentage. + * This is calculated based on total bytes processed for all disks in the source VM. + * + * @return the initialReplicationProgressPercentage value. + */ + public Integer initialReplicationProgressPercentage() { + return this.initialReplicationProgressPercentage; + } + + /** + * Get the migrationProgressPercentage property: Gets or sets the migration progress percentage. + * + * @return the migrationProgressPercentage value. + */ + public Integer migrationProgressPercentage() { + return this.migrationProgressPercentage; + } + + /** + * Get the resumeProgressPercentage property: Gets or sets the resume progress percentage. + * + * @return the resumeProgressPercentage value. + */ + public Integer resumeProgressPercentage() { + return this.resumeProgressPercentage; + } + + /** + * Get the resyncProgressPercentage property: Gets or sets the resync progress percentage. This is calculated based + * on total bytes processed for all disks in the source VM. + * + * @return the resyncProgressPercentage value. + */ + public Integer resyncProgressPercentage() { + return this.resyncProgressPercentage; + } + + /** + * Get the resyncRetryCount property: Gets or sets the resync retry count. + * + * @return the resyncRetryCount value. + */ + public Long resyncRetryCount() { + return this.resyncRetryCount; + } + + /** + * Get the resyncRequired property: Gets or sets a value indicating whether resync is required. + * + * @return the resyncRequired value. + */ + public Boolean resyncRequired() { + return this.resyncRequired; + } + + /** + * Get the resyncState property: Gets or sets the resync state. + * + * @return the resyncState value. + */ + public VMwareToAzureMigrateResyncState resyncState() { + return this.resyncState; + } + + /** + * Get the performAutoResync property: Gets or sets a value indicating whether auto resync is to be done. + * + * @return the performAutoResync value. + */ + public Boolean performAutoResync() { + return this.performAutoResync; + } + + /** + * Set the performAutoResync property: Gets or sets a value indicating whether auto resync is to be done. + * + * @param performAutoResync the performAutoResync value to set. + * @return the VMwareToAzStackHciProtectedItemCustomProps object itself. + */ + public VMwareToAzStackHciProtectedItemCustomProps withPerformAutoResync(Boolean performAutoResync) { + this.performAutoResync = performAutoResync; + return this; + } + + /** + * Get the resumeRetryCount property: Gets or sets the resume retry count. + * + * @return the resumeRetryCount value. + */ + public Long resumeRetryCount() { + return this.resumeRetryCount; + } + + /** + * Get the lastReplicationUpdateTime property: Gets or sets the latest timestamp that replication status is updated. + * + * @return the lastReplicationUpdateTime value. + */ + public OffsetDateTime lastReplicationUpdateTime() { + return this.lastReplicationUpdateTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (targetHciClusterId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetHciClusterId in model" + + " VMwareToAzStackHciProtectedItemCustomProps")); + } + if (targetArcClusterCustomLocationId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetArcClusterCustomLocationId in model" + + " VMwareToAzStackHciProtectedItemCustomProps")); + } + if (storageContainerId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property storageContainerId in model" + + " VMwareToAzStackHciProtectedItemCustomProps")); + } + if (targetResourceGroupId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetResourceGroupId in model" + + " VMwareToAzStackHciProtectedItemCustomProps")); + } + if (customLocationRegion() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property customLocationRegion in model" + + " VMwareToAzStackHciProtectedItemCustomProps")); + } + if (disksToInclude() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property disksToInclude in model" + + " VMwareToAzStackHciProtectedItemCustomProps")); + } else { + disksToInclude().forEach(e -> e.validate()); + } + if (nicsToInclude() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property nicsToInclude in model VMwareToAzStackHciProtectedItemCustomProps")); + } else { + nicsToInclude().forEach(e -> e.validate()); + } + if (protectedDisks() != null) { + protectedDisks().forEach(e -> e.validate()); + } + if (protectedNics() != null) { + protectedNics().forEach(e -> e.validate()); + } + if (hyperVGeneration() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property hyperVGeneration in model" + + " VMwareToAzStackHciProtectedItemCustomProps")); + } + if (dynamicMemoryConfig() != null) { + dynamicMemoryConfig().validate(); + } + if (fabricDiscoveryMachineId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property fabricDiscoveryMachineId in model" + + " VMwareToAzStackHciProtectedItemCustomProps")); + } + if (runAsAccountId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property runAsAccountId in model" + + " VMwareToAzStackHciProtectedItemCustomProps")); + } + if (sourceDraName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceDraName in model VMwareToAzStackHciProtectedItemCustomProps")); + } + if (targetDraName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetDraName in model VMwareToAzStackHciProtectedItemCustomProps")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VMwareToAzStackHciProtectedItemCustomProps.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciProtectedNicProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciProtectedNicProperties.java new file mode 100644 index 000000000000..d2597f3e0099 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciProtectedNicProperties.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VMwareToAzStackHCI NIC properties. */ +@Fluent +public final class VMwareToAzStackHciProtectedNicProperties { + /* + * Gets or sets the NIC Id. + */ + @JsonProperty(value = "nicId", access = JsonProperty.Access.WRITE_ONLY) + private String nicId; + + /* + * Gets or sets the NIC mac address. + */ + @JsonProperty(value = "macAddress", access = JsonProperty.Access.WRITE_ONLY) + private String macAddress; + + /* + * Gets or sets the NIC label. + */ + @JsonProperty(value = "label", access = JsonProperty.Access.WRITE_ONLY) + private String label; + + /* + * Gets or sets a value indicating whether this is the primary NIC. + */ + @JsonProperty(value = "isPrimaryNic") + private Boolean isPrimaryNic; + + /* + * Gets or sets the network name. + */ + @JsonProperty(value = "networkName", access = JsonProperty.Access.WRITE_ONLY) + private String networkName; + + /* + * Gets or sets the target network Id within AzStackHCI Cluster. + */ + @JsonProperty(value = "targetNetworkId", access = JsonProperty.Access.WRITE_ONLY) + private String targetNetworkId; + + /* + * Gets or sets the target test network Id within AzStackHCI Cluster. + */ + @JsonProperty(value = "testNetworkId", access = JsonProperty.Access.WRITE_ONLY) + private String testNetworkId; + + /* + * Gets or sets the selection type of the NIC. + */ + @JsonProperty(value = "selectionTypeForFailover", access = JsonProperty.Access.WRITE_ONLY) + private VMNicSelection selectionTypeForFailover; + + /** Creates an instance of VMwareToAzStackHciProtectedNicProperties class. */ + public VMwareToAzStackHciProtectedNicProperties() { + } + + /** + * Get the nicId property: Gets or sets the NIC Id. + * + * @return the nicId value. + */ + public String nicId() { + return this.nicId; + } + + /** + * Get the macAddress property: Gets or sets the NIC mac address. + * + * @return the macAddress value. + */ + public String macAddress() { + return this.macAddress; + } + + /** + * Get the label property: Gets or sets the NIC label. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Get the isPrimaryNic property: Gets or sets a value indicating whether this is the primary NIC. + * + * @return the isPrimaryNic value. + */ + public Boolean isPrimaryNic() { + return this.isPrimaryNic; + } + + /** + * Set the isPrimaryNic property: Gets or sets a value indicating whether this is the primary NIC. + * + * @param isPrimaryNic the isPrimaryNic value to set. + * @return the VMwareToAzStackHciProtectedNicProperties object itself. + */ + public VMwareToAzStackHciProtectedNicProperties withIsPrimaryNic(Boolean isPrimaryNic) { + this.isPrimaryNic = isPrimaryNic; + return this; + } + + /** + * Get the networkName property: Gets or sets the network name. + * + * @return the networkName value. + */ + public String networkName() { + return this.networkName; + } + + /** + * Get the targetNetworkId property: Gets or sets the target network Id within AzStackHCI Cluster. + * + * @return the targetNetworkId value. + */ + public String targetNetworkId() { + return this.targetNetworkId; + } + + /** + * Get the testNetworkId property: Gets or sets the target test network Id within AzStackHCI Cluster. + * + * @return the testNetworkId value. + */ + public String testNetworkId() { + return this.testNetworkId; + } + + /** + * Get the selectionTypeForFailover property: Gets or sets the selection type of the NIC. + * + * @return the selectionTypeForFailover value. + */ + public VMNicSelection selectionTypeForFailover() { + return this.selectionTypeForFailover; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciRepExtnCustomProps.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciRepExtnCustomProps.java new file mode 100644 index 000000000000..23b92f3ca84e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzStackHciRepExtnCustomProps.java @@ -0,0 +1,330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** VMware to AzStackHCI Replication extension model custom properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType") +@JsonTypeName("VMwareToAzStackHCI") +@Fluent +public final class VMwareToAzStackHciRepExtnCustomProps extends ReplicationExtensionModelCustomProperties { + /* + * Gets or sets the ARM Id of the source VMware fabric. + */ + @JsonProperty(value = "vmwareFabricArmId", required = true) + private String vmwareFabricArmId; + + /* + * Gets or sets the ARM Id of the VMware site. + */ + @JsonProperty(value = "vmwareSiteId", access = JsonProperty.Access.WRITE_ONLY) + private String vmwareSiteId; + + /* + * Gets or sets the ARM Id of the target AzStackHCI fabric. + */ + @JsonProperty(value = "azStackHciFabricArmId", required = true) + private String azStackHciFabricArmId; + + /* + * Gets or sets the ARM Id of the AzStackHCI site. + */ + @JsonProperty(value = "azStackHciSiteId", access = JsonProperty.Access.WRITE_ONLY) + private String azStackHciSiteId; + + /* + * Gets or sets the storage account Id. + */ + @JsonProperty(value = "storageAccountId") + private String storageAccountId; + + /* + * Gets or sets the Sas Secret of storage account. + */ + @JsonProperty(value = "storageAccountSasSecretName") + private String storageAccountSasSecretName; + + /* + * Gets or sets the Uri of ASR. + */ + @JsonProperty(value = "asrServiceUri", access = JsonProperty.Access.WRITE_ONLY) + private String asrServiceUri; + + /* + * Gets or sets the Uri of Rcm. + */ + @JsonProperty(value = "rcmServiceUri", access = JsonProperty.Access.WRITE_ONLY) + private String rcmServiceUri; + + /* + * Gets or sets the Uri of Gateway. + */ + @JsonProperty(value = "gatewayServiceUri", access = JsonProperty.Access.WRITE_ONLY) + private String gatewayServiceUri; + + /* + * Gets or sets the gateway service Id of source. + */ + @JsonProperty(value = "sourceGatewayServiceId", access = JsonProperty.Access.WRITE_ONLY) + private String sourceGatewayServiceId; + + /* + * Gets or sets the gateway service Id of target. + */ + @JsonProperty(value = "targetGatewayServiceId", access = JsonProperty.Access.WRITE_ONLY) + private String targetGatewayServiceId; + + /* + * Gets or sets the source storage container name. + */ + @JsonProperty(value = "sourceStorageContainerName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceStorageContainerName; + + /* + * Gets or sets the target storage container name. + */ + @JsonProperty(value = "targetStorageContainerName", access = JsonProperty.Access.WRITE_ONLY) + private String targetStorageContainerName; + + /* + * Gets or sets the resource location. + */ + @JsonProperty(value = "resourceLocation", access = JsonProperty.Access.WRITE_ONLY) + private String resourceLocation; + + /* + * Gets or sets the subscription. + */ + @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) + private String subscriptionId; + + /* + * Gets or sets the resource group. + */ + @JsonProperty(value = "resourceGroup", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGroup; + + /** Creates an instance of VMwareToAzStackHciRepExtnCustomProps class. */ + public VMwareToAzStackHciRepExtnCustomProps() { + } + + /** + * Get the vmwareFabricArmId property: Gets or sets the ARM Id of the source VMware fabric. + * + * @return the vmwareFabricArmId value. + */ + public String vmwareFabricArmId() { + return this.vmwareFabricArmId; + } + + /** + * Set the vmwareFabricArmId property: Gets or sets the ARM Id of the source VMware fabric. + * + * @param vmwareFabricArmId the vmwareFabricArmId value to set. + * @return the VMwareToAzStackHciRepExtnCustomProps object itself. + */ + public VMwareToAzStackHciRepExtnCustomProps withVmwareFabricArmId(String vmwareFabricArmId) { + this.vmwareFabricArmId = vmwareFabricArmId; + return this; + } + + /** + * Get the vmwareSiteId property: Gets or sets the ARM Id of the VMware site. + * + * @return the vmwareSiteId value. + */ + public String vmwareSiteId() { + return this.vmwareSiteId; + } + + /** + * Get the azStackHciFabricArmId property: Gets or sets the ARM Id of the target AzStackHCI fabric. + * + * @return the azStackHciFabricArmId value. + */ + public String azStackHciFabricArmId() { + return this.azStackHciFabricArmId; + } + + /** + * Set the azStackHciFabricArmId property: Gets or sets the ARM Id of the target AzStackHCI fabric. + * + * @param azStackHciFabricArmId the azStackHciFabricArmId value to set. + * @return the VMwareToAzStackHciRepExtnCustomProps object itself. + */ + public VMwareToAzStackHciRepExtnCustomProps withAzStackHciFabricArmId(String azStackHciFabricArmId) { + this.azStackHciFabricArmId = azStackHciFabricArmId; + return this; + } + + /** + * Get the azStackHciSiteId property: Gets or sets the ARM Id of the AzStackHCI site. + * + * @return the azStackHciSiteId value. + */ + public String azStackHciSiteId() { + return this.azStackHciSiteId; + } + + /** + * Get the storageAccountId property: Gets or sets the storage account Id. + * + * @return the storageAccountId value. + */ + public String storageAccountId() { + return this.storageAccountId; + } + + /** + * Set the storageAccountId property: Gets or sets the storage account Id. + * + * @param storageAccountId the storageAccountId value to set. + * @return the VMwareToAzStackHciRepExtnCustomProps object itself. + */ + public VMwareToAzStackHciRepExtnCustomProps withStorageAccountId(String storageAccountId) { + this.storageAccountId = storageAccountId; + return this; + } + + /** + * Get the storageAccountSasSecretName property: Gets or sets the Sas Secret of storage account. + * + * @return the storageAccountSasSecretName value. + */ + public String storageAccountSasSecretName() { + return this.storageAccountSasSecretName; + } + + /** + * Set the storageAccountSasSecretName property: Gets or sets the Sas Secret of storage account. + * + * @param storageAccountSasSecretName the storageAccountSasSecretName value to set. + * @return the VMwareToAzStackHciRepExtnCustomProps object itself. + */ + public VMwareToAzStackHciRepExtnCustomProps withStorageAccountSasSecretName(String storageAccountSasSecretName) { + this.storageAccountSasSecretName = storageAccountSasSecretName; + return this; + } + + /** + * Get the asrServiceUri property: Gets or sets the Uri of ASR. + * + * @return the asrServiceUri value. + */ + public String asrServiceUri() { + return this.asrServiceUri; + } + + /** + * Get the rcmServiceUri property: Gets or sets the Uri of Rcm. + * + * @return the rcmServiceUri value. + */ + public String rcmServiceUri() { + return this.rcmServiceUri; + } + + /** + * Get the gatewayServiceUri property: Gets or sets the Uri of Gateway. + * + * @return the gatewayServiceUri value. + */ + public String gatewayServiceUri() { + return this.gatewayServiceUri; + } + + /** + * Get the sourceGatewayServiceId property: Gets or sets the gateway service Id of source. + * + * @return the sourceGatewayServiceId value. + */ + public String sourceGatewayServiceId() { + return this.sourceGatewayServiceId; + } + + /** + * Get the targetGatewayServiceId property: Gets or sets the gateway service Id of target. + * + * @return the targetGatewayServiceId value. + */ + public String targetGatewayServiceId() { + return this.targetGatewayServiceId; + } + + /** + * Get the sourceStorageContainerName property: Gets or sets the source storage container name. + * + * @return the sourceStorageContainerName value. + */ + public String sourceStorageContainerName() { + return this.sourceStorageContainerName; + } + + /** + * Get the targetStorageContainerName property: Gets or sets the target storage container name. + * + * @return the targetStorageContainerName value. + */ + public String targetStorageContainerName() { + return this.targetStorageContainerName; + } + + /** + * Get the resourceLocation property: Gets or sets the resource location. + * + * @return the resourceLocation value. + */ + public String resourceLocation() { + return this.resourceLocation; + } + + /** + * Get the subscriptionId property: Gets or sets the subscription. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Get the resourceGroup property: Gets or sets the resource group. + * + * @return the resourceGroup value. + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (vmwareFabricArmId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property vmwareFabricArmId in model VMwareToAzStackHciRepExtnCustomProps")); + } + if (azStackHciFabricArmId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property azStackHciFabricArmId in model" + + " VMwareToAzStackHciRepExtnCustomProps")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VMwareToAzStackHciRepExtnCustomProps.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzureMigrateResyncState.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzureMigrateResyncState.java new file mode 100644 index 000000000000..acbac5f11731 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VMwareToAzureMigrateResyncState.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.recoveryservicesdatareplication.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Gets or sets the resync state. */ +public final class VMwareToAzureMigrateResyncState extends ExpandableStringEnum { + /** Static value None for VMwareToAzureMigrateResyncState. */ + public static final VMwareToAzureMigrateResyncState NONE = fromString("None"); + + /** Static value PreparedForResynchronization for VMwareToAzureMigrateResyncState. */ + public static final VMwareToAzureMigrateResyncState PREPARED_FOR_RESYNCHRONIZATION = + fromString("PreparedForResynchronization"); + + /** Static value StartedResynchronization for VMwareToAzureMigrateResyncState. */ + public static final VMwareToAzureMigrateResyncState STARTED_RESYNCHRONIZATION = + fromString("StartedResynchronization"); + + /** + * Creates a new instance of VMwareToAzureMigrateResyncState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VMwareToAzureMigrateResyncState() { + } + + /** + * Creates or finds a VMwareToAzureMigrateResyncState from its string representation. + * + * @param name a name to look for. + * @return the corresponding VMwareToAzureMigrateResyncState. + */ + @JsonCreator + public static VMwareToAzureMigrateResyncState fromString(String name) { + return fromString(name, VMwareToAzureMigrateResyncState.class); + } + + /** + * Gets known VMwareToAzureMigrateResyncState values. + * + * @return known VMwareToAzureMigrateResyncState values. + */ + public static Collection values() { + return values(VMwareToAzureMigrateResyncState.class); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VaultModel.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VaultModel.java new file mode 100644 index 000000000000..af38ca0a8b0d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VaultModel.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.VaultModelInner; +import java.util.Map; + +/** An immutable client-side representation of VaultModel. */ +public interface VaultModel { + /** + * 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 properties property: Vault properties. + * + * @return the properties value. + */ + VaultModelProperties properties(); + + /** + * Gets the systemData property: The systemData property. + * + * @return the systemData value. + */ + VaultModelSystemData systemData(); + + /** + * 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.VaultModelInner object. + * + * @return the inner object. + */ + VaultModelInner innerModel(); + + /** The entirety of the VaultModel definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + + /** The VaultModel definition stages. */ + interface DefinitionStages { + /** The first stage of the VaultModel definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the VaultModel 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 VaultModel definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the VaultModel 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + VaultModel create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VaultModel create(Context context); + } + + /** The stage of the VaultModel 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 VaultModel definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Vault properties.. + * + * @param properties Vault properties. + * @return the next definition stage. + */ + WithCreate withProperties(VaultModelProperties properties); + } + } + + /** + * Begins update for the VaultModel resource. + * + * @return the stage of resource update. + */ + VaultModel.Update update(); + + /** The template for VaultModel update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VaultModel apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VaultModel apply(Context context); + } + + /** The VaultModel update stages. */ + interface UpdateStages { + /** The stage of the VaultModel update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Gets or sets the resource tags.. + * + * @param tags Gets or sets the resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** The stage of the VaultModel update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Vault properties.. + * + * @param properties Vault properties. + * @return the next definition stage. + */ + Update withProperties(VaultModelProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VaultModel refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VaultModel refresh(Context context); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VaultModelCollection.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VaultModelCollection.java new file mode 100644 index 000000000000..34260e7994a5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VaultModelCollection.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.VaultModelInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Vault model collection. */ +@Fluent +public final class VaultModelCollection { + /* + * Gets or sets the list of vaults. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets or sets the value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of VaultModelCollection class. */ + public VaultModelCollection() { + } + + /** + * Get the value property: Gets or sets the list of vaults. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets the list of vaults. + * + * @param value the value value to set. + * @return the VaultModelCollection object itself. + */ + public VaultModelCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets or sets the value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets or sets the value of next link. + * + * @param nextLink the nextLink value to set. + * @return the VaultModelCollection object itself. + */ + public VaultModelCollection 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/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VaultModelProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VaultModelProperties.java new file mode 100644 index 000000000000..d276ebed80fb --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VaultModelProperties.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Vault properties. */ +@Fluent +public final class VaultModelProperties { + /* + * Gets or sets the provisioning state of the vault. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Gets or sets the service resource Id. + */ + @JsonProperty(value = "serviceResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String serviceResourceId; + + /* + * Gets or sets the type of vault. + */ + @JsonProperty(value = "vaultType") + private ReplicationVaultType vaultType; + + /** Creates an instance of VaultModelProperties class. */ + public VaultModelProperties() { + } + + /** + * Get the provisioningState property: Gets or sets the provisioning state of the vault. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the serviceResourceId property: Gets or sets the service resource Id. + * + * @return the serviceResourceId value. + */ + public String serviceResourceId() { + return this.serviceResourceId; + } + + /** + * Get the vaultType property: Gets or sets the type of vault. + * + * @return the vaultType value. + */ + public ReplicationVaultType vaultType() { + return this.vaultType; + } + + /** + * Set the vaultType property: Gets or sets the type of vault. + * + * @param vaultType the vaultType value to set. + * @return the VaultModelProperties object itself. + */ + public VaultModelProperties withVaultType(ReplicationVaultType vaultType) { + this.vaultType = vaultType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VaultModelSystemData.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VaultModelSystemData.java new file mode 100644 index 000000000000..01b812c66f6d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VaultModelSystemData.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import java.time.OffsetDateTime; + +/** The VaultModelSystemData model. */ +@Fluent +public final class VaultModelSystemData extends SystemDataModel { + /** Creates an instance of VaultModelSystemData class. */ + public VaultModelSystemData() { + } + + /** {@inheritDoc} */ + @Override + public VaultModelSystemData withCreatedBy(String createdBy) { + super.withCreatedBy(createdBy); + return this; + } + + /** {@inheritDoc} */ + @Override + public VaultModelSystemData withCreatedByType(String createdByType) { + super.withCreatedByType(createdByType); + return this; + } + + /** {@inheritDoc} */ + @Override + public VaultModelSystemData withCreatedAt(OffsetDateTime createdAt) { + super.withCreatedAt(createdAt); + return this; + } + + /** {@inheritDoc} */ + @Override + public VaultModelSystemData withLastModifiedBy(String lastModifiedBy) { + super.withLastModifiedBy(lastModifiedBy); + return this; + } + + /** {@inheritDoc} */ + @Override + public VaultModelSystemData withLastModifiedByType(String lastModifiedByType) { + super.withLastModifiedByType(lastModifiedByType); + return this; + } + + /** {@inheritDoc} */ + @Override + public VaultModelSystemData withLastModifiedAt(OffsetDateTime lastModifiedAt) { + super.withLastModifiedAt(lastModifiedAt); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VaultModelUpdate.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VaultModelUpdate.java new file mode 100644 index 000000000000..67d64f747db6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VaultModelUpdate.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Vault model for update. */ +@Fluent +public final class VaultModelUpdate extends ProxyResource { + /* + * Gets or sets the resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * Vault properties. + */ + @JsonProperty(value = "properties") + private VaultModelProperties properties; + + /* + * The systemData property. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private VaultModelUpdateSystemData systemData; + + /** Creates an instance of VaultModelUpdate class. */ + public VaultModelUpdate() { + } + + /** + * Get the tags property: Gets or sets the resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Gets or sets the resource tags. + * + * @param tags the tags value to set. + * @return the VaultModelUpdate object itself. + */ + public VaultModelUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties property: Vault properties. + * + * @return the properties value. + */ + public VaultModelProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Vault properties. + * + * @param properties the properties value to set. + * @return the VaultModelUpdate object itself. + */ + public VaultModelUpdate withProperties(VaultModelProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: The systemData property. + * + * @return the systemData value. + */ + public VaultModelUpdateSystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (systemData() != null) { + systemData().validate(); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VaultModelUpdateSystemData.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VaultModelUpdateSystemData.java new file mode 100644 index 000000000000..fbfb4006a667 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VaultModelUpdateSystemData.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import java.time.OffsetDateTime; + +/** The VaultModelUpdateSystemData model. */ +@Fluent +public final class VaultModelUpdateSystemData extends SystemDataModel { + /** Creates an instance of VaultModelUpdateSystemData class. */ + public VaultModelUpdateSystemData() { + } + + /** {@inheritDoc} */ + @Override + public VaultModelUpdateSystemData withCreatedBy(String createdBy) { + super.withCreatedBy(createdBy); + return this; + } + + /** {@inheritDoc} */ + @Override + public VaultModelUpdateSystemData withCreatedByType(String createdByType) { + super.withCreatedByType(createdByType); + return this; + } + + /** {@inheritDoc} */ + @Override + public VaultModelUpdateSystemData withCreatedAt(OffsetDateTime createdAt) { + super.withCreatedAt(createdAt); + return this; + } + + /** {@inheritDoc} */ + @Override + public VaultModelUpdateSystemData withLastModifiedBy(String lastModifiedBy) { + super.withLastModifiedBy(lastModifiedBy); + return this; + } + + /** {@inheritDoc} */ + @Override + public VaultModelUpdateSystemData withLastModifiedByType(String lastModifiedByType) { + super.withLastModifiedByType(lastModifiedByType); + return this; + } + + /** {@inheritDoc} */ + @Override + public VaultModelUpdateSystemData withLastModifiedAt(OffsetDateTime lastModifiedAt) { + super.withLastModifiedAt(lastModifiedAt); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VaultOperationStatus.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VaultOperationStatus.java new file mode 100644 index 000000000000..18f9cd134e9f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/VaultOperationStatus.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VaultOperationStatus. */ +public interface VaultOperationStatus { + /** + * Gets the vault operation status. + * + *

Tracks the results of an asynchronous operation on the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param operationId The ID of an ongoing async operation. + * @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 defines the operation status along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String vaultName, String operationId, Context context); + + /** + * Gets the vault operation status. + * + *

Tracks the results of an asynchronous operation on the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param operationId The ID of an ongoing async 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 defines the operation status. + */ + OperationStatus get(String resourceGroupName, String vaultName, String operationId); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Vaults.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Vaults.java new file mode 100644 index 000000000000..bc9fbc0fe93c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Vaults.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.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 Vaults. */ +public interface Vaults { + /** + * Gets the vault. + * + *

Gets the details of the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the details of the vault along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String vaultName, Context context); + + /** + * Gets the vault. + * + *

Gets the details of the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the details of the vault. + */ + VaultModel getByResourceGroup(String resourceGroupName, String vaultName); + + /** + * Deletes the vault. + * + *

Removes the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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. + */ + void deleteByResourceGroup(String resourceGroupName, String vaultName); + + /** + * Deletes the vault. + * + *

Removes the vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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. + */ + void delete(String resourceGroupName, String vaultName, Context context); + + /** + * Lists the vaults. + * + *

Gets the list of vaults in the given 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 the list of vaults in the given subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists the vaults. + * + *

Gets the list of vaults in the given subscription. + * + * @param continuationToken Continuation token from the previous call. + * @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 list of vaults in the given subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String continuationToken, Context context); + + /** + * Lists the vaults. + * + *

Gets the list of vaults in the given subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of vaults in the given subscription and resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists the vaults. + * + *

Gets the list of vaults in the given subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param continuationToken Continuation token from the previous call. + * @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 list of vaults in the given subscription and resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, String continuationToken, Context context); + + /** + * Gets the vault. + * + *

Gets the details of the vault. + * + * @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 the details of the vault along with {@link Response}. + */ + VaultModel getById(String id); + + /** + * Gets the vault. + * + *

Gets the details of the vault. + * + * @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 the details of the vault along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the vault. + * + *

Removes the vault. + * + * @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 the vault. + * + *

Removes the vault. + * + * @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 VaultModel resource. + * + * @param name resource name. + * @return the first stage of the new VaultModel definition. + */ + VaultModel.DefinitionStages.Blank define(String name); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowModel.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowModel.java new file mode 100644 index 000000000000..45c7b8827835 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowModel.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.recoveryservicesdatareplication.models; + +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.WorkflowModelInner; + +/** An immutable client-side representation of WorkflowModel. */ +public interface WorkflowModel { + /** + * 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 properties property: Workflow model properties. + * + * @return the properties value. + */ + WorkflowModelProperties properties(); + + /** + * Gets the systemData property: The systemData property. + * + * @return the systemData value. + */ + WorkflowModelSystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.WorkflowModelInner object. + * + * @return the inner object. + */ + WorkflowModelInner innerModel(); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowModelCollection.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowModelCollection.java new file mode 100644 index 000000000000..e426aed5a9ec --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowModelCollection.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.WorkflowModelInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Workflow model collection. */ +@Fluent +public final class WorkflowModelCollection { + /* + * Gets or sets the list of workflows. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets or sets the value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of WorkflowModelCollection class. */ + public WorkflowModelCollection() { + } + + /** + * Get the value property: Gets or sets the list of workflows. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets the list of workflows. + * + * @param value the value value to set. + * @return the WorkflowModelCollection object itself. + */ + public WorkflowModelCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets or sets the value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets or sets the value of next link. + * + * @param nextLink the nextLink value to set. + * @return the WorkflowModelCollection object itself. + */ + public WorkflowModelCollection 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/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowModelCustomProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowModelCustomProperties.java new file mode 100644 index 000000000000..bdbc6c1851df --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowModelCustomProperties.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; + +/** Workflow model custom properties. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "instanceType", + defaultImpl = WorkflowModelCustomProperties.class) +@JsonTypeName("WorkflowModelCustomProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "FailoverWorkflowDetails", value = FailoverWorkflowModelCustomProperties.class), + @JsonSubTypes.Type( + name = "TestFailoverCleanupWorkflowDetails", + value = TestFailoverCleanupWorkflowModelCustomProperties.class), + @JsonSubTypes.Type(name = "TestFailoverWorkflowDetails", value = TestFailoverWorkflowModelCustomProperties.class) +}) +@Immutable +public class WorkflowModelCustomProperties { + /* + * Gets or sets any custom properties of the affected object. + */ + @JsonProperty(value = "affectedObjectDetails", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map affectedObjectDetails; + + /** Creates an instance of WorkflowModelCustomProperties class. */ + public WorkflowModelCustomProperties() { + } + + /** + * Get the affectedObjectDetails property: Gets or sets any custom properties of the affected object. + * + * @return the affectedObjectDetails value. + */ + public Map affectedObjectDetails() { + return this.affectedObjectDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowModelProperties.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowModelProperties.java new file mode 100644 index 000000000000..0549ef996e2e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowModelProperties.java @@ -0,0 +1,309 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Workflow model properties. */ +@Fluent +public final class WorkflowModelProperties { + /* + * Gets or sets the friendly display name. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /* + * Gets or sets the workflow state. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private WorkflowState state; + + /* + * Gets or sets the start time. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTime; + + /* + * Gets or sets the end time. + */ + @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endTime; + + /* + * Gets or sets the affected object Id. + */ + @JsonProperty(value = "objectId", access = JsonProperty.Access.WRITE_ONLY) + private String objectId; + + /* + * Gets or sets the affected object name. + */ + @JsonProperty(value = "objectName", access = JsonProperty.Access.WRITE_ONLY) + private String objectName; + + /* + * Gets or sets the affected object internal Id. + */ + @JsonProperty(value = "objectInternalId", access = JsonProperty.Access.WRITE_ONLY) + private String objectInternalId; + + /* + * Gets or sets the affected object internal name. + */ + @JsonProperty(value = "objectInternalName", access = JsonProperty.Access.WRITE_ONLY) + private String objectInternalName; + + /* + * Gets or sets the object type. + */ + @JsonProperty(value = "objectType", access = JsonProperty.Access.WRITE_ONLY) + private WorkflowObjectType objectType; + + /* + * Gets or sets the replication provider. + */ + @JsonProperty(value = "replicationProviderId", access = JsonProperty.Access.WRITE_ONLY) + private String replicationProviderId; + + /* + * Gets or sets the source fabric provider. + */ + @JsonProperty(value = "sourceFabricProviderId", access = JsonProperty.Access.WRITE_ONLY) + private String sourceFabricProviderId; + + /* + * Gets or sets the target fabric provider. + */ + @JsonProperty(value = "targetFabricProviderId", access = JsonProperty.Access.WRITE_ONLY) + private String targetFabricProviderId; + + /* + * Gets or sets the list of allowed actions on the workflow. + */ + @JsonProperty(value = "allowedActions", access = JsonProperty.Access.WRITE_ONLY) + private List allowedActions; + + /* + * Gets or sets the workflow activity id. + */ + @JsonProperty(value = "activityId", access = JsonProperty.Access.WRITE_ONLY) + private String activityId; + + /* + * Gets or sets the list of tasks. + */ + @JsonProperty(value = "tasks", access = JsonProperty.Access.WRITE_ONLY) + private List tasks; + + /* + * Gets or sets the list of errors. + */ + @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) + private List errors; + + /* + * Workflow model custom properties. + */ + @JsonProperty(value = "customProperties", required = true) + private WorkflowModelCustomProperties customProperties; + + /** Creates an instance of WorkflowModelProperties class. */ + public WorkflowModelProperties() { + } + + /** + * Get the displayName property: Gets or sets the friendly display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the state property: Gets or sets the workflow state. + * + * @return the state value. + */ + public WorkflowState state() { + return this.state; + } + + /** + * Get the startTime property: Gets or sets the start time. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: Gets or sets the end time. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Get the objectId property: Gets or sets the affected object Id. + * + * @return the objectId value. + */ + public String objectId() { + return this.objectId; + } + + /** + * Get the objectName property: Gets or sets the affected object name. + * + * @return the objectName value. + */ + public String objectName() { + return this.objectName; + } + + /** + * Get the objectInternalId property: Gets or sets the affected object internal Id. + * + * @return the objectInternalId value. + */ + public String objectInternalId() { + return this.objectInternalId; + } + + /** + * Get the objectInternalName property: Gets or sets the affected object internal name. + * + * @return the objectInternalName value. + */ + public String objectInternalName() { + return this.objectInternalName; + } + + /** + * Get the objectType property: Gets or sets the object type. + * + * @return the objectType value. + */ + public WorkflowObjectType objectType() { + return this.objectType; + } + + /** + * Get the replicationProviderId property: Gets or sets the replication provider. + * + * @return the replicationProviderId value. + */ + public String replicationProviderId() { + return this.replicationProviderId; + } + + /** + * Get the sourceFabricProviderId property: Gets or sets the source fabric provider. + * + * @return the sourceFabricProviderId value. + */ + public String sourceFabricProviderId() { + return this.sourceFabricProviderId; + } + + /** + * Get the targetFabricProviderId property: Gets or sets the target fabric provider. + * + * @return the targetFabricProviderId value. + */ + public String targetFabricProviderId() { + return this.targetFabricProviderId; + } + + /** + * Get the allowedActions property: Gets or sets the list of allowed actions on the workflow. + * + * @return the allowedActions value. + */ + public List allowedActions() { + return this.allowedActions; + } + + /** + * Get the activityId property: Gets or sets the workflow activity id. + * + * @return the activityId value. + */ + public String activityId() { + return this.activityId; + } + + /** + * Get the tasks property: Gets or sets the list of tasks. + * + * @return the tasks value. + */ + public List tasks() { + return this.tasks; + } + + /** + * Get the errors property: Gets or sets the list of errors. + * + * @return the errors value. + */ + public List errors() { + return this.errors; + } + + /** + * Get the customProperties property: Workflow model custom properties. + * + * @return the customProperties value. + */ + public WorkflowModelCustomProperties customProperties() { + return this.customProperties; + } + + /** + * Set the customProperties property: Workflow model custom properties. + * + * @param customProperties the customProperties value to set. + * @return the WorkflowModelProperties object itself. + */ + public WorkflowModelProperties withCustomProperties(WorkflowModelCustomProperties customProperties) { + this.customProperties = customProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tasks() != null) { + tasks().forEach(e -> e.validate()); + } + if (errors() != null) { + errors().forEach(e -> e.validate()); + } + if (customProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property customProperties in model WorkflowModelProperties")); + } else { + customProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WorkflowModelProperties.class); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowModelSystemData.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowModelSystemData.java new file mode 100644 index 000000000000..dbc88fadb77b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowModelSystemData.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.recoveryservicesdatareplication.models; + +import com.azure.core.annotation.Fluent; +import java.time.OffsetDateTime; + +/** The WorkflowModelSystemData model. */ +@Fluent +public final class WorkflowModelSystemData extends SystemDataModel { + /** Creates an instance of WorkflowModelSystemData class. */ + public WorkflowModelSystemData() { + } + + /** {@inheritDoc} */ + @Override + public WorkflowModelSystemData withCreatedBy(String createdBy) { + super.withCreatedBy(createdBy); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkflowModelSystemData withCreatedByType(String createdByType) { + super.withCreatedByType(createdByType); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkflowModelSystemData withCreatedAt(OffsetDateTime createdAt) { + super.withCreatedAt(createdAt); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkflowModelSystemData withLastModifiedBy(String lastModifiedBy) { + super.withLastModifiedBy(lastModifiedBy); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkflowModelSystemData withLastModifiedByType(String lastModifiedByType) { + super.withLastModifiedByType(lastModifiedByType); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkflowModelSystemData withLastModifiedAt(OffsetDateTime lastModifiedAt) { + super.withLastModifiedAt(lastModifiedAt); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowObjectType.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowObjectType.java new file mode 100644 index 000000000000..b02921b7e581 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowObjectType.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.recoveryservicesdatareplication.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Gets or sets the object type. */ +public final class WorkflowObjectType extends ExpandableStringEnum { + /** Static value AvsDiskPool for WorkflowObjectType. */ + public static final WorkflowObjectType AVS_DISK_POOL = fromString("AvsDiskPool"); + + /** Static value Dra for WorkflowObjectType. */ + public static final WorkflowObjectType DRA = fromString("Dra"); + + /** Static value Fabric for WorkflowObjectType. */ + public static final WorkflowObjectType FABRIC = fromString("Fabric"); + + /** Static value Policy for WorkflowObjectType. */ + public static final WorkflowObjectType POLICY = fromString("Policy"); + + /** Static value ProtectedItem for WorkflowObjectType. */ + public static final WorkflowObjectType PROTECTED_ITEM = fromString("ProtectedItem"); + + /** Static value RecoveryPlan for WorkflowObjectType. */ + public static final WorkflowObjectType RECOVERY_PLAN = fromString("RecoveryPlan"); + + /** Static value ReplicationExtension for WorkflowObjectType. */ + public static final WorkflowObjectType REPLICATION_EXTENSION = fromString("ReplicationExtension"); + + /** Static value Vault for WorkflowObjectType. */ + public static final WorkflowObjectType VAULT = fromString("Vault"); + + /** + * Creates a new instance of WorkflowObjectType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WorkflowObjectType() { + } + + /** + * Creates or finds a WorkflowObjectType from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkflowObjectType. + */ + @JsonCreator + public static WorkflowObjectType fromString(String name) { + return fromString(name, WorkflowObjectType.class); + } + + /** + * Gets known WorkflowObjectType values. + * + * @return known WorkflowObjectType values. + */ + public static Collection values() { + return values(WorkflowObjectType.class); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowOperationStatus.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowOperationStatus.java new file mode 100644 index 000000000000..aebf14fdac1f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowOperationStatus.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of WorkflowOperationStatus. */ +public interface WorkflowOperationStatus { + /** + * Gets the job (workflow) operation status. + * + *

Tracks the results of an asynchronous operation on the job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param jobName The job (workflow) name. + * @param operationId The ID of an ongoing async operation. + * @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 defines the operation status along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String vaultName, String jobName, String operationId, Context context); + + /** + * Gets the job (workflow) operation status. + * + *

Tracks the results of an asynchronous operation on the job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param jobName The job (workflow) name. + * @param operationId The ID of an ongoing async 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 defines the operation status. + */ + OperationStatus get(String resourceGroupName, String vaultName, String jobName, String operationId); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowState.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowState.java new file mode 100644 index 000000000000..dc1226ca2505 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/WorkflowState.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.recoveryservicesdatareplication.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Gets or sets the workflow state. */ +public final class WorkflowState extends ExpandableStringEnum { + /** Static value Pending for WorkflowState. */ + public static final WorkflowState PENDING = fromString("Pending"); + + /** Static value Started for WorkflowState. */ + public static final WorkflowState STARTED = fromString("Started"); + + /** Static value Cancelling for WorkflowState. */ + public static final WorkflowState CANCELLING = fromString("Cancelling"); + + /** Static value Succeeded for WorkflowState. */ + public static final WorkflowState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for WorkflowState. */ + public static final WorkflowState FAILED = fromString("Failed"); + + /** Static value Cancelled for WorkflowState. */ + public static final WorkflowState CANCELLED = fromString("Cancelled"); + + /** Static value CompletedWithInformation for WorkflowState. */ + public static final WorkflowState COMPLETED_WITH_INFORMATION = fromString("CompletedWithInformation"); + + /** Static value CompletedWithWarnings for WorkflowState. */ + public static final WorkflowState COMPLETED_WITH_WARNINGS = fromString("CompletedWithWarnings"); + + /** Static value CompletedWithErrors for WorkflowState. */ + public static final WorkflowState COMPLETED_WITH_ERRORS = fromString("CompletedWithErrors"); + + /** + * Creates a new instance of WorkflowState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WorkflowState() { + } + + /** + * Creates or finds a WorkflowState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkflowState. + */ + @JsonCreator + public static WorkflowState fromString(String name) { + return fromString(name, WorkflowState.class); + } + + /** + * Gets known WorkflowState values. + * + * @return known WorkflowState values. + */ + public static Collection values() { + return values(WorkflowState.class); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Workflows.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Workflows.java new file mode 100644 index 000000000000..8fc0ef284e55 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/Workflows.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.recoveryservicesdatareplication.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 Workflows. */ +public interface Workflows { + /** + * Gets the job (workflow). + * + *

Gets the details of the job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param jobName The job (workflow) 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 the details of the job along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String vaultName, String jobName, Context context); + + /** + * Gets the job (workflow). + * + *

Gets the details of the job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param jobName The job (workflow) 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 the details of the job. + */ + WorkflowModel get(String resourceGroupName, String vaultName, String jobName); + + /** + * Lists the jobs (workflows). + * + *

Gets the list of jobs in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault 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 the list of jobs in the given vault as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String vaultName); + + /** + * Lists the jobs (workflows). + * + *

Gets the list of jobs in the given vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The vault name. + * @param filter Filter string. + * @param continuationToken Continuation token. + * @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 list of jobs in the given vault as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String vaultName, String filter, String continuationToken, Context context); +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/package-info.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/package-info.java new file mode 100644 index 000000000000..1b3e55391d44 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/models/package-info.java @@ -0,0 +1,9 @@ +// 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 DataReplicationMgmtClient. A first party Azure service enabling the data + * replication. + */ +package com.azure.resourcemanager.recoveryservicesdatareplication.models; diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/package-info.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/package-info.java new file mode 100644 index 000000000000..22acf82e63b5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/com/azure/resourcemanager/recoveryservicesdatareplication/package-info.java @@ -0,0 +1,9 @@ +// 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 DataReplicationMgmtClient. A first party Azure service enabling the data + * replication. + */ +package com.azure.resourcemanager.recoveryservicesdatareplication; diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/module-info.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/main/java/module-info.java new file mode 100644 index 000000000000..5bb948c227a5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/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.recoveryservicesdatareplication { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.recoveryservicesdatareplication; + exports com.azure.resourcemanager.recoveryservicesdatareplication.fluent; + exports com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models; + exports com.azure.resourcemanager.recoveryservicesdatareplication.models; + + opens com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.recoveryservicesdatareplication.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/DraCreateSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/DraCreateSamples.java new file mode 100644 index 000000000000..0dd258a6a146 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/DraCreateSamples.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +import com.azure.resourcemanager.recoveryservicesdatareplication.models.DraModelCustomProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.DraModelProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.IdentityModel; + +/** Samples for Dra Create. */ +public final class DraCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Dra_Create.json + */ + /** + * Sample code: Dra_Create. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void draCreate( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .dras() + .define("M") + .withExistingReplicationFabric("rgrecoveryservicesdatareplication", "wPR") + .withProperties( + new DraModelProperties() + .withMachineId("envzcoijbqhtrpncbjbhk") + .withMachineName("y") + .withAuthenticationIdentity( + new IdentityModel() + .withTenantId("joclkkdovixwapephhxaqtefubhhmq") + .withApplicationId("cwktzrwajuvfyyymfstpey") + .withObjectId("khsiaqfbpuhp") + .withAudience("dkjobanyqgzenivyxhvavottpc") + .withAadAuthority("bubwwbowfhdmujrt")) + .withResourceAccessIdentity( + new IdentityModel() + .withTenantId("joclkkdovixwapephhxaqtefubhhmq") + .withApplicationId("cwktzrwajuvfyyymfstpey") + .withObjectId("khsiaqfbpuhp") + .withAudience("dkjobanyqgzenivyxhvavottpc") + .withAadAuthority("bubwwbowfhdmujrt")) + .withCustomProperties(new DraModelCustomProperties())) + .create(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/DraDeleteSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/DraDeleteSamples.java new file mode 100644 index 000000000000..99fe8f012b8c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/DraDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for Dra Delete. */ +public final class DraDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Dra_Delete.json + */ + /** + * Sample code: Dra_Delete. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void draDelete( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager.dras().delete("rgrecoveryservicesdatareplication", "wPR", "M", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/DraGetSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/DraGetSamples.java new file mode 100644 index 000000000000..35f11ce3dff3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/DraGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for Dra Get. */ +public final class DraGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Dra_Get.json + */ + /** + * Sample code: Dra_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void draGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .dras() + .getWithResponse("rgrecoveryservicesdatareplication", "wPR", "M", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/DraListSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/DraListSamples.java new file mode 100644 index 000000000000..1f2b62edbc62 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/DraListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for Dra List. */ +public final class DraListSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Dra_List.json + */ + /** + * Sample code: Dra_List. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void draList( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager.dras().list("rgrecoveryservicesdatareplication", "wPR", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/DraOperationStatusGetSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/DraOperationStatusGetSamples.java new file mode 100644 index 000000000000..f56ab4165fbd --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/DraOperationStatusGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for DraOperationStatus Get. */ +public final class DraOperationStatusGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/DraOperationStatus_Get.json + */ + /** + * Sample code: DraOperationStatus_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void draOperationStatusGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .draOperationStatus() + .getWithResponse( + "rgrecoveryservicesdatareplication", "wPR", "M", "dadsqwcq", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/EmailConfigurationCreateSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/EmailConfigurationCreateSamples.java new file mode 100644 index 000000000000..8601a5c00e59 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/EmailConfigurationCreateSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +import com.azure.resourcemanager.recoveryservicesdatareplication.models.EmailConfigurationModelProperties; +import java.util.Arrays; + +/** Samples for EmailConfiguration Create. */ +public final class EmailConfigurationCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/EmailConfiguration_Create.json + */ + /** + * Sample code: EmailConfiguration_Create. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void emailConfigurationCreate( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .emailConfigurations() + .define("0") + .withExistingReplicationVault("rgrecoveryservicesdatareplication", "4") + .withProperties( + new EmailConfigurationModelProperties() + .withSendToOwners(true) + .withCustomEmailAddresses(Arrays.asList("ketvbducyailcny")) + .withLocale("vpnjxjvdqtebnucyxiyrjiko")) + .create(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/EmailConfigurationGetSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/EmailConfigurationGetSamples.java new file mode 100644 index 000000000000..292890590ee2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/EmailConfigurationGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for EmailConfiguration Get. */ +public final class EmailConfigurationGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/EmailConfiguration_Get.json + */ + /** + * Sample code: EmailConfiguration_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void emailConfigurationGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .emailConfigurations() + .getWithResponse("rgrecoveryservicesdatareplication", "4", "0", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/EmailConfigurationListSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/EmailConfigurationListSamples.java new file mode 100644 index 000000000000..806868b97e51 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/EmailConfigurationListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for EmailConfiguration List. */ +public final class EmailConfigurationListSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/EmailConfiguration_List.json + */ + /** + * Sample code: EmailConfiguration_List. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void emailConfigurationList( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager.emailConfigurations().list("rgrecoveryservicesdatareplication", "4", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/EventGetSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/EventGetSamples.java new file mode 100644 index 000000000000..c1e67df949f0 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/EventGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for Event Get. */ +public final class EventGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Event_Get.json + */ + /** + * Sample code: Event_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void eventGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .events() + .getWithResponse("rgrecoveryservicesdatareplication", "4", "231CIG", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/EventListSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/EventListSamples.java new file mode 100644 index 000000000000..50466ed4c59d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/EventListSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for Event List. */ +public final class EventListSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Event_List.json + */ + /** + * Sample code: Event_List. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void eventList( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .events() + .list( + "rgrecoveryservicesdatareplication", + "4", + "wbglupjzvkirtgnnyasxom", + "cxtufi", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/FabricCreateSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/FabricCreateSamples.java new file mode 100644 index 000000000000..15cb5ca7eb92 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/FabricCreateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +import com.azure.resourcemanager.recoveryservicesdatareplication.models.FabricModelCustomProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.FabricModelProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Fabric Create. */ +public final class FabricCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Fabric_Create.json + */ + /** + * Sample code: Fabric_Create. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void fabricCreate( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .fabrics() + .define("wPR") + .withRegion("tqygutlpob") + .withExistingResourceGroup("rgrecoveryservicesdatareplication") + .withProperties(new FabricModelProperties().withCustomProperties(new FabricModelCustomProperties())) + .withTags(mapOf("key3917", "fakeTokenPlaceholder")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/FabricDeleteSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/FabricDeleteSamples.java new file mode 100644 index 000000000000..d52c1814358a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/FabricDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for Fabric Delete. */ +public final class FabricDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Fabric_Delete.json + */ + /** + * Sample code: Fabric_Delete. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void fabricDelete( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager.fabrics().delete("rgrecoveryservicesdatareplication", "wPR", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/FabricGetByResourceGroupSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/FabricGetByResourceGroupSamples.java new file mode 100644 index 000000000000..ec5fdeb4b112 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/FabricGetByResourceGroupSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for Fabric GetByResourceGroup. */ +public final class FabricGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Fabric_Get.json + */ + /** + * Sample code: Fabric_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void fabricGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .fabrics() + .getByResourceGroupWithResponse( + "rgrecoveryservicesdatareplication", "wPR", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/FabricListByResourceGroupSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/FabricListByResourceGroupSamples.java new file mode 100644 index 000000000000..901815ae2883 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/FabricListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for Fabric ListByResourceGroup. */ +public final class FabricListByResourceGroupSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Fabric_List.json + */ + /** + * Sample code: Fabric_List. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void fabricList( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .fabrics() + .listByResourceGroup("rgrecoveryservicesdatareplication", "mjzsxwwmtvd", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/FabricListSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/FabricListSamples.java new file mode 100644 index 000000000000..ebb7ddfcf025 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/FabricListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for Fabric List. */ +public final class FabricListSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Fabric_ListBySubscription.json + */ + /** + * Sample code: Fabric_ListBySubscription. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void fabricListBySubscription( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager.fabrics().list("rmgqrpzucsizbyjscxzockbiyg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/FabricOperationsStatusGetSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/FabricOperationsStatusGetSamples.java new file mode 100644 index 000000000000..544a2188496c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/FabricOperationsStatusGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for FabricOperationsStatus Get. */ +public final class FabricOperationsStatusGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/FabricOperationsStatus_Get.json + */ + /** + * Sample code: FabricOperationsStatus_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void fabricOperationsStatusGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .fabricOperationsStatus() + .getWithResponse("rgrecoveryservicesdatareplication", "wPR", "dvfwerv", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/FabricUpdateSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/FabricUpdateSamples.java new file mode 100644 index 000000000000..ad35acde10cf --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/FabricUpdateSamples.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.recoveryservicesdatareplication.generated; + +import com.azure.resourcemanager.recoveryservicesdatareplication.models.FabricModel; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.FabricModelCustomProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.FabricModelProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Fabric Update. */ +public final class FabricUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Fabric_Update.json + */ + /** + * Sample code: Fabric_Update. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void fabricUpdate( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + FabricModel resource = + manager + .fabrics() + .getByResourceGroupWithResponse( + "rgrecoveryservicesdatareplication", "wPR", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key6664", "fakeTokenPlaceholder")) + .withProperties(new FabricModelProperties().withCustomProperties(new FabricModelCustomProperties())) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/OperationsListSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/OperationsListSamples.java new file mode 100644 index 000000000000..9023d2de1ff7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/OperationsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Operations_List.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void operationsList( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/PolicyCreateSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/PolicyCreateSamples.java new file mode 100644 index 000000000000..078d96cec1dd --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/PolicyCreateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +import com.azure.resourcemanager.recoveryservicesdatareplication.models.PolicyModelCustomProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.PolicyModelProperties; + +/** Samples for Policy Create. */ +public final class PolicyCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Policy_Create.json + */ + /** + * Sample code: Policy_Create. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void policyCreate( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .policies() + .define("fafqwc") + .withExistingReplicationVault("rgrecoveryservicesdatareplication", "4") + .withProperties(new PolicyModelProperties().withCustomProperties(new PolicyModelCustomProperties())) + .create(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/PolicyDeleteSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/PolicyDeleteSamples.java new file mode 100644 index 000000000000..8ea23a921dcb --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/PolicyDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for Policy Delete. */ +public final class PolicyDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Policy_Delete.json + */ + /** + * Sample code: Policy_Delete. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void policyDelete( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .policies() + .delete("rgrecoveryservicesdatareplication", "4", "wqfscsdv", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/PolicyGetSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/PolicyGetSamples.java new file mode 100644 index 000000000000..9a3368e1cf7c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/PolicyGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for Policy Get. */ +public final class PolicyGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Policy_Get.json + */ + /** + * Sample code: Policy_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void policyGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .policies() + .getWithResponse("rgrecoveryservicesdatareplication", "4", "wdqsacasc", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/PolicyListSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/PolicyListSamples.java new file mode 100644 index 000000000000..68f2a84667a8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/PolicyListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for Policy List. */ +public final class PolicyListSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Policy_List.json + */ + /** + * Sample code: Policy_List. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void policyList( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager.policies().list("rgrecoveryservicesdatareplication", "4", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/PolicyOperationStatusGetSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/PolicyOperationStatusGetSamples.java new file mode 100644 index 000000000000..c75d6f2c4e6b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/PolicyOperationStatusGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for PolicyOperationStatus Get. */ +public final class PolicyOperationStatusGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/PolicyOperationStatus_Get.json + */ + /** + * Sample code: PolicyOperationStatus_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void policyOperationStatusGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .policyOperationStatus() + .getWithResponse( + "rgrecoveryservicesdatareplication", "4", "xczxcwec", "wdqfsdxv", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemCreateSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemCreateSamples.java new file mode 100644 index 000000000000..c3128d21b724 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemCreateSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ProtectedItemModelCustomProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ProtectedItemModelProperties; + +/** Samples for ProtectedItem Create. */ +public final class ProtectedItemCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/ProtectedItem_Create.json + */ + /** + * Sample code: ProtectedItem_Create. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void protectedItemCreate( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .protectedItems() + .define("d") + .withExistingReplicationVault("rgrecoveryservicesdatareplication", "4") + .withProperties( + new ProtectedItemModelProperties() + .withPolicyName("tjoeiynplt") + .withReplicationExtensionName("jwxdo") + .withCustomProperties(new ProtectedItemModelCustomProperties())) + .create(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemDeleteSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemDeleteSamples.java new file mode 100644 index 000000000000..6b1125a593a7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for ProtectedItem Delete. */ +public final class ProtectedItemDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/ProtectedItem_Delete.json + */ + /** + * Sample code: ProtectedItem_Delete. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void protectedItemDelete( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .protectedItems() + .delete("rgrecoveryservicesdatareplication", "4", "d", true, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemGetSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemGetSamples.java new file mode 100644 index 000000000000..8a0463989460 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for ProtectedItem Get. */ +public final class ProtectedItemGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/ProtectedItem_Get.json + */ + /** + * Sample code: ProtectedItem_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void protectedItemGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .protectedItems() + .getWithResponse("rgrecoveryservicesdatareplication", "4", "d", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemListSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemListSamples.java new file mode 100644 index 000000000000..9f34b3165670 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for ProtectedItem List. */ +public final class ProtectedItemListSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/ProtectedItem_List.json + */ + /** + * Sample code: ProtectedItem_List. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void protectedItemList( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager.protectedItems().list("rgrecoveryservicesdatareplication", "4", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemOperationStatusGetSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemOperationStatusGetSamples.java new file mode 100644 index 000000000000..89aa4411f5ca --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemOperationStatusGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for ProtectedItemOperationStatus Get. */ +public final class ProtectedItemOperationStatusGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/ProtectedItemOperationStatus_Get.json + */ + /** + * Sample code: ProtectedItemOperationStatus_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void protectedItemOperationStatusGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .protectedItemOperationStatus() + .getWithResponse( + "rgrecoveryservicesdatareplication", "4", "d", "wdqacsc", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemPlannedFailoverSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemPlannedFailoverSamples.java new file mode 100644 index 000000000000..ebcf4f6a0b99 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ProtectedItemPlannedFailoverSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.PlannedFailoverModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.PlannedFailoverModelCustomProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.PlannedFailoverModelProperties; + +/** Samples for ProtectedItem PlannedFailover. */ +public final class ProtectedItemPlannedFailoverSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/ProtectedItem_PlannedFailover.json + */ + /** + * Sample code: ProtectedItem_PlannedFailover. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void protectedItemPlannedFailover( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .protectedItems() + .plannedFailover( + "rgrecoveryservicesdatareplication", + "4", + "d", + new PlannedFailoverModelInner() + .withProperties( + new PlannedFailoverModelProperties() + .withCustomProperties(new PlannedFailoverModelCustomProperties())), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/RecoveryPointsGetSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/RecoveryPointsGetSamples.java new file mode 100644 index 000000000000..1ad110470fbc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/RecoveryPointsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for RecoveryPoints Get. */ +public final class RecoveryPointsGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/RecoveryPoints_Get.json + */ + /** + * Sample code: RecoveryPoints_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void recoveryPointsGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .recoveryPoints() + .getWithResponse("rgrecoveryservicesdatareplication", "4", "d", "1X", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/RecoveryPointsListSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/RecoveryPointsListSamples.java new file mode 100644 index 000000000000..c5298691bde6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/RecoveryPointsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for RecoveryPoints List. */ +public final class RecoveryPointsListSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/RecoveryPoints_List.json + */ + /** + * Sample code: RecoveryPoints_List. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void recoveryPointsList( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager.recoveryPoints().list("rgrecoveryservicesdatareplication", "4", "d", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ReplicationExtensionCreateSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ReplicationExtensionCreateSamples.java new file mode 100644 index 000000000000..067792de1c5a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ReplicationExtensionCreateSamples.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.recoveryservicesdatareplication.generated; + +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ReplicationExtensionModelCustomProperties; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ReplicationExtensionModelProperties; + +/** Samples for ReplicationExtension Create. */ +public final class ReplicationExtensionCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/ReplicationExtension_Create.json + */ + /** + * Sample code: ReplicationExtension_Create. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void replicationExtensionCreate( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .replicationExtensions() + .define("g16yjJ") + .withExistingReplicationVault("rgrecoveryservicesdatareplication", "4") + .withProperties( + new ReplicationExtensionModelProperties() + .withCustomProperties(new ReplicationExtensionModelCustomProperties())) + .create(); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ReplicationExtensionDeleteSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ReplicationExtensionDeleteSamples.java new file mode 100644 index 000000000000..35c49d3d844a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ReplicationExtensionDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for ReplicationExtension Delete. */ +public final class ReplicationExtensionDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/ReplicationExtension_Delete.json + */ + /** + * Sample code: ReplicationExtension_Delete. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void replicationExtensionDelete( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .replicationExtensions() + .delete("rgrecoveryservicesdatareplication", "4", "g16yjJ", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ReplicationExtensionGetSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ReplicationExtensionGetSamples.java new file mode 100644 index 000000000000..5af55d1b0b80 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ReplicationExtensionGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for ReplicationExtension Get. */ +public final class ReplicationExtensionGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/ReplicationExtension_Get.json + */ + /** + * Sample code: ReplicationExtension_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void replicationExtensionGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .replicationExtensions() + .getWithResponse("rgrecoveryservicesdatareplication", "4", "g16yjJ", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ReplicationExtensionListSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ReplicationExtensionListSamples.java new file mode 100644 index 000000000000..195021731243 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ReplicationExtensionListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for ReplicationExtension List. */ +public final class ReplicationExtensionListSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/ReplicationExtension_List.json + */ + /** + * Sample code: ReplicationExtension_List. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void replicationExtensionList( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .replicationExtensions() + .list("rgrecoveryservicesdatareplication", "4", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ResourceProviderCheckNameAvailabilityS.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ResourceProviderCheckNameAvailabilityS.java new file mode 100644 index 000000000000..9dcb06d01810 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ResourceProviderCheckNameAvailabilityS.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +import com.azure.resourcemanager.recoveryservicesdatareplication.models.CheckNameAvailabilityModel; + +/** Samples for ResourceProvider CheckNameAvailability. */ +public final class ResourceProviderCheckNameAvailabilityS { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/CheckNameAvailability.json + */ + /** + * Sample code: CheckNameAvailability. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void checkNameAvailability( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .resourceProviders() + .checkNameAvailabilityWithResponse( + "trfqtbtmusswpibw", + new CheckNameAvailabilityModel().withName("updkdcixs").withType("gngmcancdauwhdixjjvqnfkvqc"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ResourceProviderDeploymentPreflightSam.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ResourceProviderDeploymentPreflightSam.java new file mode 100644 index 000000000000..ef57b8b94b1d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/ResourceProviderDeploymentPreflightSam.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +import com.azure.resourcemanager.recoveryservicesdatareplication.fluent.models.DeploymentPreflightModelInner; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.DeploymentPreflightResource; +import java.util.Arrays; + +/** Samples for ResourceProvider DeploymentPreflight. */ +public final class ResourceProviderDeploymentPreflightSam { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/DeploymentPreflight.json + */ + /** + * Sample code: DeploymentPreflight. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void deploymentPreflight( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .resourceProviders() + .deploymentPreflightWithResponse( + "rgrecoveryservicesdatareplication", + "kjoiahxljomjcmvabaobumg", + new DeploymentPreflightModelInner() + .withResources( + Arrays + .asList( + new DeploymentPreflightResource() + .withName("xtgugoflfc") + .withType("nsnaptduolqcxsikrewvgjbxqpt") + .withLocation("cbsgtxkjdzwbyp") + .withApiVersion("otihymhvzblycdoxo"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/VaultCreateSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/VaultCreateSamples.java new file mode 100644 index 000000000000..d0ef81e84e3f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/VaultCreateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ReplicationVaultType; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.VaultModelProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Vault Create. */ +public final class VaultCreateSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Vault_Create.json + */ + /** + * Sample code: Vault_Create. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void vaultCreate( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .vaults() + .define("4") + .withRegion("eck") + .withExistingResourceGroup("rgrecoveryservicesdatareplication") + .withTags(mapOf("key5359", "fakeTokenPlaceholder")) + .withProperties(new VaultModelProperties().withVaultType(ReplicationVaultType.DISASTER_RECOVERY)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/VaultDeleteSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/VaultDeleteSamples.java new file mode 100644 index 000000000000..b5a21a10e28d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/VaultDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for Vault Delete. */ +public final class VaultDeleteSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Vault_Delete.json + */ + /** + * Sample code: Vault_Delete. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void vaultDelete( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager.vaults().delete("rgrecoveryservicesdatareplication", "4", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/VaultGetByResourceGroupSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/VaultGetByResourceGroupSamples.java new file mode 100644 index 000000000000..75295945dee2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/VaultGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for Vault GetByResourceGroup. */ +public final class VaultGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Vault_Get.json + */ + /** + * Sample code: Vault_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void vaultGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .vaults() + .getByResourceGroupWithResponse("rgrecoveryservicesdatareplication", "4", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/VaultListByResourceGroupSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/VaultListByResourceGroupSamples.java new file mode 100644 index 000000000000..e90d4ab6858d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/VaultListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for Vault ListByResourceGroup. */ +public final class VaultListByResourceGroupSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Vault_List.json + */ + /** + * Sample code: Vault_List. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void vaultList( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .vaults() + .listByResourceGroup("rgrecoveryservicesdatareplication", "mwculdaqndp", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/VaultListSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/VaultListSamples.java new file mode 100644 index 000000000000..0568ddc22c4c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/VaultListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for Vault List. */ +public final class VaultListSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Vault_ListBySubscription.json + */ + /** + * Sample code: Vault_ListBySubscription. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void vaultListBySubscription( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager.vaults().list("dqsjhseyugyexxrlrln", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/VaultOperationStatusGetSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/VaultOperationStatusGetSamples.java new file mode 100644 index 000000000000..069b030a4e25 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/VaultOperationStatusGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for VaultOperationStatus Get. */ +public final class VaultOperationStatusGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/VaultOperationStatus_Get.json + */ + /** + * Sample code: VaultOperationStatus_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void vaultOperationStatusGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .vaultOperationStatus() + .getWithResponse("rgrecoveryservicesdatareplication", "4", "vsdvwe", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/VaultUpdateSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/VaultUpdateSamples.java new file mode 100644 index 000000000000..4b9d567e2d9c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/VaultUpdateSamples.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.recoveryservicesdatareplication.generated; + +import com.azure.resourcemanager.recoveryservicesdatareplication.models.ReplicationVaultType; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.VaultModel; +import com.azure.resourcemanager.recoveryservicesdatareplication.models.VaultModelProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Vault Update. */ +public final class VaultUpdateSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Vault_Update.json + */ + /** + * Sample code: Vault_Update. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void vaultUpdate( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + VaultModel resource = + manager + .vaults() + .getByResourceGroupWithResponse( + "rgrecoveryservicesdatareplication", "4", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key8872", "fakeTokenPlaceholder")) + .withProperties(new VaultModelProperties().withVaultType(ReplicationVaultType.DISASTER_RECOVERY)) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/WorkflowGetSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/WorkflowGetSamples.java new file mode 100644 index 000000000000..a10fd56b964d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/WorkflowGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for Workflow Get. */ +public final class WorkflowGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Workflow_Get.json + */ + /** + * Sample code: Workflow_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void workflowGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .workflows() + .getWithResponse("rgrecoveryservicesdatareplication", "4", "ZGH4y", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/WorkflowListSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/WorkflowListSamples.java new file mode 100644 index 000000000000..2171c4aed51e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/WorkflowListSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for Workflow List. */ +public final class WorkflowListSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/Workflow_List.json + */ + /** + * Sample code: Workflow_List. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void workflowList( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .workflows() + .list( + "rgrecoveryservicesdatareplication", + "4", + "mnebpgmjcitjleipnttx", + "rdavrzbethhslmkqgajontnxsue", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/WorkflowOperationStatusGetSamples.java b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/WorkflowOperationStatusGetSamples.java new file mode 100644 index 000000000000..3bb629483dc7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/src/samples/java/com/azure/resourcemanager/recoveryservicesdatareplication/generated/WorkflowOperationStatusGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesdatareplication.generated; + +/** Samples for WorkflowOperationStatus Get. */ +public final class WorkflowOperationStatusGetSamples { + /* + * x-ms-original-file: specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/examples/WorkflowOperationStatus_Get.json + */ + /** + * Sample code: WorkflowOperationStatus_Get. + * + * @param manager Entry point to RecoveryServicesDataReplicationManager. + */ + public static void workflowOperationStatusGet( + com.azure.resourcemanager.recoveryservicesdatareplication.RecoveryServicesDataReplicationManager manager) { + manager + .workflowOperationStatus() + .getWithResponse( + "rgrecoveryservicesdatareplication", "4", "ZGH4y", "wdqcxc", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesdatareplication/ci.yml b/sdk/recoveryservicesdatareplication/ci.yml new file mode 100644 index 000000000000..d5e8b1234119 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/ci.yml @@ -0,0 +1,47 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservicesdatareplication/ci.yml + - sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/ + exclude: + - sdk/recoveryservicesdatareplication/pom.xml + - sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservicesdatareplication/ci.yml + - sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/ + exclude: + - sdk/recoveryservicesdatareplication/pom.xml + - sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/pom.xml + +parameters: + - name: release_azureresourcemanagerrecoveryservicesdatareplication + displayName: azure-resourcemanager-recoveryservicesdatareplication + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: recoveryservicesdatareplication + EnableBatchRelease: true + Artifacts: + - name: azure-resourcemanager-recoveryservicesdatareplication + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerrecoveryservicesdatareplication + releaseInBatch: ${{ parameters.release_azureresourcemanagerrecoveryservicesdatareplication }} diff --git a/sdk/recoveryservicesdatareplication/pom.xml b/sdk/recoveryservicesdatareplication/pom.xml new file mode 100644 index 000000000000..65806bca2888 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-recoveryservicesdatareplication-service + pom + 1.0.0 + + + azure-resourcemanager-recoveryservicesdatareplication + +